flh
Half-precision floating-point load
- Extension
- Zfhmin
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
flh fd, imm(xs1)- Length
- 32-bit
Encoding
| 3120 | 1915 | 1412 | 117 | 62 | 10 | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| imm[11:0] | rs1 | 001 | rd | 00001 | 11 | ||||||||||||||||||||||||||
Match 0x00001007, mask 0x0000707f. Source: flh rd rs1 imm12 14..12=1 6..2=0x01 1..0=3 in riscv-opcodes/extensions/rv_zfhmin.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| imm[11:0] | 31:20 | imm12 |
| rs1 | 19:15 | rs1 |
| rd | 11:7 | rd |
Description
The flh instruction loads a half-precision floating-point value from memory at address xs1 + imm into floating-point register fd.
flh does not modify the bits being transferred; in particular, the payloads of non-canonical NaNs are preserved.
flh is only guaranteed to execute atomically if the effective address is naturally aligned.
Description from riscv-unified-db, reformatted.
Operation
check_f_ok($encoding); XReg virtual_address = X[xs1] + $signed(imm); Bits<16> hp_value = read_memory(16, virtual_address, $encoding); F[fd] = nan_box(16, FLEN, hp_value); mark_f_state_dirty();
Pseudocode in riscv-unified-db’s IDL, quoted unchanged.