![]() |
SH4ZAM! 0.1.0
Fast math library for the Sega Dreamcast's SH4 CPU
|
Files | |
| file | shz_xmtrx.h |
| file | shz_xmtrx.hpp |
API for managing the SH4's "active matrix.".
XMTRX is the name given to identify the 16 FP registers contained within the back-bank of the SH4's FPU. These 16 registers combine to represent the SH4's 4x4 "active matrix," which can be subsequently transformed against using the FTRV instruction (shz_xmtrx_trans_vec4()).
For maximum FP performance on the SH4, strategic usage of XMTRX to batch transform operations together without having reload FP registers, is key.
Typically, for one-off operations, the in-memory API for Matrices is what should be used; however, when operations can be batched, using XMTRX to hold your matrix within registers is going to give the best performance.
Examples of such scenarios are: