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 | Q | 1 | 0 | 1 | 1 | 1 | 0 | 0 | sz | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | Rn | Rd | ||||||||
| U | op | ||||||||||||||||||||||||||||||
0x1011100x100001111010xxxxxxxxxx
if not_bool(HaveFrintExt()) then {
throw(Error_Undefined())
};
let 'd = UInt(Rd);
let 'n = UInt(Rn);
if (sz @ Q) == 0b10 then {
throw(Error_Undefined())
};
let 'esize = (32 << UInt(sz));
let 'datasize = if Q == 0b1 then 128 else 64;
let 'elements = DIV(datasize, esize);
let 'intsize = if op == 0b0 then 32 else 64;
let rounding : FPRounding = if U == 0b0 then FPRounding_ZERO else
FPRoundingMode(FPCR_read());
execute_aarch64_instrs_vector_arithmetic_unary_float_round_frint_32_64(d, datasize, elements, esize, intsize, n, rounding)
CheckFPAdvSIMDEnabled64();
let operand : bits('datasize) = V_read(n, datasize);
result : bits('datasize) = undefined;
element : bits('esize) = undefined;
foreach (e from 0 to (elements - 1) by 1 in inc) {
element = Elem_read(operand, e, esize);
result = Elem_set(result, e, esize, FPRoundIntN(element, FPCR_read(), rounding, intsize))
};
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.