pref

Prefetch

Hints that the data at address ($t2 + offset) will be needed soon, so the hardware can begin moving it into cache.

Forms

  • pref , ()

Operands

imm5
An unsigned 5-bit immediate, 0 to 31, used for values such as a shift count.
imm16
A signed 16-bit immediate, -32768 to 32767.
$t2
Any general-purpose register, $0 to $31, using its numeric or named spelling, such as $8 or $t0 ($zero is $0; $ra is $31).

The first operand is the hint type. A prefetch is only ever a hint and never changes what a program computes; this simulator has no cache, so it does nothing. It is accepted so that compiler output assembles unchanged.

.data
.align 2
value: .word 42
.text
# Provide a valid address as a prefetch hint; inspect memory value remains 42.
la $t0, value
pref 0, 0($t0)