问题
I have the following armv8-a code and I am getting the assembler error. I am unable to figure out the error
#include <stdio.h>
#include <arm_neon.h>
int main(char source)
{
char a = 10, b = 10, c = 10, d = 10;
uint16_t sum;
uint8x8_t src0 = vld1_u8(source);
uint8x8_t src1 = vld1_u8(source + 8);
uint8x8_t src2 = vld1_u8(source + 16);
uint8x8_t src3 = vld1_u8(source + 24);
uint16x8_t dst0 = vmulq_n_u16(vmovl_u8(src0), 32 - a);
uint16x8_t dst1 = vmulq_n_u16(vmovl_u8(src1), b);
uint16x8_t dst2 = vmulq_n_u16(vmovl_u8(src2), 32 - c);
uint16x8_t dst3 = vmulq_n_u16(vmovl_u8(src3), d);
dst0 = vaddq_u16(dst0, dst1);
dst2 = vaddq_u16(dst2, dst3);
dst0 = vaddq_u16(dst0, dst2);
sum = vaddvq_u16(dst0);
return sum;
}
Error while compiling on gcc 7.4.0 version (command used gcc -O3 main.c):
/tmp/ccAKq1je.s: Assembler messages:
/tmp/ccAKq1je.s:884: Error: register number out of range 0 to 15 at operand 3 -- `mla v1.8h,v23.8h,v24.h[0]`
/tmp/ccAKq1je.s:906: Error: register number out of range 0 to 15 at operand 3 -- `mla v0.8h,v22.8h,v23.h[0]'
I have similar code that doesn't use vmovl_u8 instruction and gets compiled succesfully. Getting error while using vmovl_u8 instruction. Please help me.
来源:https://stackoverflow.com/questions/64739782/why-do-i-get-assembler-error-while-using-vmovl-u8-instruction-of-armv8-a