fcvt.s.w

The `fcvt.s.w` instruction converts a 32-bit signed integer in integer register `xs1` into a floating-point number in floating-point register `fd`. All floating-point to integer and integer to floating-point conversion instructions round according to the `rm` field. A floating-point register can be initialized to floating-point positive zero using `fcvt.s.w fd, x0`, which will never set any exception flags. All floating-point conversion instructions set the Inexact exception flag if the rounded result differs from the operand value and the Invalid exception flag is not set.

Synopsis

fcvt.s.w fd, xs1, rm

Encoding

Type:

067111214151920311010011fdrmxs1110100000000
funct7: 1101000
funct3: ---
opcode: 1010011

RISC-V Instruction Encoder/Decoder

open fcvt.s.w in rvcodecjs

Availability