FROUND.S
Float Round to Integer
FROUND.S rd, rs1, rm
Rounds a single-precision value to an integral value, in floating-point format, using the rm field.
Encoding
Binary Layout
010000000100
31:20
rs1
19:15
rm
14:12
rd
11:7
1010011
6:0
Operands
-
rd
Destination floating-point register -
rs1
Source floating-point register -
rm
Rounding mode
Example
FROUND.S t0, a0, rm
Related
More in Zfa
Reference
View in RISC-V Unprivileged ISA Specification ↗
RISC-V ISA Manual
Description
Rounds the single-precision value in rs1 to an integer according to the rounding mode in the rm field and writes that integer, still in single-precision format, to rd. Zero and infinite inputs are copied unmodified. A signalling NaN input sets the invalid flag; no other exception flags are set (FROUNDNX.S also sets inexact).
Operation
F[rd] = round_to_integral(F[rs1], rm);