# `fcvt.w.s`

[RISC-V Documentation](https://asm-editor.specy.app/documentation/risc-v.md) › [Instructions](https://asm-editor.specy.app/documentation/risc-v/instruction.md)

Web page: https://asm-editor.specy.app/documentation/risc-v/instruction/fcvt.w.s

**Convert signed integer from float**

Category: Floating point

Rounds the single-precision value in the second register to a signed 32-bit integer and stores it in the first.

[RISC-V manual: fcvt.w.s](https://docs.riscv.org/reference/isa/v20260120/unpriv/f-st-ext.html#norm:fcvt-l-s_fcvt-w-s_op)

Used in: [Floating point and the F and D extensions](https://asm-editor.specy.app/learn/courses/risc-v/think-in-assembly/floating-point-and-the-f-and-d-extensions.md) (RISC-V assembly)

## Forms

- `fcvt.w.s t1, f1, rm`

## 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.

- `fcvt.w.s t1, f1`
  - `fcvt.w.s t1, f1` → `fcvt.w.s t1, f1, dyn`

## Operands

- `t1`: Any integer register, `x0` to `x31`, or its named alias, such as `zero`, `t0` or `t6`.
- `f1`: Any floating-point register, `f0` to `f31`, or its named alias, such as `ft0`, `fa0` or `ft11`.
- `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) or `dyn` (use the rounding mode in `fcsr`).

## Example

```riscv
# 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
```
