# `sext.w`

[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/sext.w

**Sign extend word** · Pseudo-instruction · RV64 only

Category: Arithmetic

Sets the first register to the low 32 bits of the second, sign-extended to 64 bits.

[RISC-V manual: addiw](https://docs.riscv.org/reference/isa/v20260120/unpriv/rv64.html#norm:addiw_op)

## Forms

- `sext.w t1, t2`
  - `sext.w t1, t2` → `addiw t1, t2, 0`

## Operands

- `t1`: Any integer register, `x0` to `x31`, or its named alias, such as `zero`, `t0` or `t6`.
- `t2`: An integer register. It may be the same register as `t1`.

## Example

```riscv64
.text
li t0, 2147483649
# t0=2147483649; sext.w writes −2147483647 (0xFFFFFFFF80000001) to t2.
sext.w t2, t0
```
