C.FLW

RISC-V C.FLW Instruction Details

Instruction ManualCL-format

RV32FC compressed 32-bit floating-point load; base=x8–x15, destination=f8–f15.

Instruction Syntax

c.flw fd', offset(rs1')

The 3-bit fd′ field selects f8–f15; the 3-bit rs1′ field selects x8–x15 in a separate register file.

offset is already an unsigned byte offset: 0–124, in multiples of 4; the encoding implies 2 zero low bits.

RV32FC, with floating-point state enabled; a completed access loads 32 raw bits and sets upper bits to ones when FLEN is wider.

The effective address is base plus offset. Natural alignment raises no address-misaligned exception; misaligned outcomes are EEI-defined, and faults do not commit ordinary floating-point destination writeback.

CFCompressed Instruction

Instruction Behavior

A 16-bit RV32FC CL load: add an unsigned byte offset (0–124, multiples of 4) to x[rs1']; on completion, load the 32-bit memory pattern into fd'.

C.FLW Decode & Execute Animation

Shows only manual-defined 16-bit fields, operands, and ISA-visible results; it does not model a pipeline, cache, timing, or an implementation's memory-fault handling.

c.flw,(rs1')
Execution context

RV32FC; floating-point state enabled, ordinary address calculation (no address-transforming extensions), and memory bits already assembled using the environment's byte order.

This load teaching environment fixes FLEN=32. With a wider FLEN, the 32-bit transfer writes ones to the upper f-register bits, creating a valid NaN-boxed value.

Naturally aligned accesses do not raise an address-misaligned exception; whether a misaligned access completes or raises an address-misaligned/access-fault exception is EEI-defined. This control displays only the selected outcome branch.

x10 = 0x00001000; memory 32-bit pattern = 0x3F800000. -> 0x00001010 -> f8 = 0x3F800000.
16-bit encoding fields

rs1'=010 -> x10; fd'=000 -> f8; uimm=4 × 4 = 16 bytes (assembly offset)

15..13
funct3
011
12..10
uimm[5:3]
010
9..7
rs1'
010
6..5
uimm[2|6]
00
4..2
fd'
000
1..0
op
00
Execution data path
x10 = 0x00001000; memory 32-bit pattern = 0x3F800000.
0x00001010 = (0x00001000 + 16) mod 2^32
f8 <- 0x3F800000
Architectural state has not been committed.

Quick Understanding & Search Notes

A 16-bit RV32FC CL load: add an unsigned byte offset (0–124, multiples of 4) to x[rs1']; on completion, load the 32-bit memory pattern into fd'.

C.FLW has a real 16-bit CL encoding with FLW semantics.
This page uses RV32FC; the 3-bit rs1′ field maps to x8–x15 and the 3-bit fd′ field maps to f8–f15.
Assembly offset is already a byte offset: 0–124, in multiples of 4. The encoding implies 2 zero low bits; do not multiply the assembly value by 4 again.

Common Usage Scenarios

Floating-Point Memory Access

RV32FC, FLEN=32, floating-point state enabled, x10=0x1000, assembled memory bits=0x7f800001, access completes: c.flw f8, 0(x10) writes those bits unchanged to f8; with FLEN=64, upper 32 bits are also set to ones.

Pre-Use Checklist

Syntax Check
  • The 3-bit fd′ field selects f8–f15; the 3-bit rs1′ field selects x8–x15 in a separate register file.
  • offset is already an unsigned byte offset: 0–124, in multiples of 4; the encoding implies 2 zero low bits.
Semantic Check
  • RV32FC, with floating-point state enabled; a completed access loads 32 raw bits and sets upper bits to ones when FLEN is wider.
  • The effective address is base plus offset. Natural alignment raises no address-misaligned exception; misaligned outcomes are EEI-defined, and faults do not commit ordinary floating-point destination writeback.

Pitfalls / Common Confusions

C.FLW is defined only for RV32FC; RV64C uses the same encoding space for C.LD.
Assembly offset is 0–124 bytes in multiples of 4; do not scale it again.
Naturally aligned addresses do not raise an address-misaligned exception; the execution environment defines whether a misaligned access completes or raises an exception.
When FLEN is greater than 32, the narrower FLW transfer writes ones to the destination floating-point register's upper bits, creating a valid NaN-boxed single-precision value.

FAQ

How is the offset written for c.flw?

Use a byte offset from 0 through 124, in multiples of 4. For example, offset=16 adds 16 bytes to the address.

When is c.flw available?

This page uses RV32FC. Floating-point state must also be enabled and memory access permitted; an access exception does not commit an ordinary floating-point destination writeback.