prefetch.i
Cache block prefetch for instruction fetch
- Extension
- Zicbom/Zicbop/Zicboz
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
prefetch.i 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] | 00000 | rs1 | 110 | 00000 | 00100 | 11 | |||||||||||||||||||||||||
Match 0x00006013, mask 0x01f07fff. Source: $pseudo_op rv_i::ori prefetch.i rs1 imm12hi 24..20=0 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.i 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 an instruction fetch in the near future.
Description from riscv-unified-db, reformatted.
Operation
XReg address = X[xs1] + $signed(imm << 5); prefetch_instruction(address);
Pseudocode in riscv-unified-db’s IDL, quoted unchanged.