Data processing (scalar floating-point and Advanced SIMD)
fixed bit field field the encoding fixes should be
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | immh | immb | 0 | 0 | 0 | 1 | 0 | 1 | Rn | Rd | |||||||||||||
| U | o1 | o0 | |||||||||||||||||||||||||||||
011111110xxxxxxx000101xxxxxxxxxx
let 'd = UInt(Rd);
let 'n = UInt(Rn);
if [immh[3]] != 0b1 then {
throw(Error_Undefined())
};
let 'esize = (8 << 3);
let 'datasize = esize;
let 'elements = 1;
let 'shift = esize * 2 - UInt(immh @ immb);
let is_unsigned : bool = U == 0b1;
let round : bool = o1 == 0b1;
let accumulate : bool = o0 == 0b1;
execute_aarch64_instrs_vector_shift_right_sisd(accumulate, d, datasize, elements, esize, n, round, shift, is_unsigned)
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| 0 | Q | 1 | 0 | 1 | 1 | 1 | 1 | 0 | immh | immb | 0 | 0 | 0 | 1 | 0 | 1 | Rn | Rd | |||||||||||||
| U | o1 | o0 | |||||||||||||||||||||||||||||
0x1011110xxxxxxx000101xxxxxxxxxx
let 'd = UInt(Rd);
let 'n = UInt(Rn);
if immh == 0b0000 then {
throw(Error_See("asimdimm"))
};
if ([immh[3]] @ Q) == 0b10 then {
throw(Error_Undefined())
};
let 'esize = (8 << HighestSetBit(immh));
let 'datasize = if Q == 0b1 then 128 else 64;
let 'elements = DIV(datasize, esize);
let 'shift = esize * 2 - UInt(immh @ immb);
let is_unsigned : bool = U == 0b1;
let round : bool = o1 == 0b1;
let accumulate : bool = o0 == 0b1;
execute_aarch64_instrs_vector_shift_right_sisd(accumulate, d, datasize, elements, esize, n, round, shift, is_unsigned)
CheckFPAdvSIMDEnabled64();
assert(constraint('datasize in {8, 16, 32, 64, 128}));
let operand : bits('datasize) = V_read(n, datasize);
result : bits('datasize) = undefined;
element : int = undefined;
let operand2 : bits('datasize) = if accumulate then V_read(d, datasize) else
Zeros(datasize);
foreach (e from 0 to (elements - 1) by 1 in inc) {
assert(constraint('esize >= 0));
assert(constraint(('loop_e * 'esize <= 'loop_e * 'esize + 'esize - 1 | not(('loop_e >= 0 & ('loop_e + 1) * 'esize <= 'datasize)) | not('datasize in {8, 16, 32, 64, 128}))));
element = RShr(asl_Int(Elem_read(operand, e, esize), is_unsigned), shift, round);
result = Elem_set(result, e, esize, Elem_read(operand2, e, esize) + element[esize - 1 .. 0])
};
V_set(d, datasize) = result
Made from ScarletNX's Sail at 166ad3910f80. sail-arm's definitions are Arm's ASL in Sail (BSD 3-Clause Clear, license); ScarletNX's fixups are GPL-3.0-or-later.