Hello,
I made simple code to test inline NEON assembly using LLVM 3.6:
void jmpTest(float *a) {
float b[4] = {1.0, 2.0, 3.0, 4.0};
asm (
"vld1.f32 q0, [%[b]] \n\t"
"mov r1, #2 \n\t"
"vdup.f32 q1, r1 \n\t"
"vmul.f32 q0, q0, q1 \n\t"
"vst1.f32 q0, [%[a]] \n\t"
:
: [a] "r" (a), [b] "r" (b)
: "memory", "r1", "q0", "q1"
);
}
But i get this error:
Error: Neon quad precision register expected -- `vld1.f32 q0,[r2]'
Error: Neon quad precision register expected -- `vst1.f32 q0,[r0]'
it only happens when i try to load or store C++ variables. Also, this was not happening when i was using LLVM 3.5.
The syntax is the same as i have seen around the internet, what is it that it's not working?
I've solved this problem by replacing "q0" in the store and load instructions for "{d0,d1}"
"vld1.f32 {d0,d1}, [%[b]] \n\t"
"mov r1, #2 \n\t"
"vdup.f32 q1, r1 \n\t"
"vmul.f32 q0, q0, q1 \n\t"
"vst1.f32 {d0,d1}, [%[a]] \n\t"
:
: [a] "r" (a), [b] "r" (b)
: "memory", "r1", "q0", "q1"
I have no idea why 3.6 doesn't accept the other one, by this way it works