Nintendo 64 Toolkit: opcodes v1.1 by anarko <anarko@flashback.net>

Part E: Detailed list of RSP opcodes                  released on 1999-04-21
----------------------------------------------------------------------------

All information on the RSP was provided by my friend Zilmar.

****************************************************************************
** Registers                                                              **
****************************************************************************
  Main GPR registers:
  -------------------
     00h = r0/reg0     08h = t0/reg8     10h = s0/reg16    18h = t8/reg24
     01h = at/reg1     09h = t1/reg9     11h = s1/reg17    19h = t9/reg25
     02h = v0/reg2     0Ah = t2/reg10    12h = s2/reg18    1Ah = k0/reg26
     03h = v1/reg3     0Bh = t3/reg11    13h = s3/reg19    1Bh = k1/reg27
     04h = a0/reg4     0Ch = t4/reg12    14h = s4/reg20    1Ch = gp/reg28
     05h = a1/reg5     0Dh = t5/reg13    15h = s5/reg21    1Dh = sp/reg29
     06h = a2/reg6     0Eh = t6/reg14    16h = s6/reg22    1Eh = s8/reg30
     07h = a3/reg7     0Fh = t7/reg15    17h = s7/reg23    1Fh = ra/reg31

  Vector registers:
  -----------------
     00h = $v0         08h = $v8         10h = $v16        18h = $v24
     01h = $v1         09h = $v9         11h = $v17        19h = $v25
     02h = $v2         0Ah = $v10        12h = $v18        1Ah = $v26
     03h = $v3         0Bh = $v11        13h = $v19        1Bh = $v27
     04h = $v4         0Ch = $v12        14h = $v20        1Ch = $v28
     05h = $v5         0Dh = $v13        15h = $v21        1Dh = $v29
     06h = $v6         0Eh = $v14        16h = $v22        1Eh = $v30
     07h = $v7         0Fh = $v15        17h = $v23        1Fh = $v31


****************************************************************************
** Load and Store Instructions                                            **
****************************************************************************
  +-----------+---------------------------------------------------+
  | LBV       | Load byte to vector                               |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00000  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  LBV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | LSV       | Load short (halfword) to vector                   |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00001  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  LSV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | LLV       | Load long (word) to vector                        |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00010  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  LLV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | LDV       | Load double to vector                             |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00011  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  LDV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | LQV       | Load quadword to vector                           |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00100  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  LQV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | LRV       | Load rest to vector                               |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00101  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  LRV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | LPV       | Load packed to vector                             |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00110  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  LPV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | LUV       | Load unpacked to vector                           |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00111  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  LUV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | LHV       | Load half to vector                               |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  01000  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  LHV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | LFV       | Load fourth to vector                             |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  01001  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  LFV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | LWV       | Load wrap to vector                               |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  01010  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  LWV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | LTV       | Load transpose to vector                          |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  01011  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  LTV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | SBV       | Store byte from vector                            |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00000  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  SBV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | SSV       | Store short (halfword) from vector                |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00001  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  SSV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | SLV       | Store long (word) from vector                     |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00010  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  SLV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | SDV       | Store double (doubleword) from vector             |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00011  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  SDV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | SQV       | Store quad (quadword) from vector                 |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00100  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  SQV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | SRV       | Store rest from vector                            |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00101  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  SRV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | SPV       | Store packed from vector                          |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00110  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  SPV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | SUV       | Store unpacked from vector                        |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  00111  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  SUV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | SHV       | Store half from vector                            |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  01000  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  SHV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | SFV       | Store fourth from vector                          |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  01001  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  SFV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | SWV       | Store wrap from vector                            |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  01010  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  SWV $v<dest>[del], offset(base)

  +-----------+---------------------------------------------------+
  | STV       | Store transpose from vector                       |
  +-----------+---------+---------+---------+-------+-+-----------+
  |  110010   |  base   |  dest   |  01011  |  del  |0|   offset  |
  +-----6-----+----5----+----5----+----5----+---4---+1+-----6-----+
  Format:  STV $v<dest>[del], offset(base)



****************************************************************************
** Vector instructions                                                    **
****************************************************************************
  -----------------------------------------------------------------
  | VMULF     | Vector (Frac) Multiply                            |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  000000   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VMULF $v<dest>, $v<s1>, $v<s2>[el]

  -----------------------------------------------------------------
  | VMULU     | Vector (Unsigned Frac) Multiply                   |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  000001   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VMULU $v<dest>, $v<s1>, $v<s2>[el]

  -----------------------------------------------------------------
  | VRNDP     | Vector DCT Round (+)                              |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  000010   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VRNDP $v<dest>, $v<s1>, $v<s2>[el]

  -----------------------------------------------------------------
  | VMULQ     | Vector (Integer) Multiply                         |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  000011   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VMULQ $v<dest>, $v<s1>, $v<s2>[el]

  -----------------------------------------------------------------
  | VMUDL     | Vector low multiply                               |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  000100   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VMUDL $v<dest>, $v<s1>, $v<s2>[el]

  -----------------------------------------------------------------
  | VMUDM     | Vector mid-m multiply                             |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  000101   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VMUDM $v<dest>, $v<s1>, $v<s2>[el]

  -----------------------------------------------------------------
  | VMUDN     | Vector mid-n multiply                             |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  000110   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VMUDN $v<dest>, $v<s1>, $v<s2>[el]

  -----------------------------------------------------------------
  | VMUDH     | Vector high multiply                              |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  000111   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VMUDH $v<dest>, $v<s1>, $v<s2>[el]

  -----------------------------------------------------------------
  | VMACF     | Vector (Frac) Multiply Accumulate                 |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  001000   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VMACF $v<dest>, $v<s1>, $v<s2>[el]

  -----------------------------------------------------------------
  | VMACU     | Vector (Unsigned Frac) Multiply Accumulate        |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  001001   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VMACU $v<dest>, $v<s1>, $v<s2>[el]

  -----------------------------------------------------------------
  | VRNDN     | Vector DCT Round (-)                              |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  001010   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VRNDN $v<dest>, $v<s1>, $v<s2>[el]

  -----------------------------------------------------------------
  | VMACQ     | Vector (Integer) Multiply Accumulate              |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  001011   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VMACQ $v<dest>, $v<s1>, $v<s2>[el]

  -----------------------------------------------------------------
  | VMADL     | Vector low multiply accumulate                    |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  001100   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VMADL $v<dest>, $v<s1>, $v<s2>[el]

  -----------------------------------------------------------------
  | VMADM     | Vector mid-m multiply accumulate                  |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  001101   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VMADM $v<dest>, $v<s1>, $v<s2>[el]

  -----------------------------------------------------------------
  | VMADN     | Vector mid-n multiply accumulate                  |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  001110   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VMADN $v<dest>, $v<s1>, $v<s2>[el]

  -----------------------------------------------------------------
  | VMADH     | Vector high multiply accumulate                   |
  |-----------|---------------------------------------------------|
  |  010010   |1|  el   |   s2    |   s1    |  dest   |  001111   |
  ------6------1----4--------5---------5---------5----------6------
  Format:  VMADH $v<dest>, $v<s1>, $v<s2>[el]
