psx.wiki

GTE Register Write Delay

Measures how many instructions pass before a written GTE register is seen by a command or a read.

GTE Register Write Delay
MachineSCPH-5501
Programgte-store-delay (pcsx-redux nugget)

This is an old revision of this page, as edited by RemmyLee at 05:11, 23 October 2026. Edit this revision | Latest revision

Overview

The program writes an old value to a GTE register and waits four NOPs. It then writes a new value, runs N NOPs with N from 0 to 4, and uses the register. The value the use returns shows whether it saw the old or the new write.1

Six arms use the register in different ways. SQR squares IR1 after MTC2 or LWC2 wrote it (old 2 gives 4, new 3 gives 9). OP reads a rotation matrix element after CTC2 wrote it (old gives 5, new gives 7). The other arms read the register back with MFC2, CFC2 or SWC2. Interrupts are off and the code runs from the instruction cache.1

Results

Every arm saw the new value from two NOPs on. All three repetitions gave the same values.2

Table 1: Value seen after N NOPs
Arm N = 0 N = 1 N = 2 to 4
MTC2 IR1, SQR 3 4 9
LWC2 IR1, SQR 3 4 9
CTC2 RT22, OP 5 5 7
MTC2 IR1, MFC2 IR1 2 2 3
CTC2 RT22RT23, CFC2 5 5 7
MTC2 IR1, SWC2 IR1 2 2 3

With one NOP, SQR squared the old value and the reads returned the old value. With no NOP between the write and SQR, MFC2 read back 3, which is the written value and not a square.2

Runs

22 October 2026

gtestoredelay/GTESTOREDELAY.txt

GSD-START
GSD rep=0 SQR_M N0..4 = 3 4 9 9 9
GSD rep=0 SQR_L N0..4 = 3 4 9 9 9
GSD rep=0 OP_C N0..4 = 5 5 7 7 7
GSD rep=0 RD_M N0..4 = 2 2 3 3 3
GSD rep=0 RD_C N0..4 = 5 5 7 7 7
GSD rep=0 SW_M N0..4 = 2 2 3 3 3
GSD rep=1 SQR_M N0..4 = 3 4 9 9 9
GSD rep=1 SQR_L N0..4 = 3 4 9 9 9
GSD rep=1 OP_C N0..4 = 5 5 7 7 7
GSD rep=1 RD_M N0..4 = 2 2 3 3 3
GSD rep=1 RD_C N0..4 = 5 5 7 7 7
GSD rep=1 SW_M N0..4 = 2 2 3 3 3
GSD rep=2 SQR_M N0..4 = 3 4 9 9 9
GSD rep=2 SQR_L N0..4 = 3 4 9 9 9
GSD rep=2 OP_C N0..4 = 5 5 7 7 7
GSD rep=2 RD_M N0..4 = 2 2 3 3 3
GSD rep=2 RD_C N0..4 = 5 5 7 7 7
GSD rep=2 SW_M N0..4 = 2 2 3 3 3
GSD-DONE
ResetGraph:jtb=801e78b8,env=801e7900

gtestoredelay/bench.txt

656 bytes of TTY text in psx.log

gtestoredelay/when.txt

20261022T2232Z

References


  1. ^ a b pcsx-redux nugget, tests/gte-store-delay/gte-store-delay.c, header comment. MIT License. https://github.com/pcsx-redux/nugget

  2. ^ a b Hardware test run 20261022T2232Z-5501a-link-4 on the SCPH-5501: GTESTOREDELAY.txt.

Categories: Hardware tests