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 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | x | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | Rn | Rd | ||||||||
| ftype | op | ||||||||||||||||||||||||||||||
000111100x101000010000xxxxxxxxxx
if not_bool(HaveFrintExt()) then {
throw(Error_Undefined())
};
let 'd = UInt(Rd);
let 'n = UInt(Rn);
esize : {32, 64} = 32;
match ftype {
0b00 => {
esize = 32
},
0b01 => {
esize = 64
},
[bitone, _] => {
throw(Error_Undefined())
}
};
let 'esize = esize;
let 'intsize = if [op[1]] == 0b0 then 32 else 64;
let rounding : FPRounding = if [op[0]] == 0b0 then FPRounding_ZERO else
FPRoundingMode(FPCR_read());
execute_aarch64_instrs_float_arithmetic_round_frint_32_64(d, esize, intsize, n, rounding)
CheckFPEnabled64();
let fpcr : FPCRType = FPCR_read();
let merge : bool = IsMerging(fpcr);
result : bits(128) = if merge then V_read(d, 128) else Zeros(128);
let operand : bits('esize) = V_read(n, esize);
result = Elem_set(result, 0, esize, FPRoundIntN(operand, fpcr, rounding, intsize));
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.