fcvt.w.s
Convert signed integer from float
Rounds the single-precision value in the second register to a signed 32-bit integer and stores it in the first.
Used in
- Floating point and the F and D extensionsRISC-V assembly
Forms
fcvt.w.s , ,
Pseudo-instructions
The processor does not have these forms. The assembler replaces each of them with one or more real instructions. Open a row to see them.
Operands
t1- Any integer register,
x0tox31, or its named alias, such aszero,t0ort6. f1- Any floating-point register,
f0tof31, or its named alias, such asft0,fa0orft11. rm- A rounding mode:
rne(nearest, ties to even),rtz(toward zero),rdn(toward negative infinity),rup(toward positive infinity),rmm(nearest, ties away from zero) ordyn(use the rounding mode infcsr).
# Convert the value 6.0 from s to w; t1 becomes 6.
.text
li t0, 6
fcvt.s.w f1, t0
fcvt.w.s t1, f1