Created attachment 712 [details]
Compile error fix in PacketMath.h
The ARM DS-5 5.20 compiler fails compiling with the following errors:
"src/Core/arch/NEON/PacketMath.h", line 113: Error: #146: too many initializer values
Packet4f countdown = EIGEN_INIT_NEON_PACKET4(0, 1, 2, 3);
"src/Core/arch/NEON/PacketMath.h", line 118: Error: #146: too many initializer values
Packet4i countdown = EIGEN_INIT_NEON_PACKET4(0, 1, 2, 3);
"src/Core/arch/NEON/Complex.h", line 30: Error: #146: too many initializer values
static uint32x4_t p4ui_CONJ_XOR = EIGEN_INIT_NEON_PACKET4(0x00000000, 0x80000000, 0x00000000, 0x80000000);
"src/Core/arch/NEON/Complex.h", line 31: Error: #146: too many initializer values
static uint32x2_t p2ui_CONJ_XOR = EIGEN_INIT_NEON_PACKET2(0x00000000, 0x80000000);
I am currently using version 3.0.5 but trying the latest code it has the same problem. Whenever this is fixed, I will be updating to the latest version.
Could you try switching to the other definition of EIGEN_INIT_NEON_PACKET2/EIGEN_INIT_NEON_PACKET4 (in the current devel version, either line 54-55 or 58-59 in src/Core/arch/NEON/PacketMath.h). If that works, tell us which branch works and a flag which can detect your compiler.
The LLVM branch gives me a warning "extra braces are nonstandard" and the same error, too many initializer values.
Ok, would have been too easy :D
Do you have any documentation how to initialize a vector of 2/4 elements properly with your compiler?
If nothing helps, we may have to resort to storing the values in a stack-local array then load them into the actual Packet. (This would require adapting every call of EIGEN_INIT_NEON_PACKET#)
I sure would like easy. :)
There is this page on initializing vectors, though I wasn't sure if that was specific to the armcc compiler or not.
I'm not sure if you saw it or not, but I did attach a patch that works for me. It uses the load functions here
According to the neon guide, using loads is indeed the recommended way to go.
Then, I would also use loads for the 2x cases too.
and also use load for the 2d case:
Summary: Bug 1240: Remove any assumption on NEON vector types.
Excellent! Thanks Gael!