Hi Richard,
I don't have any comment on the overall aim of the patch series, but in
this particular
patch implementing casp it looks like you doesn't ensure the register
pairs for casp are
even-odd.
This is the restriction in the Arm Arm decode for casp variants as
if Rs<0> == '1' then UnallocatedEncoding();
if Rt<0> == '1' then UnallocatedEncoding();
Example testcase where this trips up:
#include <stdatomic.h>
#include <stdbool.h>
bool
foo (__int128 *ptr)
{
register __int128 a __asm ("x3") = 0;
__int128 b = 0;
// This statement to ensure "a" is indeed put into x3,x4
asm ("" : "=r" (a) : "0" (a));
return __sync_bool_compare_and_swap (ptr, b, a);
}
$ build-aarch64-none-elf/install/bin/aarch64-none-elf-gcc \
$ -matomic-ool \
$ -march=armv8.4-a \
$ -O3 \
$ -o test \
$ -c ~/test.c
/tmp/cc0dw2At.s: Assembler messages:
/tmp/cc0dw2At.s:15: Error: reg pair must start from even reg at operand
1 -- `caspal x1,x2,x3,x4,[x0]'
gnu-work [14:01:14] $