FRINTP (scalar)

Data processing (scalar floating-point and Advanced SIMD)

fixed bit field field the encoding fixes should be

Float arithmetic round frint

313029282726252423222120191817161514131211109876543210
00011110ftype100100110000RnRd
rmode

00011110xx100100110000xxxxxxxxxx

Decode Sail

let 'd = UInt(Rd);
let 'n = UInt(Rn);
esize : {16, 32, 64} = 16;
match ftype {
  0b00 => {
      esize = 32
  },
  0b01 => {
      esize = 64
  },
  0b10 => {
      throw(Error_Undefined())
  },
  0b11 => {
      if HaveFP16Ext() then {
          esize = 16
      } else {
          throw(Error_Undefined())
      }
  }
};
let 'esize = esize;
exact : bool = false;
rounding : FPRounding = undefined;
match rmode {
  [bitzero, _, _] => {
      rounding = FPDecodeRounding(rmode[1 .. 0])
  },
  0b100 => {
      rounding = FPRounding_TIEAWAY
  },
  0b101 => {
      throw(Error_Undefined())
  },
  0b110 => {
      rounding = FPRoundingMode(FPCR_read());
      exact = true
  },
  0b111 => {
      rounding = FPRoundingMode(FPCR_read())
  }
};
let rounding = rounding;
execute_aarch64_instrs_float_arithmetic_round_frint(d, esize, exact, n, rounding)

Operation Sail

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, FPRoundInt(operand, fpcr, rounding, exact));
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.