Does FCVT.S.BF16 imply BF16 add/sub/mul/div support?
No. Zfbfmin/Zvfbfmin mainly provide BF16/FP32 conversion; Zvfbfwma provides widening multiply-accumulate.
Exactly widen BF16 to FP32.
Syntax: fcvt.s.bf16 rd, rs1[, rm]; both rd and rs1 select FP f0–f31, including readable/writable f0. rs2 is a fixed format selector, not a second source.
32-bit OP-FP: funct5=01000, fmt=00, rs2=00110, funct3=rm, opcode=1010011; no immediate.
RV32/RV64 Zfbfmin 1.0 requires F; enable the extensions and FP state. Widening is exact and mathematically unaffected by rm; software should encode RNE (000). Only NV may be added. Optional rm defaults to dyn in assembly; static rm=101/110 and dynamic frm=101–111 follow reserved-encoding rules.
Subnormals are supported. Sources narrower than FLEN require valid NaN-boxing; malformed boxes become canonical quiet NaN. Narrower results get upper ones. sNaN adds NV and NaN results are canonical; flags accrue without clearing prior flags or themselves causing FP traps.
FCVT.S.BF16 uses opcode 1010011 (0x53), funct7 0100000, rs2 fixed 6 (BF16). 32-bit OP-FP: funct5=01000, fmt=00, rs2=00110, funct3=rm, opcode=1010011; no immediate.
FCVT.S.BF16 (Zfbfmin, depending on F) exactly widens the NaN-boxed BF16 value in f[rs1] to single-precision FP32 and writes it to f[rd]. For normal values or infinity, the BF16 encoding is shifted left by 16 bits into the high half of the FP32 encoding and the low 16 fraction bits are zero-filled; the FP32 result is NaN-boxed in wider FLEN registers. The conversion needs no rounding, but inputs such as signaling NaNs may set Invalid.
FCVT.S.BF16 belongs to the RISC-V BF16 extensions; BF16 is a 16-bit FP format with 1 sign bit, 8 exponent bits, and 7 fraction bits.
fcvt.s.bf16 f0, f1, rne # boxed BF16 0x3FC0 (1.5) -> FP32 0x3FC00000 (1.5). Initialize the example source and enable the required extensions and state.
No. Zfbfmin/Zvfbfmin mainly provide BF16/FP32 conversion; Zvfbfwma provides widening multiply-accumulate.
Both rd and rs1 select FP registers f0–f31; f0 is readable and writable. Sources narrower than FLEN are checked for NaN-boxing; malformed boxes become canonical quiet NaN. Narrower results get all upper bits set to one.