ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 913 microarchs · 15,555 chips · 105 sources
Arch:
Tier:

fcvt.s.w

T1 riscv fp insn
Floating-Point Convert Word to Single-Precision
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRV32/RV64 F
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
Privilegeuser
ExtensionsF

Summary

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.

Syntax / Encoding

fcvt.s.w fd, xs1, rm | 110100000000xxxxxxxxxxxxx1010011 (mask=0xfff0007f match=0xd0000053)

Cross-Chip Latency & Throughput (11 cores)

MicroarchitectureLatency (cycles)Recip. TPuopsPortsSource
Tenstorrent Ascalon-X111AscalonFXBllvm_sched_models
Andes 45-Series211Andes45FMISCllvm_sched_models
SiFive P670 / P600211SiFiveP600MulI2Fllvm_sched_models
SiFive P870 / P800211SiFiveP800I2Fllvm_sched_models
SiFive 7-Series (U74)311PipeBllvm_sched_models
SpacemiT X10030.51SMTX100_FQ1llvm_sched_models
XiangShan KunMingHu311XSPipeBJU2llvm_sched_models
XiangShan NanHu30.251XS2FMACllvm_sched_models
MIPS P8700 (RISC-V)412p8700IssueFPUL+p8700FpuApullvm_sched_models
SpacemiT X60 (K1)40.51SMX60_IEUllvm_sched_models
Syntacore SCR7412FPU_IS+FALUllvm_sched_models

Binary Encodings (1)

WidthFormatBit PatternMask / Match
32RV110100000000xxxxxxxxxxxxx10100110xfff0007f / 0xd0000053

Operands

NameDescription
xs1bits [19:15]
rmbits [14:12]
fdbits [11:7]

Reference Notes

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.