I'm trying to cross-compile some code with NEON datatypes with g++ 4.9.1, but I keep crashing the compiler. Is this type of operation not allowed, or is this a compiler problem? My OS is Ubuntu 12.04, and I'm using arm-gcc "gcc version 4.9.1 (Ubuntu/Linaro 4.9.1-10ubuntu2)"
Filename: crash.cpp
#include <arm_neon.h>
void crash(
const unsigned short * in,
unsigned short * out,
const int shift)
{
for(int x=0; x<200; x+=8) {
const uint16x8_t inValue = vld1q_u16(&in[x]);
const uint16x8_t normalizedValue = inValue >> shift;
vst1q_u16(&out[x], normalizedValue);
}
}
Compile options:
arm-linux-gnueabihf-g++-4.9 -mfpu=neon-vfpv4 -c crash.cpp -o crash.o
Output:
crash.cpp: In function ‘void crash(const short unsigned int*, short unsigned int*, int)’:
crash.cpp:11:51: internal compiler error: in copy_to_mode_reg, at explow.c:654
const uint16x8_t normalizedValue = inValue >> shift;
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.9/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccfz4aZr.out file, please attach this to your bugreport.
This code compiles fine if I replace the "unsigned short" with "unsigned int", the "uint16x8_t" with "uint32x4_t", and the "_u16" suffixes with "_u32" suffixes.
vshl
in this case). – Notlikethat