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 | 1 | 1 | 1 | 1 | 1 | 1 | Rn | Rd | |||||||||||||
| U | |||||||||||||||||||||||||||||||
011111110xxxxxxx111111xxxxxxxxxx
let 'd = UInt(Rd);
let 'n = UInt(Rn);
if (match immh {
[bitzero, bitzero, bitzero, _] => true,
_ => false
}) : bool | (match immh {
[bitzero, bitzero, bitone, _] => true,
_ => false
}) : bool & not_bool(HaveFP16Ext()) then {
throw(Error_Undefined())
};
let 'esize = if (match immh {
[bitone, _, _, _] => true,
_ => false
}) : bool then
64
else
if (match immh {
[bitzero, bitone, _, _] => true,
_ => false
}) : bool then
32
else
16;
let 'datasize = esize;
let 'elements = 1;
let 'fracbits = esize * 2 - UInt(immh @ immb);
let is_unsigned : bool = U == 0b1;
let rounding : FPRounding = FPRounding_ZERO;
execute_aarch64_instrs_vector_shift_conv_float_sisd(d, datasize, elements, esize, fracbits, n, rounding, 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 | 1 | 1 | 1 | 1 | 1 | 1 | Rn | Rd | |||||||||||||
| U | |||||||||||||||||||||||||||||||
0x1011110xxxxxxx111111xxxxxxxxxx
let 'd = UInt(Rd);
let 'n = UInt(Rn);
if immh == 0b0000 then {
throw(Error_See("asimdimm"))
};
if (match immh {
[bitzero, bitzero, bitzero, _] => true,
_ => false
}) : bool | (match immh {
[bitzero, bitzero, bitone, _] => true,
_ => false
}) : bool & not_bool(HaveFP16Ext()) then {
throw(Error_Undefined())
};
if ([immh[3]] @ Q) == 0b10 then {
throw(Error_Undefined())
};
let 'esize = if (match immh {
[bitone, _, _, _] => true,
_ => false
}) : bool then
64
else
if (match immh {
[bitzero, bitone, _, _] => true,
_ => false
}) : bool then
32
else
16;
let 'datasize = if Q == 0b1 then 128 else 64;
let 'elements = DIV(datasize, esize);
let 'fracbits = esize * 2 - UInt(immh @ immb);
let is_unsigned : bool = U == 0b1;
let rounding : FPRounding = FPRounding_ZERO;
execute_aarch64_instrs_vector_shift_conv_float_sisd(d, datasize, elements, esize, fracbits, n, rounding, is_unsigned)
CheckFPAdvSIMDEnabled64();
let operand : bits('datasize) = V_read(n, datasize);
element : bits('esize) = undefined;
let fpcr : FPCRType = FPCR_read();
let merge : bool = elements == 1 & IsMerging(fpcr);
result : bits(128) = if merge then V_read(d, 128) else Zeros(128);
foreach (e from 0 to (elements - 1) by 1 in inc) {
element = Elem_read(operand, e, esize);
result = Elem_set(result, e, esize, FPToFixed(element, fracbits, is_unsigned, fpcr, rounding, esize))
};
V_set(d, 128) = 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.