122 definitions in 4 files, 122 with an encoding diagram. src/isa/vu
| File | Definitions | Other | What |
|---|---|---|---|
| package.lisp | 0 | 0 | the ISA.VU package: the PS2's vector units in micro mode, and the VIF that feeds them. |
| state.lisp | 0 | 4 | a vector unit's state in micro mode, and a VIF's. |
| micro.lisp | 122 | 40 | the vector units' micro mode: upper (FMAC) and lower (integer, load/store, FDIV, EFU, branch) instructions as two ISAs, and the pair's execution. |
| vif.lisp | 0 | 30 | the VIF: VIF codes as an instruction set on a vector unit's memories and registers. |
Package ISA.VU (uses CL and CORE; its arithmetic is ISA.MIPS's,
see below). VU0 and VU1 run micro programs from their micro memories:
64-bit instructions, an upper (FMAC) and a lower (integer, load/store,
FDIV, EFU, branch) half issued together. The VIF decodes the codes a DMA
channel sends into a VU's memories and registers. Both are ISAs:
| File | Role |
|---|---|
package.lisp | the package and its exports |
state.lisp | the vu struct (vf, vi, ACC, Q P I R, MAC/status/clip flags, TPC, memories' bases), the vif struct (its registers, the code being received) |
micro.lisp | ISA VU-UPPER and ISA VU-LOWER (32-bit words, definsn with encodings and semantics), their executors and decoders, vu-step (the pair), vu-run (to the E bit's delay slot) |
vif.lisp | the VIF codes: NOP STCYCL OFFSET BASE ITOP STMOD MSKPATH3 MARK FLUSH* MSCAL* MSCNT STMASK STROW STCOL MPG DIRECT DIRECTHL UNPACK; vif-word |
The encodings follow [VUUM]'s tables, and their positions were checked
against PCSX2's micro decode tables ([PCSX2] pcsx2/VUops.cpp:
_UPPER_OPCODE, _UPPER_FD_00..11, _LOWER_OPCODE, LowerOP,
LowerOP_T3_00..11) for every instruction (vu_vu). Upper word: I E M
D T flags (31-27), dest (24-21), ft, fs, fd, op (bc in bits 1-0).
src/isa/mips/eefloat.lisp (no infinities, NaNs or denormals,
truncation, +-MAX on overflow), shared with the R5900's FPU and VU0's
macro mode rather than copied: this ISA calls ISA.MIPS's ee-fadd,
ee-fmul, ee-fdiv, ee-fsqrt, ee-frsqrt, ee-fmax, ee-fmin,
ee-itof, ee-ftoi, ee-flt (rules around the IEEE primitives), so a
build or test loading it
loads ISA.MIPS first (the PS2 machine does). Flags: MAC per lane (Z S
U O), status Z S U O I D and their sticky bits, clipping (CLIP shifts 6
bits in), as VU0's macro mode sets them. The EFU (ESADD ... EEXP)
computes in IEEE single with the primitives (its own approximations are
not modelled yet).[VUUM] ch. 6 and PCSX2's Vif_Codes.cpp, Vif_Unpack.cpp. UNPACK
writes vectors of 1-4 elements of 32/16/8 bits (or 5-5-5-1), signed
unless USN; V2 writes v0 v1 v0 v1, V3 reads as V4 (both hardware facts
PCSX2 records); CYCLE's CL/WL skip or fill; MODE 1 offsets by ROW, 2
accumulates ROW, 3 sets ROW; the MASK register writes data, ROW, COL or
nothing per element and cycle row. MSCAL on VIF1 swaps the double buffer
(TOP <- TOPS, DBF flips, TOPS <- BASE (+ OFST)). A machine provides what
the VIF reaches outside its VU by defining again vif-direct-qword
(DIRECT's quadwords: the GIF's PATH2), vif-start-micro, vif-raise
(the interrupt bit), vif-mskpath3, and for the VU vu-xgkick and
vu-xtop (src/sys/ps2/vu.lisp). Not yet: the VIF's stall on the
interrupt bit, FLUSH waits, STAT's busy bits (transfers end at once).
vu_vu: decoding at every table position (and illegal ones), a program
(broadcast add, an accumulation loop with a branch and its delay slot,
the pair's read-before-write, the I bit, a store, DIV in the E bit's
delay slot), MAC and status flags; VIF UNPACK in seven formats and
modes, masks, MPG and MSCAL, the double buffer.
Made from xspe at b2fac33349db by tools/gen-xspe.py. xspe is GPL-3.0-or-later.