fsflags

Swap FP exception flags Pseudo-instruction

Swaps the second register into the FP exception flags, storing the old flags in the first, or, when given one register, only writes that register.

RISC-V manual: csrrw

Forms

  • Write FP exception flags

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.
# Initialize fflags, then use fsflags to read its old value or update it.
.text
li t3, 0
csrw t3, fflags
li t0, 1
fsflags t1, t0
# t1=0 is the old value; fflags becomes 1.