Introduction
These are the instructions of the operating-system (supervisor) level: the ones a user program cannot run. In user mode they raise a
privileged-instruction exception. They return from interrupts, read and write the machine state register, manage the segment registers
of the 32-bit architecture and the segment lookaside buffer (SLB) of the 64-bit one, and invalidate translation lookaside buffer (TLB) entries. The
explorer marks them “supervisor” in its notes. The move to and from special-purpose registers (mfspr, mtspr) is on
the integer page; the supervisor registers they name are
listed below. dcbi (invalidate a data cache block) is here too; the other cache instructions are on
the loads and stores page.
The machine state register
The MSR holds the processor's mode. It is read with mfmsr and written with mtmsr (and mtmsrd on
64-bit implementations); rfi and the other return instructions restore it from SRR1. The manuals number the bits from the most significant end.
The 32-bit architecture's register is 32 bits wide; in a 64-bit implementation the register is 64 bits wide and the same bits are 32 higher.
| Bit | 32-bit bit | 64-bit bit | Meaning |
|---|---|---|---|
SF | (none) | 0 | 64-bit mode (64-bit implementations only). |
HV | (none) | 3 | Hypervisor state (64-bit implementations with the hypervisor facility only). |
EE | 16 | 48 | External interrupt enable. |
PR | 17 | 49 | Problem state: set in user mode, clear in supervisor mode. |
FP | 18 | 50 | Floating-point available. |
ME | 19 | 51 | Machine check enable. |
FE0 | 20 | 52 | Floating-point exception mode 0. |
SE | 21 | 53 | Single-step trace enable. |
BE | 22 | 54 | Branch trace enable. |
FE1 | 23 | 55 | Floating-point exception mode 1. |
IP | 25 | 57 | Exception prefix: interrupt vectors at the high or low addresses (32-bit architecture). |
IR | 26 | 58 | Instruction address translation enable. |
DR | 27 | 59 | Data address translation enable. |
RI | 30 | 62 | Recoverable interrupt. |
LE | 31 | 63 | Little-endian mode. |
Other bits (power management, the little-endian interrupt mode, the AltiVec and VSX availability bits, the performance monitor bit and the transactional memory bits) differ between models and are not described here.
The instructions
| Mnemonic | Operands | Form and opcode | Available in | What it does |
|---|---|---|---|---|
rfi | none | XL 19/50 | all PowerPC | Return from interrupt (32-bit architecture): restore the MSR and the PC from SRR1 and SRR0. |
rfid | none | XL 19/18 | 64-bit | Return from interrupt doubleword. |
hrfid | none | XL 19/274 | 64-bit | Hypervisor return from interrupt doubleword. |
rfscv | none | XL 19/82 | ISA 3.0 and later | Return from system call vectored. |
rfebb | s | XL 19/146 | ISA 2.07 and later | Return from event-based branch (not a supervisor instruction). |
mfmsr | rt | X 31/83 | all PowerPC | Move from the machine state register. |
mtmsr | rs[, l] | X 31/146 | all PowerPC | Move to the machine state register. |
mtmsrd | rs[, l] | X 31/178 | 64-bit | Move to the machine state register doubleword. |
mfsr | rt, sr | X 31/595 | 32-bit segment registers (G3, G4, Gekko, Broadway, 970 and others) | Move from segment register. |
mtsr | sr, rs | X 31/210 | 32-bit segment registers | Move to segment register. |
mfsrin | rt, rb | X 31/659 | 32-bit segment registers | Move from segment register indirect: the register is chosen by the top four bits of rb. |
mtsrin | rs, rb | X 31/242 | 32-bit segment registers | Move to segment register indirect. |
slbia | none | X 31/498 | 64-bit with an SLB | Invalidate all SLB entries. |
slbie | rb | X 31/434 | 64-bit with an SLB | SLB invalidate entry. |
slbmte | rs, rb | X 31/402 | 64-bit with an SLB | SLB move to entry. |
slbmfee | rt, rb | X 31/915 | 64-bit with an SLB | SLB move from entry ESID. |
slbmfev | rt, rb | X 31/851 | 64-bit with an SLB | SLB move from entry VSID. |
slbfee. | rt, rb | X 31/979 | 64-bit with an SLB | SLB find entry ESID; always the record form, it sets CR0. |
slbsync | none | X 31/338 | ISA 3.0 and later | SLB synchronise. |
tlbie | rb[, rs, ric, prs, r] | X 31/306 | all PowerPC | TLB invalidate entry. The extra operands are the ISA 3.0 forms. |
tlbiel | rb[, rs, ric, prs, r] | X 31/274 | 64-bit | TLB invalidate entry local (this processor only). |
tlbia | none | X 31/370 | models that have it (optional) | TLB invalidate all. |
tlbsync | none | X 31/566 | all PowerPC | TLB synchronise. |
tlbld | rb | X 31/978 | all PowerPC (a PowerPC 603 instruction) | Load data TLB entry. |
tlbli | rb | X 31/1010 | all PowerPC (a PowerPC 603 instruction) | Load instruction TLB entry. |
dcbi | ra, rb | X 31/470 | all PowerPC | Data cache block invalidate. |
wait | [wc] | X 31/30 | ISA 2.05 and later | Wait: stop fetching instructions until an interrupt (WC 1 and 2 are the reservation and implementation-specific forms). Not a supervisor instruction. |
msgsnd | rb | X 31/206 | ISA 2.05 and later | Message send. |
msgclr | rb | X 31/238 | ISA 2.05 and later | Message clear. |
stop | none | XL 19/370 | ISA 3.0 and later | Stop the thread. |
The ISA 3.0 forms of mffs that change the floating-point rounding modes (mffsce, mffscrn and the others) are on
the floating point page.
Supervisor special-purpose registers
mfspr and mtspr take a 10-bit register number; the two halves of the number are swapped in the instruction word, which the explorer
undoes. With simplified mnemonics on, the explorer writes the register by name (mfsrr0, mtsprg1). The registers it names are these; any
other number is written as a number.
| Number | Name | Models |
|---|---|---|
| 18 | DSISR | all |
| 19 | DAR | all |
| 22 | DEC (decrementer) | all |
| 25 | SDR1 | all |
| 26, 27 | SRR0, SRR1 | all |
| 272 to 275 | SPRG0 to SPRG3 | all |
| 280 | ASR | 64-bit |
| 282 | EAR | all |
| 284, 285 | TBL, TBU (time base, write) | all |
| 287 | PVR (processor version) | all |
| 528 to 535 | IBAT0U, IBAT0L to IBAT3U, IBAT3L | models with segment registers |
| 536 to 543 | DBAT0U, DBAT0L to DBAT3U, DBAT3L | models with segment registers |
| 912 to 919 | GQR0 to GQR7 | Gekko, Broadway (see paired singles) |
| 920 to 923 | HID2, WPAR, DMA_U, DMA_L | Gekko, Broadway |
| 952 to 959 | MMCR0, PMC1, PMC2, SIA, MMCR1, PMC3, PMC4, SDA (performance monitor) | Gekko, Broadway |
| 1008, 1009 | HID0, HID1 | the 750 family and its relatives |
| 1010, 1013 | IABR, DABR (breakpoint registers) | the 750 family and its relatives |
| 1017 | L2CR | the 750 family and its relatives |
| 1019 | ICTC | the 750 family and its relatives |
| 1020 to 1022 | THRM1, THRM2, THRM3 (thermal management) | the 750 family and its relatives |
The user-readable registers (XER, LR, CTR, VRSAVE, the time base and the user performance monitor registers) are on
the overview.
Not described
Known, not yet covered
- Reference and viewer: the Book E and embedded supervisor instructions (
wrtee,tlbwe,tlbre, the device control registers), and the hypervisor and ultravisor instructions of ISA 3.0 and later beyond those listed. - Reference: the meaning of every field of
tlbiein its ISA 3.0 radix and hash forms, and of theLfield ofmtmsr. - Reference: the MSR bits not in the table, and the layouts of the BAT, SDR1 and HID registers.
Unknown
- Reference: which models implement the optional
tlbia; the pages follow the architecture manuals.
Links
Reference
- Power ISA – the instruction set architecture, from the OpenPOWER Foundation; Book III is the supervisor level
- The LLVM code generator – the PowerPC target used to check the decoder