SPECIAL2 011100 |
base |
index |
rd |
LWXS 00010 |
LXS 001000 |
6 |
5 |
5 |
5 |
5 |
6 |
LWXS rd, index(base) |
SmartMIPS Crypto |
Load Word Indexed, Scaled |
Load Word Indexed, Scaled
To load a word from memory as a signed value, using scaled indexed addressing.
GPR[rd] = memory[GPR[base] + (GPR[index] × 4)]
The contents of GPR index is multiplied by 4 and the result is added to the contents of GPR base to form an effective address. The contents of the 32-bit word at the memory location specified by the aligned effective address are fetched, sign-extended to the GPR register length if necessary, and placed in GPR rd.
The effective address must be naturally-aligned. If either of the 2 least-significant bits of the address is non-zero, an
Address Error exception occurs.
vAddr = (GPR[index]29..0 || 02) + GPR[base] if vAddr1..0 != 02 then SignalException(AddressError) endif (pAddr, CCA) = AddressTranslation (vAddr, DATA, LOAD) memword = LoadMemory (CCA, WORD, pAddr, vAddr, DATA) GPR[rd] = memword
TLB Refill, TLB Invalid, Bus Error, Address Error
SPECIAL2 011100 |
rs |
rt |
0 00000 |
MADDP 10001 |
MADDU 000001 |
6 |
5 |
5 |
5 |
5 |
6 |
MADDP rs, rt |
SmartMIPS Crypto |
Multiply and Add Polynomial Basis Word to Hi,Lo |
Multiply and Add Polynomial Basis Word to Hi,Lo
To multiply two 32-bit binary polynomial values and polynomial-basis add the result to Hi, Lo.
(LO,HI,ACX) = PolyMult(GPR[rs], GPR[rt]) xor (LO,HI,ACX)
The 32-bit word value in GPR rs is polynomial-basis multiplied by the 32-bit value in GPR rt, treating both operands as binary polynomial values, to produce a 64-bit result. The product is polynomial-basis added (XORed) to the 64-bit concatenated value of HI and LO, and the zero-extended result is written back into HI and LO. Although MADDP is formally deined to operate on special register ACX as well, its value can never be changed by the operation, nor can its input value affect the result. No arithmetic exception occurs under any circumstances.
This instruction does not provide the capability of writing directly to a target GPR.
temp = (HI31..0 || LO31..0) xor PolyMult(GPR[rs]31..0,GPR[rt]31..0) HI = sign_extend(temp63..32) LO = sign_extend(temp31..0) ACX = ACX
None
SPECIAL2 011100 |
rs |
rt |
0 00000 |
MADDU 00000 |
MADDU 000001 |
6 |
5 |
5 |
5 |
5 |
6 |
MADDU rs, rt |
SmartMIPS Crypto |
Multiply and Add Unsigned Word to Hi,Lo |
Multiply and Add Unsigned Word to Hi,Lo
To multiply two unsigned words and add the result to ACX, HI, LO.
(LO,HI,ACX) = (GPR[rs] * GPR[rt]) + (LO,HI,ACX)
The 32-bit word value in GPR rs is multiplied by the 32-bit value in GPR rt, treating both operands as unsigned values, to produce a 64-bit result. The product is added to the 72-or-more-bit concatenated value of ACX, HI, and LO, and the carry-extended result is written back into ACX, HI, and LO. No arithmetic exception occurs under any circumstances.
This instruction does not provide the capability of writing directly to a target GPR.
temp = (ACXACXMSB..0 || HI31..0|| LO31..0) + (GPR[rs]31..0* GPR[rt]31..0) ACX = zero_extend(tempACXMSB+64..64) HI = sign_extend(temp63..32) LO = sign_extend(temp31..0)
None
SPECIAL 000000 |
0 00 0000 0000 |
rd |
MFLHXU 00001 |
MFLO 010010 |
6 |
10 |
5 |
5 |
6 |
MFLHXU rd |
SmartMIPS Crypto |
Move from Extended Carry, Hi and Lo (Unsigned) |
Move from Extended Carry, Hi and Lo (Unsigned)
Extract extended Hi/Lo state.
GPR[rd] = LO; LO = HI; HI = ACX; ACX = 0;
The value in special register LO is written to GPR rd. The value in special register HI is then written to special register
LO, the extended accumulator bits ACX are zero-extended and copied to HI, and the extended accumulator bits ACX
are cleared
The number of ACX extended accumulator bits is implementation dependent, ranging from 8 to 64 bits.
If 64-bit operations are not available and enabled, at most the least-signiicant 32 bits of ACX will be copied to
HI, but the whole ACX ield will then be cleared.
None
newHI = zero_extend(ACX) newLO = HI GPR[rd] = LO LO = newLO HI = newHI ACX = 0
None
SPECIAL 000000 |
rs |
0 0 0000 0000 0 |
MTLHX 00001 |
MTLO 010011 |
6 |
5 |
10 |
5 |
6 |
MTLHX rs |
SmartMIPS Crypto |
Move to Lo, Hi, and Extended Carry |
Move to Lo, Hi, and Extended Carry
Set extended Hi/Lo state.
ACX = HI; HI = LO; LO = GPR[rs] ;
The value special register HI is written to the extended accumulator bits ACX. The value in special register LO is then written to special register HI, and the value in GPR rs is written to special register LO. This is the reverse of the operation of the MFLHXU instruction.
The number of ACX extended accumulator bits is implementation-dependent, ranging from 8 to 64 bits. If the HI register contains more signiicant bits than the number of implemented ACX bits, that information is discarded without raising an exception.
If 64-bit operations are not enabled, at most the least-signiicant 32 bits of HI will be copied to ACX.
None
newLO = GPR[rs] newHI = LO ACX = HIACXMSB..0 HI = newHI LO = newLO
None
SPECIAL 000000 |
rs |
rt |
0 |
MULTP 10001 |
MULTU 011001 |
6 |
5 |
5 |
5 |
5 |
6 |
MULTP rs, rt |
SmartMIPS Crypto |
Multiply Binary Polynomial Basis Word |
Multiply Binary Polynomial Basis Word
To multiply two 32-bit binary polynomial values
(LO, HI) = BinPolyMult(GPR[rs], GPR[rt])
The 32-bit word value in GPR rt is polynomial-basis multiplied by the 32-bit value in GPR rs, treating both operands as binary polynomial values, to produce a 64-bit result. The low-order 32-bit word of the result is placed into special register LO, and the high-order 32-bit word is placed into special register HI. The special register ACX is cleared.
No arithmetic exception occurs under any circumstances.
None
prod = PolyMult(GPR[rs]31..0, GPR[rt]31..0) LO = sign_extend(prod31..0) HI = sign_extend(prod63..32) ACX = 0
None
SPECIAL 000000 |
rs |
rt |
0 |
MULTU 00000 |
MULTU 011001 |
6 |
5 |
5 |
5 |
5 |
6 |
MULTU rs, rt |
SmartMIPS Crypto |
Multiply Unsigned Word |
Multiply Unsigned Word
To multiply 32-bit unsigned integers
(LO, HI) = GPR[rs] × GPR[rt]
The 32-bit word value in GPR rt is multiplied by the 32-bit value in GPR rs, treating both operands as unsigned values, to produce a 64-bit result. The low-order 32-bit word of the result is placed into special register LO, and the high-order 32-bit word is placed into special register HI. The special register ACX is cleared.
No arithmetic exception occurs under any circumstances.
None
prod = (0 || GPR[rs]31..0) × (0 || GPR[rt]31..0) LO = sign_extend(prod31..0) HI = sign_extend(prod63..32) ACX = 0
None
SPECIAL2 011100 |
rs |
rt |
0 |
PPERM 10010 |
MADDU 000001 |
6 |
5 |
5 |
5 |
5 |
6 |
PPERM rs, rt |
SmartMIPS Crypto |
Partial Permutation of Word Data into ACX-Hi-Lo Accumulator |
Partial Permutation of Word Data into ACX-Hi-Lo Accumulator
Perform a partial permutation of a 32-bit value into the ACX/Hi/Lo registers
(LO, HI, ACX) = (LO, HI, ACX) << 6 | GPR[rs] bits specified by contents of GPR[rt]
The extended accumulator formed by the ACX, HI, and LO registers is shifted left by six bits, and 32-bit word value in GPR rt is used as a permutation descriptor to select a set of six bits from GPR rs, to be written into the least significant six bits of the LO register.
The contents of the rt register are interpreted as follows:
0 |
Source of bit 5 |
Source of bit 4 |
Source of bit 3 |
Source of bit 2 |
Source of bit 1 |
Source of bit 0 |
2 |
5 |
5 |
5 |
5 |
5 |
5 |
No arithmetic exception occurs under any circumstances.
None
TEMP = ACX(ACXBITS-6)..0 || HI31..26 ACX = TEMPACXBITS..0 TEMP = HI25..0 || LO31..26 HI = sign_extend(TEMP) TEMP31...6 = LO25..0 BITSEL = GPR[rt]29..25 TEMP5 = GPR[rs]BITSEL BITSEL = GPR[rt]24..20 TEMP4 = GPR[rs]BITSEL BITSEL = GPR[rt]19..15 TEMP3 = GPR[rs]BITSEL BITSEL = GPR[rt]14..10 TEMP2 = GPR[rs]BITSEL BITSEL = GPR[rt]9..5 TEMP1 = GPR[rs]BITSEL BITSEL = GPR[rt]4..0 TEMP0 = GPR[rs]BITSEL LO = sign_extend(TEMP)
None
SPECIAL 000000 |
0000 |
R 1 |
rt |
rd |
sa |
SRL 000010 |
6 |
4 |
1 |
5 |
5 |
5 |
6 |
ROTR rd, rt, sa |
SmartMIPS Crypto |
Rotate Word Right |
Rotate Word Right
To execute a logical right-rotate of a word by a fixed number of bits
GPR[rd] = GPR[rt] ↔ (right) sa
The contents ofthe low-order 32-bit word of GPR rt are rotated right;the word resultis placed in GPR rd. The bit-rotate amount is specified by sa.
if ((ArchitectureRevision() < 2) and (Config3SM = 0)) then UNPREDICTABLE endif s = sa temp = GPR[rt]s-1..0 || GPR[rt]31..s GPR[rd] = temp
Reserved Instruction
SPECIAL 000000 |
rs |
rt |
rd |
0000 |
R 1 |
SRLV 000110 |
6 |
5 |
5 |
5 |
4 |
1 |
6 |
ROTRV rd, rt, rs |
SmartMIPS Crypto |
Rotate Word Right Variable |
Rotate Word Right Variable
To execute a logical right-rotate of a word by a variable number of bits
GPR[rd] = GPR[rt] ↔ (right) GPR[rs]
The contents ofthe low-order 32-bit word of GPR rt are rotated right;the word resultis placed in GPR rd. The bit-rotate amount is specified by the low-order 5 bits of GPR rs.
if ((ArchitectureRevision() < 2) and (Config3SM= 0)) then UNPREDICTABLE endif s = GPR[rs]4..0 temp = GPR[rt]s-1..0 || GPR[rt]31..s GPR[rd] = temp
Reserved Instruction