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 | 1 | 1 | 1 | 0 | 1 | Rn | Rd | |||||||||||||
| U | op | ||||||||||||||||||||||||||||||
011111110xxxxxxx011101xxxxxxxxxx
let 'd = UInt(Rd);
let 'n = UInt(Rn);
if immh == 0b0000 then {
throw(Error_Undefined())
};
let 'esize = (8 << HighestSetBit(immh));
let 'datasize = esize;
let 'elements = 1;
let 'shift = UInt(immh @ immb) - esize;
src_unsigned : bool = undefined;
dst_unsigned : bool = undefined;
match op @ U {
0b00 => {
throw(Error_Undefined())
},
0b01 => {
src_unsigned = false;
dst_unsigned = true
},
0b10 => {
src_unsigned = false;
dst_unsigned = false
},
0b11 => {
src_unsigned = true;
dst_unsigned = true
}
};
let dst_unsigned = dst_unsigned;
let src_unsigned = src_unsigned;
assert(constraint(('esize in {4, 8, 16, 32, 64} & 'datasize in {4, 8, 16, 32, 64, 128})));
execute_aarch64_instrs_vector_shift_left_sat_sisd(d, datasize, dst_unsigned, elements, esize, n, shift, src_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 | 1 | 1 | 1 | 0 | 1 | Rn | Rd | |||||||||||||
| U | op | ||||||||||||||||||||||||||||||
0x1011110xxxxxxx011101xxxxxxxxxx
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 = UInt(immh @ immb) - esize;
src_unsigned : bool = undefined;
dst_unsigned : bool = undefined;
match op @ U {
0b00 => {
throw(Error_Undefined())
},
0b01 => {
src_unsigned = false;
dst_unsigned = true
},
0b10 => {
src_unsigned = false;
dst_unsigned = false
},
0b11 => {
src_unsigned = true;
dst_unsigned = true
}
};
let dst_unsigned = dst_unsigned;
let src_unsigned = src_unsigned;
assert(constraint('esize in {4, 8, 16, 32, 64}));
execute_aarch64_instrs_vector_shift_left_sat_sisd(d, datasize, dst_unsigned, elements, esize, n, shift, src_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;
sat : bool = undefined;
foreach (e from 0 to (elements - 1) by 1 in inc) {
element = (asl_Int(Elem_read(operand, e, esize), src_unsigned) << shift);
let (__tup_0 : bits('esize), __tup_1 : bool) =
SatQ(element, esize, dst_unsigned)
in
{
result = Elem_set(result, e, esize, __tup_0);
sat = __tup_1
};
if sat then {
FPSR[QC] = 0b1
};
()
};
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.