FLI.S

RISC-V FLI.S Instruction Details

Instruction ManualI-type

Load one single-precision floating-point constant from the 32-entry Zfa constant table.

Instruction Syntax

fli.s rd, constant
Operand Breakdown
rd: destination floating-point register.
constant: assembler-level Zfa FLI table constant; the machine encoding uses rs1 to select entries 0-31.
ZfaFFloating-Point Convert

Instruction Behavior

FLI.S selects one single-precision constant from the 32-entry Zfa floating-point constant table encoded by the instruction rs1 field and writes it to f[rd]. It is not an arbitrary immediate encoding; entry 1 is the target format's minimum positive normal number, entry 30 is +inf, and entry 31 is canonical NaN. Loading the constant sets no floating-point exception flags.

Quick Understanding & Search Notes

FLI.S answers whether common floating-point constants can be loaded without a memory literal pool. It can load only constants from the official 32-entry table, not arbitrary binary floating literals.

Entry 1 varies by target format and is the minimum positive normal number for H/S/D/Q.
Entries 30 and 31 are +inf and canonical NaN; loading them does not raise exception flags.

Common Usage Scenarios

Floating-Point Constants

Understand this scenario with real code like «fli.s f0, 1.0 # f0 = 1.0 (rs1=16)».

Code Size Optimization

Understand this scenario with real code like «fli.s f0, 1.0 # f0 = 1.0 (rs1=16)».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is I-type.
  • Confirm the operand order matches the example.
Semantic Check
  • Ensure the destination register usage is compatible with the calling convention.
  • Confirm this is not the lower-level form of a pseudo-instruction expansion.

Pitfalls / Common Confusions

The constant must be representable by the official FLI table; it is not an arbitrary floating-point immediate.
The rs1 field actually encodes a table index from 0 to 31.
Loading +inf or canonical NaN still sets no floating-point exception flags.

FAQ

Can FLI.S load any floating-point constant?

No. It can select only the 32 table entries defined by Zfa.

How is the constant encoded for FLI.S?

The assembler maps an accepted constant name or value to a 0-31 table index in the rs1 field.