Line 1:
Line 1:
−
Paired singles are a unique part of the Gekko/[[Broadway]] processors used in the Gamecube and Wii. They provide fast vector math by keeping two single-precision floating point numbers in a single floating pointer register, and multiplying across between registers. This page will demonstrate how these instructions are to be used.
+
Paired singles are a unique part of the Gekko/[[Hardware/Broadway|Broadway]] processors used in the Gamecube and Wii. They provide fast vector math by keeping two single-precision floating point numbers in a single floating pointer register, and multiplying across between registers. This page will demonstrate how these instructions are to be used.
== Quantization and Dequantization ==
== Quantization and Dequantization ==
−
For conversion from non-floats, in order to allow for greater flexibility, there is a form of scaling implemented. All quantization is controlled by the GQRs (Graphics Quantization Registers). The GQRs are 32bit registers containing the conversion types and scaling factors for storing and loading. (During loading, it dequantizes. During storing, it quantizes.)
+
All numbers must be quantized before being put into Paired Singles. For conversion from non-floats, in order to allow for greater flexibility, there is a form of scaling implemented. All quantization is controlled by the GQRs (Graphics Quantization Registers). The GQRs are 32bit registers containing the conversion types and scaling factors for storing and loading. (During loading, it dequantizes. During storing, it quantizes.)
+
{{reg32 | GQR | hifields = 4 | lofields = 4 |
+
|2 |6 |5 |3 |
+
|U |R/W |U |R/W |
+
| |L_Scale | |L_Type ||
+
|2 |6 |5 |3 |
+
|U |R/W |U |R/W |
+
| |S_Scale | |S_Type |
+
|}}
+
{{regdesc
+
|L_*|Values for dequantization.
+
|S_*|Values for quantization.
+
|Scale|Signed. During dequantization divide the number by (2^scale). During quantization, multiply the number by (2^scale).
+
|Type|0: Float (this does no scaling during de/quantization), 4: Unsigned 8bit, 5: Unsigned 16bit, 6: Signed 8bit, 7: Signed 16bit.
+
}}
== Loading and Storing ==
== Loading and Storing ==