FLT.S

RISC-V FLT.S Instruction Details

Instruction ManualR-type

single-precision floating-point less-than compare; writes the 0/1 Boolean result to integer register rd.

Instruction Syntax

flt.s rd, rs1, rs2
Operand Breakdown
rd: destination integer register receiving a 0 or 1 comparison result.
rs1/rs2: source floating-point registers; compare instructions do not use an rm rounding mode.
FFloating-Point Compare

Instruction Behavior

FLT.S compares the single-precision floating-point values in f[rs1] and f[rs2], then writes the Boolean result to integer register rd. FLT is a signaling comparison: any NaN makes the result 0 and sets NV. The comparison result is not a floating-point value and the instruction has no rm operand.

FLT.S Decode And Execute Animation

Shows the F-extension single-precision OP-FP flow: decode fields, read FP operands, perform FLT semantics, then write rd.

rd
rs1
rs2
flt.s
,
,
Execution Context
FLEN=32 / fmt=S (00)
funct3: less-than compare
fflags: example fflags remains 0
31..27
26..25
24..20
19..15
14..12
11..7
6..0
10100
FLT
00
fmt=S
01100
rs2
01011
rs1
001
funct3=001
01010
rd
1010011
OP-FP
Execution Data Path
instruction
0xA0C59553
opcode
1010011 -> OP-FP
funct5/fmt
10100 + S(00) -> FLT.S
funct3
001 -> less-than compare
rd/rs
a0(x10) / fa1(f11) / fa2(f12)
read
1.5, 2.25
FP op
1.5 < 2.25 -> 1
write
a0(x10) = 1; example fflags remains 0
Current Step

Fetch: show the 32-bit OP-FP encoding

The word is split as an R-type OP-FP instruction; single-precision OP-FP instructions use opcode 1010011.

encoding: 0xA0C59553
syntax : flt.s a0(x10), fa1(f11), fa2(f12)
result : a0(x10) = 1; example fflags remains 0

The comparison result is written to integer register x[rd] and is only 0 or 1; compare instructions do not use rm.

Single-precision Calculation
rs1
fa1(f11) = 1.5
rs2
fa2(f12) = 2.25
result
1.5 < 2.25 -> 1

The comparison result is written to integer register x[rd] and is only 0 or 1; compare instructions do not use rm.

This animation shows only F-extension ISA-visible OP-FP encoding, example numeric results, and fflags relationship; it does not model FPU pipelines, latency, every IEEE 754 corner case, or microarchitecture.

Quick Understanding & Search Notes

FLT.S bridges FP comparison to an integer Boolean result: it reads two FP registers but writes x[rd]=0/1.

funct5=10100 and funct3=001 select FLT, while fmt=00 selects the S format.
Any NaN produces result 0 and sets NV.
rd is an integer register; the instruction has no rm rounding field.

Common Usage Scenarios

Comparison & Detection

Understand this scenario with real code like «flt.s x10, f0, f1 # x10 = 1 if f0<f1 (signal NaN->NV,0)».

Floating-Point Conditions

Understand this scenario with real code like «flt.s x10, f0, f1 # x10 = 1 if f0<f1 (signal NaN->NV,0)».

Pre-Use Checklist

Syntax Check
  • rd: destination integer register receiving a 0 or 1 comparison result.
  • rs1/rs2: source floating-point registers; compare instructions do not use an rm rounding mode.
Semantic Check
  • Confirm the result is written to an integer register and is only 0 or 1.
  • Confirm quiet/signaling comparison behavior for NaNs and NV matches the need.

Pitfalls / Common Confusions

FLT is a signaling comparison, so any NaN sets NV and produces result 0.
rd is an integer register and receives 0 or 1, not a floating-point register.
The comparison has no rm field and performs no floating-point rounding.

FAQ

Is rd a floating-point register for FLT.S?

No. rd is an integer register holding the Boolean result 0 or 1.

How does FLT.S handle NaN operands?

Any NaN produces result 0 and sets NV.

Does FLT.S use rm rounding?

No. FP comparisons do not round; the encoded funct3 selects the compare kind.