When does rm matter for fcvt.s.w?
When the integer value cannot be exactly represented in the destination floating-point format, rm or dynamic frm selects the rounding direction.
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].
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].
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».
When the integer value cannot be exactly represented in the destination floating-point format, rm or dynamic frm selects the rounding direction.
It differs by source/destination format, integer signedness, RV64 restrictions, and whether rounding or invalid conversion can occur.