Which register classes do rd and rs1 use in fcvt.s.w?
This is an integer-to-floating-point conversion: rs1 is an integer register and rd is a floating-point register.
Convert signed int32 to SP FP: f[rd] = (float)rs1.
fcvt.s.w converts a signed 32-bit integer source to a single-precision floating-point result. If the value is not exactly representable, the result is rounded according to rm and written to f[rd].
Shows the F-extension FCVT flow: decode OP-FP fields, fmt/rs2 conversion selection, rm rounding, read the integer source, then write the floating-point destination.
The word is split as an R-type OP-FP instruction; FCVT conversion instructions use opcode 1010011.
The current 32-bit integer example is exactly representable as S format, so example fflags remains 0.
The current 32-bit integer example is exactly representable as S format, so example fflags remains 0.
This animation shows only F-extension FCVT ISA-visible encoding, source/destination register direction, rounding field, and example fflags; it does not model FPU pipelines, exception handling, NaN payloads, or microarchitecture.
fcvt.s.w reads a signed 32-bit integer from integer register rs1, converts it to single precision, and writes f[rd]; if not exactly representable, it rounds according to rm and sets NX.
Understand this scenario with real code like «fcvt.s.w f0, x10, rne # f0 = (float)(int)x10».
Understand this scenario with real code like «fcvt.s.w f0, x10, rne # f0 = (float)(int)x10».
This is an integer-to-floating-point conversion: rs1 is an integer register and rd is a floating-point register.
When the destination format cannot exactly represent the converted result, rm or DYN/frm selects the rounding direction; inexact conversion sets NX.
rs2 is not an ordinary source register; in the FCVT encoding it selects the W signed 32-bit integer format.