Single-precision floating-point instructions using integer registers
Type: unprivileged
Zicsr and not F
| Version | State | Ratified |
|---|---|---|
| 1.0.0 | ratified | 2021-11 |
The "Zfinx" extension (pronounced "z-f-in-x") provides instructions similar to those in the standard floating-point F extension for single-precision floating-point instructions but which operate on the x registers instead of the f registers.
Note: -- The F extension uses separate f registers for floating-point computation, to reduce register pressure and simplify the provision of register-file ports for wide superscalars. However, the additional architectural state increases the minimal implementation cost. By eliminating the f registers, the Zfinx extension substantially reduces the cost of simple RISC-V implementations with floating-point instruction-set support. Zfinx also reduces context-switch cost.
In general, software that assumes the presence of the F extension is incompatible with software that assumes the presence of the Zfinx extension, and vice versa. --
The Zfinx extension adds all of the instructions that the F extension adds, except for the transfer instructions FLW, FSW, FMV.W.X, FMV.X.W, C.FLW[SP], and C.FSW[SP].
Zfinx software uses integer loads and stores to transfer floating-point values from and to memory. Transfers between registers use either integer arithmetic or floating-point sign-injection instructions.
The Zfinx variants of these F-extension instructions have the same semantics, except that whenever such an instruction would have accessed an f register, it instead accesses the x register with the same number.
Processing of Narrower Values
Floating-point operands of width w stem cec1626943fd22b8bc5d3763224c7c1f XLEN bits occupy bits w-1:0 of an x register. Floating-point operations on w-bit operands ignore operand bits XLEN-1: w.
Floating-point operations that produce w stem cec1626943fd22b8bc5d3763224c7c1f XLEN-bit results fill bits XLEN-1: w with copies of bit w-1 (the sign bit).
Note: -- The NaN-boxing scheme employed in the f registers was designed to efficiently support recoded floating-point formats. Recoding is less practical for Zfinx, though, since the same registers hold both floating-point and integer operands. Hence, the need for NaN boxing is diminished.
Sign-extending 32-bit floating-point numbers when held in RV64 x registers is compatible with the existing RV64 calling conventions, which leave bits 63-32 undefined when passing a 32-bit floating point value in x registers. To keep the architecture more regular, we extend this pattern to 16-bit floating-point numbers in both RV32 and RV64. --
csrrc — Atomic Read and Clear Bits in CSRcsrrci — Atomic Read and Clear Bits in CSR with Immediatecsrrs — Atomic Read and Set Bits in CSRcsrrsi — Atomic Read and Set Bits in CSR with Immediatecsrrw — Atomic Read/Write CSRcsrrwi — Atomic Read/Write CSR ImmediateVersion af3eaf9+cheriot.f635218
Data from the RISC-V Unified Database, copyright RISC-V International and contributors.
CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.
This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.