Repository files navigation

Vector Technology as Implemented for Use with a RISC and SIMD Technology Signal Processor

A vector processor uses long registers addressable by segment-precision, where each segment is n bits wide. The power of a vector processor is that many complex matrix operations, whose algorithms take many scalar CPU instructions and clock cycles to emulate on a regular, personal computer processor, can often times formulate and transfer the correct result in less than a single clock cycle. The impossibility to replicate this precise behavior has paved the way for vendor businesses to protect their systems against hardware emulation since the introduction of display devices rendering three-dimensional graphics. The Nintendo 64 was the first video game system to employ this convenience to their advantage.


Project Reality's Signal Processor

In the engineering make-up of the Nintendo 64 (original codename: Project Reality) is a modified MIPS family revision 4000 co-processor called the "Reality Coprocessor" (RCP). More importantly, the signal processor in this component is responsible for all vector memory operations and transactions, which are almost all impossible to emulate with full accuracy on a scalar, personal computer processor. The vector technology implemented into this design is that accepted from Silicon Graphics, Inc.

RSP Vector Operation Matrices

Here, the entire MIPS R4000 instruction set was modified for very fast, exception-free processing flow, and operation definitions for each instruction do not fall within the scope of this section. Presented instead are layouts of the new instructions added to the scalar unit (those under LWC2 and SWC2, even though they do interface with the vector unit) and the vector unit (essentially, any instruction under COP2 whose mnemonic starts with a 'V'). Information of how pre-existing MIPS R4000 instructions were modified or which ones were removed is the adventure of the MIPS programmer to research.

C2vd, vs, vt[element] /* exceptions: scalar divide reads */

COP2elementvs1vs2vtfunc
0100101eeeetttttsssssddddd??????

The major types of VU computational instructions are multiply,add,select,logical, and divide.

Multiply instructions are the most frequent and classifiable as follows:

  • If a == 0, then round the product loaded to the accumulator (VMUL* and VMUD*).
  • If a == 1, then the product is added to an accumulator element (VMAC* and VMAD*).
  • If (format & 0b100) == 0, then the operation is single-precision (VMUL* and VMAC*).
  • If (format & 0b100) != 0, then the operation is double-precision (VMUD* and VMAD*).
op-codeType
00axxxmultiply
01xxxxadd
100xxxselect
101xxxlogical
110xxxdivide
  • 00 (VMULF) Vector Multiply Signed Fractions
  • 01 (VMULU) Vector Multiply Unsigned Fractions
  • 02 reservedVRNDP was intended for MPEG DCT rounding but omitted.
  • 03 reservedVMULQ was intended for MPEG inverse quantization but omitted.
  • 04 (VMUDL) Vector Multiply Low Partial Products
  • 05 (VMUDM) Vector Multiply Mid Partial Products
  • 06 (VMUDN) Vector Multiply Mid Partial Products
  • 07 (VMUDH) Vector Multiply High Partial Products
  • 10 (VMACF) Vector Multiply-Accumulate Signed Fractions
  • 11 (VMACU) Vector Multiply-Accumulate Unsigned Fractions
  • 12 reservedVRNDN was intended for MPEG DCT rounding but omitted.
  • 13 (VMACQ) Vector Accumulator Oddification
  • 14 (VMADL) Vector Multiply-Accumulate Low Partial Products
  • 15 (VMADM) Vector Multiply-Accumulate Mid Partial Products
  • 16 (VMADN) Vector Multiply-Accumulate Mid Partial Products
  • 17 (VMADH) Vector Multiply-Accumulate High Partial Products
  • 20 (VADD) Vector Add Short Elements
  • 21 (VSUB) Vector Subtract Short Elements
  • 22 reserved
  • 23 (VABS) Vector Absolute Value of Short Elements
  • 24 (VADDC) Vector Add Short Elements with Carry
  • 25 (VSUBC) Vector Subtract Short Elements with Carry
  • 26 reserved
  • 27 reserved
  • 30 reserved
  • 31 reserved
  • 32 reserved
  • 33 reserved
  • 34 reserved
  • 35 (VSAR) Vector Accumulator Read
  • 36 reserved
  • 37 reserved
  • 40 (VLT) Vector Select Less Than
  • 41 (VEQ) Vector Select Equal
  • 42 (VNE) Vector Select Not Equal
  • 43 (VGE) Vector Select Greater Than or Equal
  • 44 (VCL) Vector Select Clip Test Low
  • 45 (VCH) Vector Select Clip Test High
  • 46 (VCR) Vector Select Clip Test Low (single-precision)
  • 47 (VMRG) Vector Select Merge
  • 50 (VAND) Vector AND Short Elements
  • 51 (VNAND) Vector NAND Short Elements
  • 52 (VOR) Vector OR Short Elements
  • 53 (VNOR) Vector NOR Short Elements
  • 54 (VXOR) Vector XOR Short Elements
  • 55 (VNXOR) Vector NXOR Short Elements
  • 56 reserved
  • 57 reserved
  • 60 (VRCP) Vector Element Scalar Reciprocal (single-precision)
  • 61 (VRCPL) Vector Element Scalar Reciprocal Low
  • 62 (VRCPH) Vector Element Scalar Reciprocal High
  • 63 (VMOV) Vector Element Scalar Move
  • 64 (VRSQ) Vector Element Scalar SQRT Reciprocal (single-precision)
  • 65 (VRSQL) Vector Element Scalar SQRT Reciprocal Low
  • 66 (VRSQH) Vector Element Scalar SQRT Reciprocal High
  • 67 (VNOP) Vector Null Instruction
  • 70 reserved
  • 71 reserved
  • 72 reserved
  • 73 reserved
  • 74 reserved
  • 75 reserved
  • 76 reserved
  • 77 reserved

RSP Vector Load Transfers

The VR-DMEM transaction instruction cycles are still processed by the scalar unit, not the vector unit. In the modern implementations accepted by most vector unit communications systems today, the transfer instructions are classifiable under five groups:

  1. BV, SV, LV, DV
  2. PV, UV, XV, ZV
  3. HV, FV, AV
  4. QV, RV
  5. TV, WV

Not all of those instructions were implemented as of the time of the Nintendo 64's RCP, however. Additionally, their ordering in the opcode matrix was a little skewed to what is seen below. At this time, it is better to use only three categories of instructions:

  • normal: Anything under Group I or Group IV is normal type. Only the element must be aligned; addr & 1 may resolve true.
  • packed: Anything under Group II or Group III. Useful for working with specially mapped data, such as pixels.
  • transposed: LTV, LTWV,STV, and SWV can be found in heaps of 16 instructions, all dedicated to matrix transposition through eight diagonals of halfword elements.

LWC2vt[element], offset(base)

LWC2basevtrdelementoffset
110010sssssttttt?????eeeeXxxxxxx
  • 00 (LBV) Load Byte to Vector Unit
  • 01 (LSV) Load Shortword to Vector Unit
  • 02 (LLV) Load Longword to Vector Unit
  • 03 (LDV) Load Doubleword to Vector Unit
  • 04 (LQV) Load Quadword to Vector Unit
  • 05 (LRV) Load Rest to Vector Unit
  • 06 (LPV) Load Packed Signed to Vector Unit
  • 07 (LUV) Load Packed Unsigned to Vector Unit
  • 10 (LHV) Load Alternate Bytes to Vector Unit
  • 11 (LFV) Load Alternate Fourths to Vector Unit
  • 12 reservedLTWV
  • 13 (LTV) Load Transposed to Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

SWC2vt[element], offset(base)

SWC2basevtrdelementoffset
111010sssssttttt?????eeeeXxxxxxx
  • 00 (SBV) Store Byte from Vector Unit
  • 01 (SSV) Store Shortword from Vector Unit
  • 02 (SLV) Store Longword from Vector Unit
  • 03 (SDV) Store Doubleword from Vector Unit
  • 04 (SQV) Store Quadword from Vector Unit
  • 05 (SRV) Store Rest from Vector Unit
  • 06 (SPV) Store Packed Signed from Vector Unit
  • 07 (SUV) Store Packed Unsigned from Vector Unit
  • 10 (SHV) Store Alternate Bytes from Vector Unit
  • 11 (SFV) Store Alternate Fourths from Vector Unit
  • 12 (SWV) Store Transposed Wrapped from Vector Unit
  • 13 (STV) Store Transposed from Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

If, by any chance, the opcode specifier is greater than 17 [oct], it was probably meant to execute the extended counterparts to the above loads and stores, which were questionably obsolete and remain reserved.

Informational References for Vector Processor Architecture

Instruction Methods for Performing Data Formatting While Moving Data Between Memory and a Vector Register File United States patent no. 5,812,147 Timothy J. Van Hook Silicon Graphics, Inc.

Method and System for Efficient Matrix Multiplication in a SIMD Processor Architecture United States patent no. 7,873,812 Tibet Mimar

Efficient Handling of Vector High-Level Language Constructs in a SIMD Processor United States patent no. 7,793,084 Tibet Mimar

Flexible Vector Modes of Operation for SIMD Processor patent pending? Tibet Mimar

Programming a Vector Processor and Parallel Programming of an Asymmetric Dual Multiprocessor Comprised of a Vector Processor and a RISC Processor United States patent no. 6,016,395 Moataz Ali Mohamed Samsung Electronics Co., Ltd.

Execution Unit for Processing a Data Stream Independently and in Parallel United States patent no. 6,401,194 Le Trong Nguyen Samsung Electronics Co., Ltd.

About

Exemplary MSP communications simulator using a normalized VU.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

Vector Technology as Implemented for Use with a RISC and SIMD Technology Signal Processor

A vector processor uses long registers addressable by segment-precision, where each segment is n bits wide. The power of a vector processor is that many complex matrix operations, whose algorithms take many scalar CPU instructions and clock cycles to emulate on a regular, personal computer processor, can often times formulate and transfer the correct result in less than a single clock cycle. The impossibility to replicate this precise behavior has paved the way for vendor businesses to protect their systems against hardware emulation since the introduction of display devices rendering three-dimensional graphics. The Nintendo 64 was the first video game system to employ this convenience to their advantage.


Project Reality's Signal Processor

In the engineering make-up of the Nintendo 64 (original codename: Project Reality) is a modified MIPS family revision 4000 co-processor called the "Reality Coprocessor" (RCP). More importantly, the signal processor in this component is responsible for all vector memory operations and transactions, which are almost all impossible to emulate with full accuracy on a scalar, personal computer processor. The vector technology implemented into this design is that accepted from Silicon Graphics, Inc.

RSP Vector Operation Matrices

Here, the entire MIPS R4000 instruction set was modified for very fast, exception-free processing flow, and operation definitions for each instruction do not fall within the scope of this section. Presented instead are layouts of the new instructions added to the scalar unit (those under LWC2 and SWC2, even though they do interface with the vector unit) and the vector unit (essentially, any instruction under COP2 whose mnemonic starts with a 'V'). Information of how pre-existing MIPS R4000 instructions were modified or which ones were removed is the adventure of the MIPS programmer to research.

C2vd, vs, vt[element] /* exceptions: scalar divide reads */

COP2elementvs1vs2vtfunc
0100101eeeetttttsssssddddd??????

The major types of VU computational instructions are multiply,add,select,logical, and divide.

Multiply instructions are the most frequent and classifiable as follows:

  • If a == 0, then round the product loaded to the accumulator (VMUL* and VMUD*).
  • If a == 1, then the product is added to an accumulator element (VMAC* and VMAD*).
  • If (format & 0b100) == 0, then the operation is single-precision (VMUL* and VMAC*).
  • If (format & 0b100) != 0, then the operation is double-precision (VMUD* and VMAD*).
op-codeType
00axxxmultiply
01xxxxadd
100xxxselect
101xxxlogical
110xxxdivide
  • 00 (VMULF) Vector Multiply Signed Fractions
  • 01 (VMULU) Vector Multiply Unsigned Fractions
  • 02 reservedVRNDP was intended for MPEG DCT rounding but omitted.
  • 03 reservedVMULQ was intended for MPEG inverse quantization but omitted.
  • 04 (VMUDL) Vector Multiply Low Partial Products
  • 05 (VMUDM) Vector Multiply Mid Partial Products
  • 06 (VMUDN) Vector Multiply Mid Partial Products
  • 07 (VMUDH) Vector Multiply High Partial Products
  • 10 (VMACF) Vector Multiply-Accumulate Signed Fractions
  • 11 (VMACU) Vector Multiply-Accumulate Unsigned Fractions
  • 12 reservedVRNDN was intended for MPEG DCT rounding but omitted.
  • 13 (VMACQ) Vector Accumulator Oddification
  • 14 (VMADL) Vector Multiply-Accumulate Low Partial Products
  • 15 (VMADM) Vector Multiply-Accumulate Mid Partial Products
  • 16 (VMADN) Vector Multiply-Accumulate Mid Partial Products
  • 17 (VMADH) Vector Multiply-Accumulate High Partial Products
  • 20 (VADD) Vector Add Short Elements
  • 21 (VSUB) Vector Subtract Short Elements
  • 22 reserved
  • 23 (VABS) Vector Absolute Value of Short Elements
  • 24 (VADDC) Vector Add Short Elements with Carry
  • 25 (VSUBC) Vector Subtract Short Elements with Carry
  • 26 reserved
  • 27 reserved
  • 30 reserved
  • 31 reserved
  • 32 reserved
  • 33 reserved
  • 34 reserved
  • 35 (VSAR) Vector Accumulator Read
  • 36 reserved
  • 37 reserved
  • 40 (VLT) Vector Select Less Than
  • 41 (VEQ) Vector Select Equal
  • 42 (VNE) Vector Select Not Equal
  • 43 (VGE) Vector Select Greater Than or Equal
  • 44 (VCL) Vector Select Clip Test Low
  • 45 (VCH) Vector Select Clip Test High
  • 46 (VCR) Vector Select Clip Test Low (single-precision)
  • 47 (VMRG) Vector Select Merge
  • 50 (VAND) Vector AND Short Elements
  • 51 (VNAND) Vector NAND Short Elements
  • 52 (VOR) Vector OR Short Elements
  • 53 (VNOR) Vector NOR Short Elements
  • 54 (VXOR) Vector XOR Short Elements
  • 55 (VNXOR) Vector NXOR Short Elements
  • 56 reserved
  • 57 reserved
  • 60 (VRCP) Vector Element Scalar Reciprocal (single-precision)
  • 61 (VRCPL) Vector Element Scalar Reciprocal Low
  • 62 (VRCPH) Vector Element Scalar Reciprocal High
  • 63 (VMOV) Vector Element Scalar Move
  • 64 (VRSQ) Vector Element Scalar SQRT Reciprocal (single-precision)
  • 65 (VRSQL) Vector Element Scalar SQRT Reciprocal Low
  • 66 (VRSQH) Vector Element Scalar SQRT Reciprocal High
  • 67 (VNOP) Vector Null Instruction
  • 70 reserved
  • 71 reserved
  • 72 reserved
  • 73 reserved
  • 74 reserved
  • 75 reserved
  • 76 reserved
  • 77 reserved

RSP Vector Load Transfers

The VR-DMEM transaction instruction cycles are still processed by the scalar unit, not the vector unit. In the modern implementations accepted by most vector unit communications systems today, the transfer instructions are classifiable under five groups:

  1. BV, SV, LV, DV
  2. PV, UV, XV, ZV
  3. HV, FV, AV
  4. QV, RV
  5. TV, WV

Not all of those instructions were implemented as of the time of the Nintendo 64's RCP, however. Additionally, their ordering in the opcode matrix was a little skewed to what is seen below. At this time, it is better to use only three categories of instructions:

  • normal: Anything under Group I or Group IV is normal type. Only the element must be aligned; addr & 1 may resolve true.
  • packed: Anything under Group II or Group III. Useful for working with specially mapped data, such as pixels.
  • transposed: LTV, LTWV,STV, and SWV can be found in heaps of 16 instructions, all dedicated to matrix transposition through eight diagonals of halfword elements.

LWC2vt[element], offset(base)

LWC2basevtrdelementoffset
110010sssssttttt?????eeeeXxxxxxx
  • 00 (LBV) Load Byte to Vector Unit
  • 01 (LSV) Load Shortword to Vector Unit
  • 02 (LLV) Load Longword to Vector Unit
  • 03 (LDV) Load Doubleword to Vector Unit
  • 04 (LQV) Load Quadword to Vector Unit
  • 05 (LRV) Load Rest to Vector Unit
  • 06 (LPV) Load Packed Signed to Vector Unit
  • 07 (LUV) Load Packed Unsigned to Vector Unit
  • 10 (LHV) Load Alternate Bytes to Vector Unit
  • 11 (LFV) Load Alternate Fourths to Vector Unit
  • 12 reservedLTWV
  • 13 (LTV) Load Transposed to Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

SWC2vt[element], offset(base)

SWC2basevtrdelementoffset
111010sssssttttt?????eeeeXxxxxxx
  • 00 (SBV) Store Byte from Vector Unit
  • 01 (SSV) Store Shortword from Vector Unit
  • 02 (SLV) Store Longword from Vector Unit
  • 03 (SDV) Store Doubleword from Vector Unit
  • 04 (SQV) Store Quadword from Vector Unit
  • 05 (SRV) Store Rest from Vector Unit
  • 06 (SPV) Store Packed Signed from Vector Unit
  • 07 (SUV) Store Packed Unsigned from Vector Unit
  • 10 (SHV) Store Alternate Bytes from Vector Unit
  • 11 (SFV) Store Alternate Fourths from Vector Unit
  • 12 (SWV) Store Transposed Wrapped from Vector Unit
  • 13 (STV) Store Transposed from Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

If, by any chance, the opcode specifier is greater than 17 [oct], it was probably meant to execute the extended counterparts to the above loads and stores, which were questionably obsolete and remain reserved.

Informational References for Vector Processor Architecture

Instruction Methods for Performing Data Formatting While Moving Data Between Memory and a Vector Register File United States patent no. 5,812,147 Timothy J. Van Hook Silicon Graphics, Inc.

Method and System for Efficient Matrix Multiplication in a SIMD Processor Architecture United States patent no. 7,873,812 Tibet Mimar

Efficient Handling of Vector High-Level Language Constructs in a SIMD Processor United States patent no. 7,793,084 Tibet Mimar

Flexible Vector Modes of Operation for SIMD Processor patent pending? Tibet Mimar

Programming a Vector Processor and Parallel Programming of an Asymmetric Dual Multiprocessor Comprised of a Vector Processor and a RISC Processor United States patent no. 6,016,395 Moataz Ali Mohamed Samsung Electronics Co., Ltd.

Execution Unit for Processing a Data Stream Independently and in Parallel United States patent no. 6,401,194 Le Trong Nguyen Samsung Electronics Co., Ltd.

About

Exemplary MSP communications simulator using a normalized VU.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Vector Technology as Implemented for Use with a RISC and SIMD Technology Signal Processor

A vector processor uses long registers addressable by segment-precision, where each segment is n bits wide. The power of a vector processor is that many complex matrix operations, whose algorithms take many scalar CPU instructions and clock cycles to emulate on a regular, personal computer processor, can often times formulate and transfer the correct result in less than a single clock cycle. The impossibility to replicate this precise behavior has paved the way for vendor businesses to protect their systems against hardware emulation since the introduction of display devices rendering three-dimensional graphics. The Nintendo 64 was the first video game system to employ this convenience to their advantage.


Project Reality's Signal Processor

In the engineering make-up of the Nintendo 64 (original codename: Project Reality) is a modified MIPS family revision 4000 co-processor called the "Reality Coprocessor" (RCP). More importantly, the signal processor in this component is responsible for all vector memory operations and transactions, which are almost all impossible to emulate with full accuracy on a scalar, personal computer processor. The vector technology implemented into this design is that accepted from Silicon Graphics, Inc.

RSP Vector Operation Matrices

Here, the entire MIPS R4000 instruction set was modified for very fast, exception-free processing flow, and operation definitions for each instruction do not fall within the scope of this section. Presented instead are layouts of the new instructions added to the scalar unit (those under LWC2 and SWC2, even though they do interface with the vector unit) and the vector unit (essentially, any instruction under COP2 whose mnemonic starts with a 'V'). Information of how pre-existing MIPS R4000 instructions were modified or which ones were removed is the adventure of the MIPS programmer to research.

C2vd, vs, vt[element] /* exceptions: scalar divide reads */

COP2elementvs1vs2vtfunc
0100101eeeetttttsssssddddd??????

The major types of VU computational instructions are multiply,add,select,logical, and divide.

Multiply instructions are the most frequent and classifiable as follows:

  • If a == 0, then round the product loaded to the accumulator (VMUL* and VMUD*).
  • If a == 1, then the product is added to an accumulator element (VMAC* and VMAD*).
  • If (format & 0b100) == 0, then the operation is single-precision (VMUL* and VMAC*).
  • If (format & 0b100) != 0, then the operation is double-precision (VMUD* and VMAD*).
op-codeType
00axxxmultiply
01xxxxadd
100xxxselect
101xxxlogical
110xxxdivide
  • 00 (VMULF) Vector Multiply Signed Fractions
  • 01 (VMULU) Vector Multiply Unsigned Fractions
  • 02 reservedVRNDP was intended for MPEG DCT rounding but omitted.
  • 03 reservedVMULQ was intended for MPEG inverse quantization but omitted.
  • 04 (VMUDL) Vector Multiply Low Partial Products
  • 05 (VMUDM) Vector Multiply Mid Partial Products
  • 06 (VMUDN) Vector Multiply Mid Partial Products
  • 07 (VMUDH) Vector Multiply High Partial Products
  • 10 (VMACF) Vector Multiply-Accumulate Signed Fractions
  • 11 (VMACU) Vector Multiply-Accumulate Unsigned Fractions
  • 12 reservedVRNDN was intended for MPEG DCT rounding but omitted.
  • 13 (VMACQ) Vector Accumulator Oddification
  • 14 (VMADL) Vector Multiply-Accumulate Low Partial Products
  • 15 (VMADM) Vector Multiply-Accumulate Mid Partial Products
  • 16 (VMADN) Vector Multiply-Accumulate Mid Partial Products
  • 17 (VMADH) Vector Multiply-Accumulate High Partial Products
  • 20 (VADD) Vector Add Short Elements
  • 21 (VSUB) Vector Subtract Short Elements
  • 22 reserved
  • 23 (VABS) Vector Absolute Value of Short Elements
  • 24 (VADDC) Vector Add Short Elements with Carry
  • 25 (VSUBC) Vector Subtract Short Elements with Carry
  • 26 reserved
  • 27 reserved
  • 30 reserved
  • 31 reserved
  • 32 reserved
  • 33 reserved
  • 34 reserved
  • 35 (VSAR) Vector Accumulator Read
  • 36 reserved
  • 37 reserved
  • 40 (VLT) Vector Select Less Than
  • 41 (VEQ) Vector Select Equal
  • 42 (VNE) Vector Select Not Equal
  • 43 (VGE) Vector Select Greater Than or Equal
  • 44 (VCL) Vector Select Clip Test Low
  • 45 (VCH) Vector Select Clip Test High
  • 46 (VCR) Vector Select Clip Test Low (single-precision)
  • 47 (VMRG) Vector Select Merge
  • 50 (VAND) Vector AND Short Elements
  • 51 (VNAND) Vector NAND Short Elements
  • 52 (VOR) Vector OR Short Elements
  • 53 (VNOR) Vector NOR Short Elements
  • 54 (VXOR) Vector XOR Short Elements
  • 55 (VNXOR) Vector NXOR Short Elements
  • 56 reserved
  • 57 reserved
  • 60 (VRCP) Vector Element Scalar Reciprocal (single-precision)
  • 61 (VRCPL) Vector Element Scalar Reciprocal Low
  • 62 (VRCPH) Vector Element Scalar Reciprocal High
  • 63 (VMOV) Vector Element Scalar Move
  • 64 (VRSQ) Vector Element Scalar SQRT Reciprocal (single-precision)
  • 65 (VRSQL) Vector Element Scalar SQRT Reciprocal Low
  • 66 (VRSQH) Vector Element Scalar SQRT Reciprocal High
  • 67 (VNOP) Vector Null Instruction
  • 70 reserved
  • 71 reserved
  • 72 reserved
  • 73 reserved
  • 74 reserved
  • 75 reserved
  • 76 reserved
  • 77 reserved

RSP Vector Load Transfers

The VR-DMEM transaction instruction cycles are still processed by the scalar unit, not the vector unit. In the modern implementations accepted by most vector unit communications systems today, the transfer instructions are classifiable under five groups:

  1. BV, SV, LV, DV
  2. PV, UV, XV, ZV
  3. HV, FV, AV
  4. QV, RV
  5. TV, WV

Not all of those instructions were implemented as of the time of the Nintendo 64's RCP, however. Additionally, their ordering in the opcode matrix was a little skewed to what is seen below. At this time, it is better to use only three categories of instructions:

  • normal: Anything under Group I or Group IV is normal type. Only the element must be aligned; addr & 1 may resolve true.
  • packed: Anything under Group II or Group III. Useful for working with specially mapped data, such as pixels.
  • transposed: LTV, LTWV,STV, and SWV can be found in heaps of 16 instructions, all dedicated to matrix transposition through eight diagonals of halfword elements.

LWC2vt[element], offset(base)

LWC2basevtrdelementoffset
110010sssssttttt?????eeeeXxxxxxx
  • 00 (LBV) Load Byte to Vector Unit
  • 01 (LSV) Load Shortword to Vector Unit
  • 02 (LLV) Load Longword to Vector Unit
  • 03 (LDV) Load Doubleword to Vector Unit
  • 04 (LQV) Load Quadword to Vector Unit
  • 05 (LRV) Load Rest to Vector Unit
  • 06 (LPV) Load Packed Signed to Vector Unit
  • 07 (LUV) Load Packed Unsigned to Vector Unit
  • 10 (LHV) Load Alternate Bytes to Vector Unit
  • 11 (LFV) Load Alternate Fourths to Vector Unit
  • 12 reservedLTWV
  • 13 (LTV) Load Transposed to Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

SWC2vt[element], offset(base)

SWC2basevtrdelementoffset
111010sssssttttt?????eeeeXxxxxxx
  • 00 (SBV) Store Byte from Vector Unit
  • 01 (SSV) Store Shortword from Vector Unit
  • 02 (SLV) Store Longword from Vector Unit
  • 03 (SDV) Store Doubleword from Vector Unit
  • 04 (SQV) Store Quadword from Vector Unit
  • 05 (SRV) Store Rest from Vector Unit
  • 06 (SPV) Store Packed Signed from Vector Unit
  • 07 (SUV) Store Packed Unsigned from Vector Unit
  • 10 (SHV) Store Alternate Bytes from Vector Unit
  • 11 (SFV) Store Alternate Fourths from Vector Unit
  • 12 (SWV) Store Transposed Wrapped from Vector Unit
  • 13 (STV) Store Transposed from Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

If, by any chance, the opcode specifier is greater than 17 [oct], it was probably meant to execute the extended counterparts to the above loads and stores, which were questionably obsolete and remain reserved.

Informational References for Vector Processor Architecture

Instruction Methods for Performing Data Formatting While Moving Data Between Memory and a Vector Register File United States patent no. 5,812,147 Timothy J. Van Hook Silicon Graphics, Inc.

Method and System for Efficient Matrix Multiplication in a SIMD Processor Architecture United States patent no. 7,873,812 Tibet Mimar

Efficient Handling of Vector High-Level Language Constructs in a SIMD Processor United States patent no. 7,793,084 Tibet Mimar

Flexible Vector Modes of Operation for SIMD Processor patent pending? Tibet Mimar

Programming a Vector Processor and Parallel Programming of an Asymmetric Dual Multiprocessor Comprised of a Vector Processor and a RISC Processor United States patent no. 6,016,395 Moataz Ali Mohamed Samsung Electronics Co., Ltd.

Execution Unit for Processing a Data Stream Independently and in Parallel United States patent no. 6,401,194 Le Trong Nguyen Samsung Electronics Co., Ltd.

About

Exemplary MSP communications simulator using a normalized VU.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Vector Technology as Implemented for Use with a RISC and SIMD Technology Signal Processor

A vector processor uses long registers addressable by segment-precision, where each segment is n bits wide. The power of a vector processor is that many complex matrix operations, whose algorithms take many scalar CPU instructions and clock cycles to emulate on a regular, personal computer processor, can often times formulate and transfer the correct result in less than a single clock cycle. The impossibility to replicate this precise behavior has paved the way for vendor businesses to protect their systems against hardware emulation since the introduction of display devices rendering three-dimensional graphics. The Nintendo 64 was the first video game system to employ this convenience to their advantage.


Project Reality's Signal Processor

In the engineering make-up of the Nintendo 64 (original codename: Project Reality) is a modified MIPS family revision 4000 co-processor called the "Reality Coprocessor" (RCP). More importantly, the signal processor in this component is responsible for all vector memory operations and transactions, which are almost all impossible to emulate with full accuracy on a scalar, personal computer processor. The vector technology implemented into this design is that accepted from Silicon Graphics, Inc.

RSP Vector Operation Matrices

Here, the entire MIPS R4000 instruction set was modified for very fast, exception-free processing flow, and operation definitions for each instruction do not fall within the scope of this section. Presented instead are layouts of the new instructions added to the scalar unit (those under LWC2 and SWC2, even though they do interface with the vector unit) and the vector unit (essentially, any instruction under COP2 whose mnemonic starts with a 'V'). Information of how pre-existing MIPS R4000 instructions were modified or which ones were removed is the adventure of the MIPS programmer to research.

C2vd, vs, vt[element] /* exceptions: scalar divide reads */

COP2elementvs1vs2vtfunc
0100101eeeetttttsssssddddd??????

The major types of VU computational instructions are multiply,add,select,logical, and divide.

Multiply instructions are the most frequent and classifiable as follows:

  • If a == 0, then round the product loaded to the accumulator (VMUL* and VMUD*).
  • If a == 1, then the product is added to an accumulator element (VMAC* and VMAD*).
  • If (format & 0b100) == 0, then the operation is single-precision (VMUL* and VMAC*).
  • If (format & 0b100) != 0, then the operation is double-precision (VMUD* and VMAD*).
op-codeType
00axxxmultiply
01xxxxadd
100xxxselect
101xxxlogical
110xxxdivide
  • 00 (VMULF) Vector Multiply Signed Fractions
  • 01 (VMULU) Vector Multiply Unsigned Fractions
  • 02 reservedVRNDP was intended for MPEG DCT rounding but omitted.
  • 03 reservedVMULQ was intended for MPEG inverse quantization but omitted.
  • 04 (VMUDL) Vector Multiply Low Partial Products
  • 05 (VMUDM) Vector Multiply Mid Partial Products
  • 06 (VMUDN) Vector Multiply Mid Partial Products
  • 07 (VMUDH) Vector Multiply High Partial Products
  • 10 (VMACF) Vector Multiply-Accumulate Signed Fractions
  • 11 (VMACU) Vector Multiply-Accumulate Unsigned Fractions
  • 12 reservedVRNDN was intended for MPEG DCT rounding but omitted.
  • 13 (VMACQ) Vector Accumulator Oddification
  • 14 (VMADL) Vector Multiply-Accumulate Low Partial Products
  • 15 (VMADM) Vector Multiply-Accumulate Mid Partial Products
  • 16 (VMADN) Vector Multiply-Accumulate Mid Partial Products
  • 17 (VMADH) Vector Multiply-Accumulate High Partial Products
  • 20 (VADD) Vector Add Short Elements
  • 21 (VSUB) Vector Subtract Short Elements
  • 22 reserved
  • 23 (VABS) Vector Absolute Value of Short Elements
  • 24 (VADDC) Vector Add Short Elements with Carry
  • 25 (VSUBC) Vector Subtract Short Elements with Carry
  • 26 reserved
  • 27 reserved
  • 30 reserved
  • 31 reserved
  • 32 reserved
  • 33 reserved
  • 34 reserved
  • 35 (VSAR) Vector Accumulator Read
  • 36 reserved
  • 37 reserved
  • 40 (VLT) Vector Select Less Than
  • 41 (VEQ) Vector Select Equal
  • 42 (VNE) Vector Select Not Equal
  • 43 (VGE) Vector Select Greater Than or Equal
  • 44 (VCL) Vector Select Clip Test Low
  • 45 (VCH) Vector Select Clip Test High
  • 46 (VCR) Vector Select Clip Test Low (single-precision)
  • 47 (VMRG) Vector Select Merge
  • 50 (VAND) Vector AND Short Elements
  • 51 (VNAND) Vector NAND Short Elements
  • 52 (VOR) Vector OR Short Elements
  • 53 (VNOR) Vector NOR Short Elements
  • 54 (VXOR) Vector XOR Short Elements
  • 55 (VNXOR) Vector NXOR Short Elements
  • 56 reserved
  • 57 reserved
  • 60 (VRCP) Vector Element Scalar Reciprocal (single-precision)
  • 61 (VRCPL) Vector Element Scalar Reciprocal Low
  • 62 (VRCPH) Vector Element Scalar Reciprocal High
  • 63 (VMOV) Vector Element Scalar Move
  • 64 (VRSQ) Vector Element Scalar SQRT Reciprocal (single-precision)
  • 65 (VRSQL) Vector Element Scalar SQRT Reciprocal Low
  • 66 (VRSQH) Vector Element Scalar SQRT Reciprocal High
  • 67 (VNOP) Vector Null Instruction
  • 70 reserved
  • 71 reserved
  • 72 reserved
  • 73 reserved
  • 74 reserved
  • 75 reserved
  • 76 reserved
  • 77 reserved

RSP Vector Load Transfers

The VR-DMEM transaction instruction cycles are still processed by the scalar unit, not the vector unit. In the modern implementations accepted by most vector unit communications systems today, the transfer instructions are classifiable under five groups:

  1. BV, SV, LV, DV
  2. PV, UV, XV, ZV
  3. HV, FV, AV
  4. QV, RV
  5. TV, WV

Not all of those instructions were implemented as of the time of the Nintendo 64's RCP, however. Additionally, their ordering in the opcode matrix was a little skewed to what is seen below. At this time, it is better to use only three categories of instructions:

  • normal: Anything under Group I or Group IV is normal type. Only the element must be aligned; addr & 1 may resolve true.
  • packed: Anything under Group II or Group III. Useful for working with specially mapped data, such as pixels.
  • transposed: LTV, LTWV,STV, and SWV can be found in heaps of 16 instructions, all dedicated to matrix transposition through eight diagonals of halfword elements.

LWC2vt[element], offset(base)

LWC2basevtrdelementoffset
110010sssssttttt?????eeeeXxxxxxx
  • 00 (LBV) Load Byte to Vector Unit
  • 01 (LSV) Load Shortword to Vector Unit
  • 02 (LLV) Load Longword to Vector Unit
  • 03 (LDV) Load Doubleword to Vector Unit
  • 04 (LQV) Load Quadword to Vector Unit
  • 05 (LRV) Load Rest to Vector Unit
  • 06 (LPV) Load Packed Signed to Vector Unit
  • 07 (LUV) Load Packed Unsigned to Vector Unit
  • 10 (LHV) Load Alternate Bytes to Vector Unit
  • 11 (LFV) Load Alternate Fourths to Vector Unit
  • 12 reservedLTWV
  • 13 (LTV) Load Transposed to Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

SWC2vt[element], offset(base)

SWC2basevtrdelementoffset
111010sssssttttt?????eeeeXxxxxxx
  • 00 (SBV) Store Byte from Vector Unit
  • 01 (SSV) Store Shortword from Vector Unit
  • 02 (SLV) Store Longword from Vector Unit
  • 03 (SDV) Store Doubleword from Vector Unit
  • 04 (SQV) Store Quadword from Vector Unit
  • 05 (SRV) Store Rest from Vector Unit
  • 06 (SPV) Store Packed Signed from Vector Unit
  • 07 (SUV) Store Packed Unsigned from Vector Unit
  • 10 (SHV) Store Alternate Bytes from Vector Unit
  • 11 (SFV) Store Alternate Fourths from Vector Unit
  • 12 (SWV) Store Transposed Wrapped from Vector Unit
  • 13 (STV) Store Transposed from Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

If, by any chance, the opcode specifier is greater than 17 [oct], it was probably meant to execute the extended counterparts to the above loads and stores, which were questionably obsolete and remain reserved.

Informational References for Vector Processor Architecture

Instruction Methods for Performing Data Formatting While Moving Data Between Memory and a Vector Register File United States patent no. 5,812,147 Timothy J. Van Hook Silicon Graphics, Inc.

Method and System for Efficient Matrix Multiplication in a SIMD Processor Architecture United States patent no. 7,873,812 Tibet Mimar

Efficient Handling of Vector High-Level Language Constructs in a SIMD Processor United States patent no. 7,793,084 Tibet Mimar

Flexible Vector Modes of Operation for SIMD Processor patent pending? Tibet Mimar

Programming a Vector Processor and Parallel Programming of an Asymmetric Dual Multiprocessor Comprised of a Vector Processor and a RISC Processor United States patent no. 6,016,395 Moataz Ali Mohamed Samsung Electronics Co., Ltd.

Execution Unit for Processing a Data Stream Independently and in Parallel United States patent no. 6,401,194 Le Trong Nguyen Samsung Electronics Co., Ltd.

About

Exemplary MSP communications simulator using a normalized VU.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

Vector Technology as Implemented for Use with a RISC and SIMD Technology Signal Processor

A vector processor uses long registers addressable by segment-precision, where each segment is n bits wide. The power of a vector processor is that many complex matrix operations, whose algorithms take many scalar CPU instructions and clock cycles to emulate on a regular, personal computer processor, can often times formulate and transfer the correct result in less than a single clock cycle. The impossibility to replicate this precise behavior has paved the way for vendor businesses to protect their systems against hardware emulation since the introduction of display devices rendering three-dimensional graphics. The Nintendo 64 was the first video game system to employ this convenience to their advantage.


Project Reality's Signal Processor

In the engineering make-up of the Nintendo 64 (original codename: Project Reality) is a modified MIPS family revision 4000 co-processor called the "Reality Coprocessor" (RCP). More importantly, the signal processor in this component is responsible for all vector memory operations and transactions, which are almost all impossible to emulate with full accuracy on a scalar, personal computer processor. The vector technology implemented into this design is that accepted from Silicon Graphics, Inc.

RSP Vector Operation Matrices

Here, the entire MIPS R4000 instruction set was modified for very fast, exception-free processing flow, and operation definitions for each instruction do not fall within the scope of this section. Presented instead are layouts of the new instructions added to the scalar unit (those under LWC2 and SWC2, even though they do interface with the vector unit) and the vector unit (essentially, any instruction under COP2 whose mnemonic starts with a 'V'). Information of how pre-existing MIPS R4000 instructions were modified or which ones were removed is the adventure of the MIPS programmer to research.

C2vd, vs, vt[element] /* exceptions: scalar divide reads */

COP2elementvs1vs2vtfunc
0100101eeeetttttsssssddddd??????

The major types of VU computational instructions are multiply,add,select,logical, and divide.

Multiply instructions are the most frequent and classifiable as follows:

  • If a == 0, then round the product loaded to the accumulator (VMUL* and VMUD*).
  • If a == 1, then the product is added to an accumulator element (VMAC* and VMAD*).
  • If (format & 0b100) == 0, then the operation is single-precision (VMUL* and VMAC*).
  • If (format & 0b100) != 0, then the operation is double-precision (VMUD* and VMAD*).
op-codeType
00axxxmultiply
01xxxxadd
100xxxselect
101xxxlogical
110xxxdivide
  • 00 (VMULF) Vector Multiply Signed Fractions
  • 01 (VMULU) Vector Multiply Unsigned Fractions
  • 02 reservedVRNDP was intended for MPEG DCT rounding but omitted.
  • 03 reservedVMULQ was intended for MPEG inverse quantization but omitted.
  • 04 (VMUDL) Vector Multiply Low Partial Products
  • 05 (VMUDM) Vector Multiply Mid Partial Products
  • 06 (VMUDN) Vector Multiply Mid Partial Products
  • 07 (VMUDH) Vector Multiply High Partial Products
  • 10 (VMACF) Vector Multiply-Accumulate Signed Fractions
  • 11 (VMACU) Vector Multiply-Accumulate Unsigned Fractions
  • 12 reservedVRNDN was intended for MPEG DCT rounding but omitted.
  • 13 (VMACQ) Vector Accumulator Oddification
  • 14 (VMADL) Vector Multiply-Accumulate Low Partial Products
  • 15 (VMADM) Vector Multiply-Accumulate Mid Partial Products
  • 16 (VMADN) Vector Multiply-Accumulate Mid Partial Products
  • 17 (VMADH) Vector Multiply-Accumulate High Partial Products
  • 20 (VADD) Vector Add Short Elements
  • 21 (VSUB) Vector Subtract Short Elements
  • 22 reserved
  • 23 (VABS) Vector Absolute Value of Short Elements
  • 24 (VADDC) Vector Add Short Elements with Carry
  • 25 (VSUBC) Vector Subtract Short Elements with Carry
  • 26 reserved
  • 27 reserved
  • 30 reserved
  • 31 reserved
  • 32 reserved
  • 33 reserved
  • 34 reserved
  • 35 (VSAR) Vector Accumulator Read
  • 36 reserved
  • 37 reserved
  • 40 (VLT) Vector Select Less Than
  • 41 (VEQ) Vector Select Equal
  • 42 (VNE) Vector Select Not Equal
  • 43 (VGE) Vector Select Greater Than or Equal
  • 44 (VCL) Vector Select Clip Test Low
  • 45 (VCH) Vector Select Clip Test High
  • 46 (VCR) Vector Select Clip Test Low (single-precision)
  • 47 (VMRG) Vector Select Merge
  • 50 (VAND) Vector AND Short Elements
  • 51 (VNAND) Vector NAND Short Elements
  • 52 (VOR) Vector OR Short Elements
  • 53 (VNOR) Vector NOR Short Elements
  • 54 (VXOR) Vector XOR Short Elements
  • 55 (VNXOR) Vector NXOR Short Elements
  • 56 reserved
  • 57 reserved
  • 60 (VRCP) Vector Element Scalar Reciprocal (single-precision)
  • 61 (VRCPL) Vector Element Scalar Reciprocal Low
  • 62 (VRCPH) Vector Element Scalar Reciprocal High
  • 63 (VMOV) Vector Element Scalar Move
  • 64 (VRSQ) Vector Element Scalar SQRT Reciprocal (single-precision)
  • 65 (VRSQL) Vector Element Scalar SQRT Reciprocal Low
  • 66 (VRSQH) Vector Element Scalar SQRT Reciprocal High
  • 67 (VNOP) Vector Null Instruction
  • 70 reserved
  • 71 reserved
  • 72 reserved
  • 73 reserved
  • 74 reserved
  • 75 reserved
  • 76 reserved
  • 77 reserved

RSP Vector Load Transfers

The VR-DMEM transaction instruction cycles are still processed by the scalar unit, not the vector unit. In the modern implementations accepted by most vector unit communications systems today, the transfer instructions are classifiable under five groups:

  1. BV, SV, LV, DV
  2. PV, UV, XV, ZV
  3. HV, FV, AV
  4. QV, RV
  5. TV, WV

Not all of those instructions were implemented as of the time of the Nintendo 64's RCP, however. Additionally, their ordering in the opcode matrix was a little skewed to what is seen below. At this time, it is better to use only three categories of instructions:

  • normal: Anything under Group I or Group IV is normal type. Only the element must be aligned; addr & 1 may resolve true.
  • packed: Anything under Group II or Group III. Useful for working with specially mapped data, such as pixels.
  • transposed: LTV, LTWV,STV, and SWV can be found in heaps of 16 instructions, all dedicated to matrix transposition through eight diagonals of halfword elements.

LWC2vt[element], offset(base)

LWC2basevtrdelementoffset
110010sssssttttt?????eeeeXxxxxxx
  • 00 (LBV) Load Byte to Vector Unit
  • 01 (LSV) Load Shortword to Vector Unit
  • 02 (LLV) Load Longword to Vector Unit
  • 03 (LDV) Load Doubleword to Vector Unit
  • 04 (LQV) Load Quadword to Vector Unit
  • 05 (LRV) Load Rest to Vector Unit
  • 06 (LPV) Load Packed Signed to Vector Unit
  • 07 (LUV) Load Packed Unsigned to Vector Unit
  • 10 (LHV) Load Alternate Bytes to Vector Unit
  • 11 (LFV) Load Alternate Fourths to Vector Unit
  • 12 reservedLTWV
  • 13 (LTV) Load Transposed to Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

SWC2vt[element], offset(base)

SWC2basevtrdelementoffset
111010sssssttttt?????eeeeXxxxxxx
  • 00 (SBV) Store Byte from Vector Unit
  • 01 (SSV) Store Shortword from Vector Unit
  • 02 (SLV) Store Longword from Vector Unit
  • 03 (SDV) Store Doubleword from Vector Unit
  • 04 (SQV) Store Quadword from Vector Unit
  • 05 (SRV) Store Rest from Vector Unit
  • 06 (SPV) Store Packed Signed from Vector Unit
  • 07 (SUV) Store Packed Unsigned from Vector Unit
  • 10 (SHV) Store Alternate Bytes from Vector Unit
  • 11 (SFV) Store Alternate Fourths from Vector Unit
  • 12 (SWV) Store Transposed Wrapped from Vector Unit
  • 13 (STV) Store Transposed from Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

If, by any chance, the opcode specifier is greater than 17 [oct], it was probably meant to execute the extended counterparts to the above loads and stores, which were questionably obsolete and remain reserved.

Informational References for Vector Processor Architecture

Instruction Methods for Performing Data Formatting While Moving Data Between Memory and a Vector Register File United States patent no. 5,812,147 Timothy J. Van Hook Silicon Graphics, Inc.

Method and System for Efficient Matrix Multiplication in a SIMD Processor Architecture United States patent no. 7,873,812 Tibet Mimar

Efficient Handling of Vector High-Level Language Constructs in a SIMD Processor United States patent no. 7,793,084 Tibet Mimar

Flexible Vector Modes of Operation for SIMD Processor patent pending? Tibet Mimar

Programming a Vector Processor and Parallel Programming of an Asymmetric Dual Multiprocessor Comprised of a Vector Processor and a RISC Processor United States patent no. 6,016,395 Moataz Ali Mohamed Samsung Electronics Co., Ltd.

Execution Unit for Processing a Data Stream Independently and in Parallel United States patent no. 6,401,194 Le Trong Nguyen Samsung Electronics Co., Ltd.

About

Exemplary MSP communications simulator using a normalized VU.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Vector Technology as Implemented for Use with a RISC and SIMD Technology Signal Processor

A vector processor uses long registers addressable by segment-precision, where each segment is n bits wide. The power of a vector processor is that many complex matrix operations, whose algorithms take many scalar CPU instructions and clock cycles to emulate on a regular, personal computer processor, can often times formulate and transfer the correct result in less than a single clock cycle. The impossibility to replicate this precise behavior has paved the way for vendor businesses to protect their systems against hardware emulation since the introduction of display devices rendering three-dimensional graphics. The Nintendo 64 was the first video game system to employ this convenience to their advantage.


Project Reality's Signal Processor

In the engineering make-up of the Nintendo 64 (original codename: Project Reality) is a modified MIPS family revision 4000 co-processor called the "Reality Coprocessor" (RCP). More importantly, the signal processor in this component is responsible for all vector memory operations and transactions, which are almost all impossible to emulate with full accuracy on a scalar, personal computer processor. The vector technology implemented into this design is that accepted from Silicon Graphics, Inc.

RSP Vector Operation Matrices

Here, the entire MIPS R4000 instruction set was modified for very fast, exception-free processing flow, and operation definitions for each instruction do not fall within the scope of this section. Presented instead are layouts of the new instructions added to the scalar unit (those under LWC2 and SWC2, even though they do interface with the vector unit) and the vector unit (essentially, any instruction under COP2 whose mnemonic starts with a 'V'). Information of how pre-existing MIPS R4000 instructions were modified or which ones were removed is the adventure of the MIPS programmer to research.

C2vd, vs, vt[element] /* exceptions: scalar divide reads */

COP2elementvs1vs2vtfunc
0100101eeeetttttsssssddddd??????

The major types of VU computational instructions are multiply,add,select,logical, and divide.

Multiply instructions are the most frequent and classifiable as follows:

  • If a == 0, then round the product loaded to the accumulator (VMUL* and VMUD*).
  • If a == 1, then the product is added to an accumulator element (VMAC* and VMAD*).
  • If (format & 0b100) == 0, then the operation is single-precision (VMUL* and VMAC*).
  • If (format & 0b100) != 0, then the operation is double-precision (VMUD* and VMAD*).
op-codeType
00axxxmultiply
01xxxxadd
100xxxselect
101xxxlogical
110xxxdivide
  • 00 (VMULF) Vector Multiply Signed Fractions
  • 01 (VMULU) Vector Multiply Unsigned Fractions
  • 02 reservedVRNDP was intended for MPEG DCT rounding but omitted.
  • 03 reservedVMULQ was intended for MPEG inverse quantization but omitted.
  • 04 (VMUDL) Vector Multiply Low Partial Products
  • 05 (VMUDM) Vector Multiply Mid Partial Products
  • 06 (VMUDN) Vector Multiply Mid Partial Products
  • 07 (VMUDH) Vector Multiply High Partial Products
  • 10 (VMACF) Vector Multiply-Accumulate Signed Fractions
  • 11 (VMACU) Vector Multiply-Accumulate Unsigned Fractions
  • 12 reservedVRNDN was intended for MPEG DCT rounding but omitted.
  • 13 (VMACQ) Vector Accumulator Oddification
  • 14 (VMADL) Vector Multiply-Accumulate Low Partial Products
  • 15 (VMADM) Vector Multiply-Accumulate Mid Partial Products
  • 16 (VMADN) Vector Multiply-Accumulate Mid Partial Products
  • 17 (VMADH) Vector Multiply-Accumulate High Partial Products
  • 20 (VADD) Vector Add Short Elements
  • 21 (VSUB) Vector Subtract Short Elements
  • 22 reserved
  • 23 (VABS) Vector Absolute Value of Short Elements
  • 24 (VADDC) Vector Add Short Elements with Carry
  • 25 (VSUBC) Vector Subtract Short Elements with Carry
  • 26 reserved
  • 27 reserved
  • 30 reserved
  • 31 reserved
  • 32 reserved
  • 33 reserved
  • 34 reserved
  • 35 (VSAR) Vector Accumulator Read
  • 36 reserved
  • 37 reserved
  • 40 (VLT) Vector Select Less Than
  • 41 (VEQ) Vector Select Equal
  • 42 (VNE) Vector Select Not Equal
  • 43 (VGE) Vector Select Greater Than or Equal
  • 44 (VCL) Vector Select Clip Test Low
  • 45 (VCH) Vector Select Clip Test High
  • 46 (VCR) Vector Select Clip Test Low (single-precision)
  • 47 (VMRG) Vector Select Merge
  • 50 (VAND) Vector AND Short Elements
  • 51 (VNAND) Vector NAND Short Elements
  • 52 (VOR) Vector OR Short Elements
  • 53 (VNOR) Vector NOR Short Elements
  • 54 (VXOR) Vector XOR Short Elements
  • 55 (VNXOR) Vector NXOR Short Elements
  • 56 reserved
  • 57 reserved
  • 60 (VRCP) Vector Element Scalar Reciprocal (single-precision)
  • 61 (VRCPL) Vector Element Scalar Reciprocal Low
  • 62 (VRCPH) Vector Element Scalar Reciprocal High
  • 63 (VMOV) Vector Element Scalar Move
  • 64 (VRSQ) Vector Element Scalar SQRT Reciprocal (single-precision)
  • 65 (VRSQL) Vector Element Scalar SQRT Reciprocal Low
  • 66 (VRSQH) Vector Element Scalar SQRT Reciprocal High
  • 67 (VNOP) Vector Null Instruction
  • 70 reserved
  • 71 reserved
  • 72 reserved
  • 73 reserved
  • 74 reserved
  • 75 reserved
  • 76 reserved
  • 77 reserved

RSP Vector Load Transfers

The VR-DMEM transaction instruction cycles are still processed by the scalar unit, not the vector unit. In the modern implementations accepted by most vector unit communications systems today, the transfer instructions are classifiable under five groups:

  1. BV, SV, LV, DV
  2. PV, UV, XV, ZV
  3. HV, FV, AV
  4. QV, RV
  5. TV, WV

Not all of those instructions were implemented as of the time of the Nintendo 64's RCP, however. Additionally, their ordering in the opcode matrix was a little skewed to what is seen below. At this time, it is better to use only three categories of instructions:

  • normal: Anything under Group I or Group IV is normal type. Only the element must be aligned; addr & 1 may resolve true.
  • packed: Anything under Group II or Group III. Useful for working with specially mapped data, such as pixels.
  • transposed: LTV, LTWV,STV, and SWV can be found in heaps of 16 instructions, all dedicated to matrix transposition through eight diagonals of halfword elements.

LWC2vt[element], offset(base)

LWC2basevtrdelementoffset
110010sssssttttt?????eeeeXxxxxxx
  • 00 (LBV) Load Byte to Vector Unit
  • 01 (LSV) Load Shortword to Vector Unit
  • 02 (LLV) Load Longword to Vector Unit
  • 03 (LDV) Load Doubleword to Vector Unit
  • 04 (LQV) Load Quadword to Vector Unit
  • 05 (LRV) Load Rest to Vector Unit
  • 06 (LPV) Load Packed Signed to Vector Unit
  • 07 (LUV) Load Packed Unsigned to Vector Unit
  • 10 (LHV) Load Alternate Bytes to Vector Unit
  • 11 (LFV) Load Alternate Fourths to Vector Unit
  • 12 reservedLTWV
  • 13 (LTV) Load Transposed to Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

SWC2vt[element], offset(base)

SWC2basevtrdelementoffset
111010sssssttttt?????eeeeXxxxxxx
  • 00 (SBV) Store Byte from Vector Unit
  • 01 (SSV) Store Shortword from Vector Unit
  • 02 (SLV) Store Longword from Vector Unit
  • 03 (SDV) Store Doubleword from Vector Unit
  • 04 (SQV) Store Quadword from Vector Unit
  • 05 (SRV) Store Rest from Vector Unit
  • 06 (SPV) Store Packed Signed from Vector Unit
  • 07 (SUV) Store Packed Unsigned from Vector Unit
  • 10 (SHV) Store Alternate Bytes from Vector Unit
  • 11 (SFV) Store Alternate Fourths from Vector Unit
  • 12 (SWV) Store Transposed Wrapped from Vector Unit
  • 13 (STV) Store Transposed from Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

If, by any chance, the opcode specifier is greater than 17 [oct], it was probably meant to execute the extended counterparts to the above loads and stores, which were questionably obsolete and remain reserved.

Informational References for Vector Processor Architecture

Instruction Methods for Performing Data Formatting While Moving Data Between Memory and a Vector Register File United States patent no. 5,812,147 Timothy J. Van Hook Silicon Graphics, Inc.

Method and System for Efficient Matrix Multiplication in a SIMD Processor Architecture United States patent no. 7,873,812 Tibet Mimar

Efficient Handling of Vector High-Level Language Constructs in a SIMD Processor United States patent no. 7,793,084 Tibet Mimar

Flexible Vector Modes of Operation for SIMD Processor patent pending? Tibet Mimar

Programming a Vector Processor and Parallel Programming of an Asymmetric Dual Multiprocessor Comprised of a Vector Processor and a RISC Processor United States patent no. 6,016,395 Moataz Ali Mohamed Samsung Electronics Co., Ltd.

Execution Unit for Processing a Data Stream Independently and in Parallel United States patent no. 6,401,194 Le Trong Nguyen Samsung Electronics Co., Ltd.

About

Exemplary MSP communications simulator using a normalized VU.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

Vector Technology as Implemented for Use with a RISC and SIMD Technology Signal Processor

A vector processor uses long registers addressable by segment-precision, where each segment is n bits wide. The power of a vector processor is that many complex matrix operations, whose algorithms take many scalar CPU instructions and clock cycles to emulate on a regular, personal computer processor, can often times formulate and transfer the correct result in less than a single clock cycle. The impossibility to replicate this precise behavior has paved the way for vendor businesses to protect their systems against hardware emulation since the introduction of display devices rendering three-dimensional graphics. The Nintendo 64 was the first video game system to employ this convenience to their advantage.


Project Reality's Signal Processor

In the engineering make-up of the Nintendo 64 (original codename: Project Reality) is a modified MIPS family revision 4000 co-processor called the "Reality Coprocessor" (RCP). More importantly, the signal processor in this component is responsible for all vector memory operations and transactions, which are almost all impossible to emulate with full accuracy on a scalar, personal computer processor. The vector technology implemented into this design is that accepted from Silicon Graphics, Inc.

RSP Vector Operation Matrices

Here, the entire MIPS R4000 instruction set was modified for very fast, exception-free processing flow, and operation definitions for each instruction do not fall within the scope of this section. Presented instead are layouts of the new instructions added to the scalar unit (those under LWC2 and SWC2, even though they do interface with the vector unit) and the vector unit (essentially, any instruction under COP2 whose mnemonic starts with a 'V'). Information of how pre-existing MIPS R4000 instructions were modified or which ones were removed is the adventure of the MIPS programmer to research.

C2vd, vs, vt[element] /* exceptions: scalar divide reads */

COP2elementvs1vs2vtfunc
0100101eeeetttttsssssddddd??????

The major types of VU computational instructions are multiply,add,select,logical, and divide.

Multiply instructions are the most frequent and classifiable as follows:

  • If a == 0, then round the product loaded to the accumulator (VMUL* and VMUD*).
  • If a == 1, then the product is added to an accumulator element (VMAC* and VMAD*).
  • If (format & 0b100) == 0, then the operation is single-precision (VMUL* and VMAC*).
  • If (format & 0b100) != 0, then the operation is double-precision (VMUD* and VMAD*).
op-codeType
00axxxmultiply
01xxxxadd
100xxxselect
101xxxlogical
110xxxdivide
  • 00 (VMULF) Vector Multiply Signed Fractions
  • 01 (VMULU) Vector Multiply Unsigned Fractions
  • 02 reservedVRNDP was intended for MPEG DCT rounding but omitted.
  • 03 reservedVMULQ was intended for MPEG inverse quantization but omitted.
  • 04 (VMUDL) Vector Multiply Low Partial Products
  • 05 (VMUDM) Vector Multiply Mid Partial Products
  • 06 (VMUDN) Vector Multiply Mid Partial Products
  • 07 (VMUDH) Vector Multiply High Partial Products
  • 10 (VMACF) Vector Multiply-Accumulate Signed Fractions
  • 11 (VMACU) Vector Multiply-Accumulate Unsigned Fractions
  • 12 reservedVRNDN was intended for MPEG DCT rounding but omitted.
  • 13 (VMACQ) Vector Accumulator Oddification
  • 14 (VMADL) Vector Multiply-Accumulate Low Partial Products
  • 15 (VMADM) Vector Multiply-Accumulate Mid Partial Products
  • 16 (VMADN) Vector Multiply-Accumulate Mid Partial Products
  • 17 (VMADH) Vector Multiply-Accumulate High Partial Products
  • 20 (VADD) Vector Add Short Elements
  • 21 (VSUB) Vector Subtract Short Elements
  • 22 reserved
  • 23 (VABS) Vector Absolute Value of Short Elements
  • 24 (VADDC) Vector Add Short Elements with Carry
  • 25 (VSUBC) Vector Subtract Short Elements with Carry
  • 26 reserved
  • 27 reserved
  • 30 reserved
  • 31 reserved
  • 32 reserved
  • 33 reserved
  • 34 reserved
  • 35 (VSAR) Vector Accumulator Read
  • 36 reserved
  • 37 reserved
  • 40 (VLT) Vector Select Less Than
  • 41 (VEQ) Vector Select Equal
  • 42 (VNE) Vector Select Not Equal
  • 43 (VGE) Vector Select Greater Than or Equal
  • 44 (VCL) Vector Select Clip Test Low
  • 45 (VCH) Vector Select Clip Test High
  • 46 (VCR) Vector Select Clip Test Low (single-precision)
  • 47 (VMRG) Vector Select Merge
  • 50 (VAND) Vector AND Short Elements
  • 51 (VNAND) Vector NAND Short Elements
  • 52 (VOR) Vector OR Short Elements
  • 53 (VNOR) Vector NOR Short Elements
  • 54 (VXOR) Vector XOR Short Elements
  • 55 (VNXOR) Vector NXOR Short Elements
  • 56 reserved
  • 57 reserved
  • 60 (VRCP) Vector Element Scalar Reciprocal (single-precision)
  • 61 (VRCPL) Vector Element Scalar Reciprocal Low
  • 62 (VRCPH) Vector Element Scalar Reciprocal High
  • 63 (VMOV) Vector Element Scalar Move
  • 64 (VRSQ) Vector Element Scalar SQRT Reciprocal (single-precision)
  • 65 (VRSQL) Vector Element Scalar SQRT Reciprocal Low
  • 66 (VRSQH) Vector Element Scalar SQRT Reciprocal High
  • 67 (VNOP) Vector Null Instruction
  • 70 reserved
  • 71 reserved
  • 72 reserved
  • 73 reserved
  • 74 reserved
  • 75 reserved
  • 76 reserved
  • 77 reserved

RSP Vector Load Transfers

The VR-DMEM transaction instruction cycles are still processed by the scalar unit, not the vector unit. In the modern implementations accepted by most vector unit communications systems today, the transfer instructions are classifiable under five groups:

  1. BV, SV, LV, DV
  2. PV, UV, XV, ZV
  3. HV, FV, AV
  4. QV, RV
  5. TV, WV

Not all of those instructions were implemented as of the time of the Nintendo 64's RCP, however. Additionally, their ordering in the opcode matrix was a little skewed to what is seen below. At this time, it is better to use only three categories of instructions:

  • normal: Anything under Group I or Group IV is normal type. Only the element must be aligned; addr & 1 may resolve true.
  • packed: Anything under Group II or Group III. Useful for working with specially mapped data, such as pixels.
  • transposed: LTV, LTWV,STV, and SWV can be found in heaps of 16 instructions, all dedicated to matrix transposition through eight diagonals of halfword elements.

LWC2vt[element], offset(base)

LWC2basevtrdelementoffset
110010sssssttttt?????eeeeXxxxxxx
  • 00 (LBV) Load Byte to Vector Unit
  • 01 (LSV) Load Shortword to Vector Unit
  • 02 (LLV) Load Longword to Vector Unit
  • 03 (LDV) Load Doubleword to Vector Unit
  • 04 (LQV) Load Quadword to Vector Unit
  • 05 (LRV) Load Rest to Vector Unit
  • 06 (LPV) Load Packed Signed to Vector Unit
  • 07 (LUV) Load Packed Unsigned to Vector Unit
  • 10 (LHV) Load Alternate Bytes to Vector Unit
  • 11 (LFV) Load Alternate Fourths to Vector Unit
  • 12 reservedLTWV
  • 13 (LTV) Load Transposed to Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

SWC2vt[element], offset(base)

SWC2basevtrdelementoffset
111010sssssttttt?????eeeeXxxxxxx
  • 00 (SBV) Store Byte from Vector Unit
  • 01 (SSV) Store Shortword from Vector Unit
  • 02 (SLV) Store Longword from Vector Unit
  • 03 (SDV) Store Doubleword from Vector Unit
  • 04 (SQV) Store Quadword from Vector Unit
  • 05 (SRV) Store Rest from Vector Unit
  • 06 (SPV) Store Packed Signed from Vector Unit
  • 07 (SUV) Store Packed Unsigned from Vector Unit
  • 10 (SHV) Store Alternate Bytes from Vector Unit
  • 11 (SFV) Store Alternate Fourths from Vector Unit
  • 12 (SWV) Store Transposed Wrapped from Vector Unit
  • 13 (STV) Store Transposed from Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

If, by any chance, the opcode specifier is greater than 17 [oct], it was probably meant to execute the extended counterparts to the above loads and stores, which were questionably obsolete and remain reserved.

Informational References for Vector Processor Architecture

Instruction Methods for Performing Data Formatting While Moving Data Between Memory and a Vector Register File United States patent no. 5,812,147 Timothy J. Van Hook Silicon Graphics, Inc.

Method and System for Efficient Matrix Multiplication in a SIMD Processor Architecture United States patent no. 7,873,812 Tibet Mimar

Efficient Handling of Vector High-Level Language Constructs in a SIMD Processor United States patent no. 7,793,084 Tibet Mimar

Flexible Vector Modes of Operation for SIMD Processor patent pending? Tibet Mimar

Programming a Vector Processor and Parallel Programming of an Asymmetric Dual Multiprocessor Comprised of a Vector Processor and a RISC Processor United States patent no. 6,016,395 Moataz Ali Mohamed Samsung Electronics Co., Ltd.

Execution Unit for Processing a Data Stream Independently and in Parallel United States patent no. 6,401,194 Le Trong Nguyen Samsung Electronics Co., Ltd.

About

Exemplary MSP communications simulator using a normalized VU.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

Vector Technology as Implemented for Use with a RISC and SIMD Technology Signal Processor

A vector processor uses long registers addressable by segment-precision, where each segment is n bits wide. The power of a vector processor is that many complex matrix operations, whose algorithms take many scalar CPU instructions and clock cycles to emulate on a regular, personal computer processor, can often times formulate and transfer the correct result in less than a single clock cycle. The impossibility to replicate this precise behavior has paved the way for vendor businesses to protect their systems against hardware emulation since the introduction of display devices rendering three-dimensional graphics. The Nintendo 64 was the first video game system to employ this convenience to their advantage.


Project Reality's Signal Processor

In the engineering make-up of the Nintendo 64 (original codename: Project Reality) is a modified MIPS family revision 4000 co-processor called the "Reality Coprocessor" (RCP). More importantly, the signal processor in this component is responsible for all vector memory operations and transactions, which are almost all impossible to emulate with full accuracy on a scalar, personal computer processor. The vector technology implemented into this design is that accepted from Silicon Graphics, Inc.

RSP Vector Operation Matrices

Here, the entire MIPS R4000 instruction set was modified for very fast, exception-free processing flow, and operation definitions for each instruction do not fall within the scope of this section. Presented instead are layouts of the new instructions added to the scalar unit (those under LWC2 and SWC2, even though they do interface with the vector unit) and the vector unit (essentially, any instruction under COP2 whose mnemonic starts with a 'V'). Information of how pre-existing MIPS R4000 instructions were modified or which ones were removed is the adventure of the MIPS programmer to research.

C2vd, vs, vt[element] /* exceptions: scalar divide reads */

COP2elementvs1vs2vtfunc
0100101eeeetttttsssssddddd??????

The major types of VU computational instructions are multiply,add,select,logical, and divide.

Multiply instructions are the most frequent and classifiable as follows:

  • If a == 0, then round the product loaded to the accumulator (VMUL* and VMUD*).
  • If a == 1, then the product is added to an accumulator element (VMAC* and VMAD*).
  • If (format & 0b100) == 0, then the operation is single-precision (VMUL* and VMAC*).
  • If (format & 0b100) != 0, then the operation is double-precision (VMUD* and VMAD*).
op-codeType
00axxxmultiply
01xxxxadd
100xxxselect
101xxxlogical
110xxxdivide
  • 00 (VMULF) Vector Multiply Signed Fractions
  • 01 (VMULU) Vector Multiply Unsigned Fractions
  • 02 reservedVRNDP was intended for MPEG DCT rounding but omitted.
  • 03 reservedVMULQ was intended for MPEG inverse quantization but omitted.
  • 04 (VMUDL) Vector Multiply Low Partial Products
  • 05 (VMUDM) Vector Multiply Mid Partial Products
  • 06 (VMUDN) Vector Multiply Mid Partial Products
  • 07 (VMUDH) Vector Multiply High Partial Products
  • 10 (VMACF) Vector Multiply-Accumulate Signed Fractions
  • 11 (VMACU) Vector Multiply-Accumulate Unsigned Fractions
  • 12 reservedVRNDN was intended for MPEG DCT rounding but omitted.
  • 13 (VMACQ) Vector Accumulator Oddification
  • 14 (VMADL) Vector Multiply-Accumulate Low Partial Products
  • 15 (VMADM) Vector Multiply-Accumulate Mid Partial Products
  • 16 (VMADN) Vector Multiply-Accumulate Mid Partial Products
  • 17 (VMADH) Vector Multiply-Accumulate High Partial Products
  • 20 (VADD) Vector Add Short Elements
  • 21 (VSUB) Vector Subtract Short Elements
  • 22 reserved
  • 23 (VABS) Vector Absolute Value of Short Elements
  • 24 (VADDC) Vector Add Short Elements with Carry
  • 25 (VSUBC) Vector Subtract Short Elements with Carry
  • 26 reserved
  • 27 reserved
  • 30 reserved
  • 31 reserved
  • 32 reserved
  • 33 reserved
  • 34 reserved
  • 35 (VSAR) Vector Accumulator Read
  • 36 reserved
  • 37 reserved
  • 40 (VLT) Vector Select Less Than
  • 41 (VEQ) Vector Select Equal
  • 42 (VNE) Vector Select Not Equal
  • 43 (VGE) Vector Select Greater Than or Equal
  • 44 (VCL) Vector Select Clip Test Low
  • 45 (VCH) Vector Select Clip Test High
  • 46 (VCR) Vector Select Clip Test Low (single-precision)
  • 47 (VMRG) Vector Select Merge
  • 50 (VAND) Vector AND Short Elements
  • 51 (VNAND) Vector NAND Short Elements
  • 52 (VOR) Vector OR Short Elements
  • 53 (VNOR) Vector NOR Short Elements
  • 54 (VXOR) Vector XOR Short Elements
  • 55 (VNXOR) Vector NXOR Short Elements
  • 56 reserved
  • 57 reserved
  • 60 (VRCP) Vector Element Scalar Reciprocal (single-precision)
  • 61 (VRCPL) Vector Element Scalar Reciprocal Low
  • 62 (VRCPH) Vector Element Scalar Reciprocal High
  • 63 (VMOV) Vector Element Scalar Move
  • 64 (VRSQ) Vector Element Scalar SQRT Reciprocal (single-precision)
  • 65 (VRSQL) Vector Element Scalar SQRT Reciprocal Low
  • 66 (VRSQH) Vector Element Scalar SQRT Reciprocal High
  • 67 (VNOP) Vector Null Instruction
  • 70 reserved
  • 71 reserved
  • 72 reserved
  • 73 reserved
  • 74 reserved
  • 75 reserved
  • 76 reserved
  • 77 reserved

RSP Vector Load Transfers

The VR-DMEM transaction instruction cycles are still processed by the scalar unit, not the vector unit. In the modern implementations accepted by most vector unit communications systems today, the transfer instructions are classifiable under five groups:

  1. BV, SV, LV, DV
  2. PV, UV, XV, ZV
  3. HV, FV, AV
  4. QV, RV
  5. TV, WV

Not all of those instructions were implemented as of the time of the Nintendo 64's RCP, however. Additionally, their ordering in the opcode matrix was a little skewed to what is seen below. At this time, it is better to use only three categories of instructions:

  • normal: Anything under Group I or Group IV is normal type. Only the element must be aligned; addr & 1 may resolve true.
  • packed: Anything under Group II or Group III. Useful for working with specially mapped data, such as pixels.
  • transposed: LTV, LTWV,STV, and SWV can be found in heaps of 16 instructions, all dedicated to matrix transposition through eight diagonals of halfword elements.

LWC2vt[element], offset(base)

LWC2basevtrdelementoffset
110010sssssttttt?????eeeeXxxxxxx
  • 00 (LBV) Load Byte to Vector Unit
  • 01 (LSV) Load Shortword to Vector Unit
  • 02 (LLV) Load Longword to Vector Unit
  • 03 (LDV) Load Doubleword to Vector Unit
  • 04 (LQV) Load Quadword to Vector Unit
  • 05 (LRV) Load Rest to Vector Unit
  • 06 (LPV) Load Packed Signed to Vector Unit
  • 07 (LUV) Load Packed Unsigned to Vector Unit
  • 10 (LHV) Load Alternate Bytes to Vector Unit
  • 11 (LFV) Load Alternate Fourths to Vector Unit
  • 12 reservedLTWV
  • 13 (LTV) Load Transposed to Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

SWC2vt[element], offset(base)

SWC2basevtrdelementoffset
111010sssssttttt?????eeeeXxxxxxx
  • 00 (SBV) Store Byte from Vector Unit
  • 01 (SSV) Store Shortword from Vector Unit
  • 02 (SLV) Store Longword from Vector Unit
  • 03 (SDV) Store Doubleword from Vector Unit
  • 04 (SQV) Store Quadword from Vector Unit
  • 05 (SRV) Store Rest from Vector Unit
  • 06 (SPV) Store Packed Signed from Vector Unit
  • 07 (SUV) Store Packed Unsigned from Vector Unit
  • 10 (SHV) Store Alternate Bytes from Vector Unit
  • 11 (SFV) Store Alternate Fourths from Vector Unit
  • 12 (SWV) Store Transposed Wrapped from Vector Unit
  • 13 (STV) Store Transposed from Vector Unit
  • 14 reserved
  • 15 reserved
  • 16 reserved
  • 17 reserved

If, by any chance, the opcode specifier is greater than 17 [oct], it was probably meant to execute the extended counterparts to the above loads and stores, which were questionably obsolete and remain reserved.

Informational References for Vector Processor Architecture

Instruction Methods for Performing Data Formatting While Moving Data Between Memory and a Vector Register File United States patent no. 5,812,147 Timothy J. Van Hook Silicon Graphics, Inc.

Method and System for Efficient Matrix Multiplication in a SIMD Processor Architecture United States patent no. 7,873,812 Tibet Mimar

Efficient Handling of Vector High-Level Language Constructs in a SIMD Processor United States patent no. 7,793,084 Tibet Mimar

Flexible Vector Modes of Operation for SIMD Processor patent pending? Tibet Mimar

Programming a Vector Processor and Parallel Programming of an Asymmetric Dual Multiprocessor Comprised of a Vector Processor and a RISC Processor United States patent no. 6,016,395 Moataz Ali Mohamed Samsung Electronics Co., Ltd.

Execution Unit for Processing a Data Stream Independently and in Parallel United States patent no. 6,401,194 Le Trong Nguyen Samsung Electronics Co., Ltd.

About

Exemplary MSP communications simulator using a normalized VU.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages