fmv.w.x
Floating-Point Move Single-Precision Word from Integer Register
- Extension
- F
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
fmv.w.x fd, xs1- Length
- 32-bit
Encoding
| 3127 | 2625 | 2420 | 1915 | 1412 | 117 | 62 | 10 | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 11110 | 00 | 00000 | rs1 | 000 | rd | 10100 | 11 | ||||||||||||||||||||||||
Match 0xf0000053, mask 0xfff0707f. Source: fmv.w.x rd rs1 24..20=0 31..27=0x1E 14..12=0 26..25=0 6..2=0x14 1..0=3 in riscv-opcodes/extensions/rv_f.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| rs1 | 19:15 | rs1 |
| rd | 11:7 | rd |
Description
The fmv.w.x instruction moves the single-precision value encoded in IEEE 754-2008 standard encoding
from the lower 32 bits of integer register xs1 to the floating-point register fd. The bits are not
modified in the transfer, and in particular, the payloads of non-canonical NaNs are preserved.
Description from riscv-unified-db, reformatted.
Operation
check_f_ok($encoding);
Bits<32> sp_value = X[xs1][31:0];
if (implemented?(ExtensionName::D)) {
F[fd] = nan_box(32, 64, sp_value);
} else {
F[fd] = sp_value;
}
mark_f_state_dirty();Pseudocode in riscv-unified-db’s IDL, quoted unchanged.