prefetch.r
Cache block prefetch for data read
- Extension
- Zicbom/Zicbop/Zicboz
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
prefetch.r imm(xs1)- Length
- 32-bit
Encoding
listed in riscv-opcodes as a pseudo-op of ori
| 3125 | 2420 | 1915 | 1412 | 117 | 62 | 10 | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| imm[11:5] | 00001 | rs1 | 110 | 00000 | 00100 | 11 | |||||||||||||||||||||||||
Match 0x00106013, mask 0x01f07fff. Source: $pseudo_op rv_i::ori prefetch.r rs1 imm12hi 24..20=1 14..12=6 11..7=0 6..2=0x04 1..0=3 in riscv-opcodes/extensions/rv_zicbo.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| imm[11:5] | 31:25 | imm12hi |
| rs1 | 19:15 | rs1 |
Description
A prefetch.r instruction indicates to hardware that the cache block whose effective address is the sum of the base address specified in xs1 and the sign-extended offset encoded in imm[11:0], where imm[4:0] equals 0b00000, is likely to be accessed by a data read (i.e. load) in the near future.
Description from riscv-unified-db, reformatted.
Operation
XReg address = X[xs1] + $signed(imm << 5); prefetch_read(address);
Pseudocode in riscv-unified-db’s IDL, quoted unchanged.