199 definitions in 10 files, 199 with an encoding diagram. src/isa/spu
| File | Definitions | Other | What |
|---|---|---|---|
| package.lisp | 0 | 0 | the ISA.SPU package: the SPU and its MFC. |
| state.lisp | 0 | 17 | the SPU's architected state, local store and the SPU ISA. |
| alu.lisp | 122 | 2 | SPU integer, logical, shift, rotate, compare, select, shuffle. |
| float.lisp | 33 | 32 | SPU single and double precision, conversions, the FPSCR. |
| ls.lisp | 8 | 1 | SPU quadword loads and stores. |
| ctl.lisp | 33 | 7 | SPU branches, hints, stop, halt and the other control insns. |
| mfc.lisp | 0 | 33 | the SPU's Memory Flow Controller: DMA and tag groups. |
| chan.lisp | 3 | 36 | SPU channels: rdch, wrch, rchcnt and the channel logic. |
| exec.lisp | 0 | 7 | the SPU decoder, executor and run loop. |
| asm.lisp | 0 | 2 | an SPU assembler over the definsn records (compile time). |
| File | Contents |
|---|---|
state.lisp | spu struct, gpr/ls-read/ls-write/slot32/pref32/lane-mask, (defisa spu), defspu (instruction forms) |
alu.lisp | integer, logical, constants, shifts/rotates (lane and quadword), compares, selb/shufb, gather/fsm, insertion controls |
float.lisp | single and double precision, conversions, FPSCR: core's IEEE primitives (docs/float.md) with the SPU's rules |
ls.lisp | lqd/lqx/lqa/lqr, stqd/stqx/stqa/stqr |
ctl.lisp | branches, hints, stop/stopd, halts, nop/lnop/sync/dsync, mfspr/mtspr |
mfc.lisp | MFC command queue, DMA get/put/list, getllar/putllc/putlluc, tag groups |
chan.lisp | rdch/wrch/rchcnt, channel counts and logic, PPU-side mailbox/signal helpers |
exec.lisp | spu-execute, spu-decode, spu-step, spu-start, spu-run |
asm.lisp | compile-time assembler spu-assemble, spu-load-program |
All 199 SPU ISA 1.2 instructions (every opcode the SPU decoder knows) have a
definsn. tests/isa/spu/isa.lisp checks that each decodes to itself.
src/core/vec.lisp): word lane 0 is the
preferred slot; the halfword preferred slot is halfword lane 1 (bytes 2-3).
Semantics use vmap/vlanes/lane/vsplat and the bits.lisp forms.
Results that go only to the preferred slot are (pref32 x) (0 elsewhere).(wrap 32 (ash x n)), (ash x (- n))): counts that reach the width give
0 (or the sign fill), whatever a host does with oversized shifts.0x3FFF0, branch targets with 0x3FFFC.sign|0x7FFFFFFF.
fma/fms/fnms round once (fused). Compares use the same extended range.
Written as a double-precision primitive rounded toward zero, then
truncated to 24 bits (spu-wide, spu-narrow).0x7FF8000000000000.spu-step sets npc = pc + 4, runs the instruction, then
pc = npc. Status flags: +spu-running+ 1, +spu-stopped+ 2,
+spu-halted+ 4, +spu-waiting+ 8, +spu-invalid+ 0x40.
stop/stopd clear running, set stopped and store the 14-bit code in
stop-code (stopd: 0x3FFF); npc points after the stop.+spu-waiting+, wait-ch = channel, npc = pc. spu-run
resumes it when the channel's count is nonzero, and the rdch/wrch runs
again. The PPU side uses spu-write-in-mbox, spu-read-out-mbox,
spu-write-signal.mem-read/mem-write, EA = EAL.
A bad size/alignment sets mfc-error (0x100 | cmd) and halts the SPU.(spu-assemble '(lbl (il 3 10) (brnz 3 lbl) (stop 0))).
Operand order is each definsn's :asm; lqd rt off ra takes a byte
offset, cflts rt ra scale the scale, branch operands labels.Made from xspe at b2fac33349db by tools/gen-xspe.py. xspe is GPL-3.0-or-later.