I want to execute the assembler instruction vrhadd in C++ using __asm__.
I need to map the following function to ARM-specific instructions (using vrhadd), since the given codebase was developed on x86-64 and im using ARM64.
__asm__("vpavgb %[a], %[b], %[c]" : [c] "=x" (res) : [a] "x" (a), [b] "x" (b));
Where a, b and c are 256-bit SIMD register. Executing this line on my system throws:
error: couldn't allocate output register for constraint 'x' , because (I guess) x, as the constraint of the input operands, stands for a 256-bit vector operand in an AVX register (x86). On ARM it represents a 32, 64, or 128-bit floating-point/SIMD register in the ranges s0-s15, d0-d7, or q0-q3, respectively.
Since I could not find one, I was wondering if there is a direct equivalent of the x86-constraint x for ARM64?