diff options
author | Andrew Cagney <cagney@redhat.com> | 1998-04-14 14:34:48 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 1998-04-14 14:34:48 +0000 |
commit | c0a4c3ba170e91bf93d16e0a6340980f6d62901a (patch) | |
tree | 2632698074a0ae78b8d5c070716ffee0a7ba83eb /sim/mips/mips.igen | |
parent | 7bf341f4a82e7e038d6d3861a7ce559d2bb8713f (diff) | |
download | gdb-c0a4c3ba170e91bf93d16e0a6340980f6d62901a.zip gdb-c0a4c3ba170e91bf93d16e0a6340980f6d62901a.tar.gz gdb-c0a4c3ba170e91bf93d16e0a6340980f6d62901a.tar.bz2 |
Implement 32 bit MIPS16 instructions listed in m16.igen.
Diffstat (limited to 'sim/mips/mips.igen')
-rw-r--r-- | sim/mips/mips.igen | 409 |
1 files changed, 297 insertions, 112 deletions
diff --git a/sim/mips/mips.igen b/sim/mips/mips.igen index 4a1103c..ea39430 100644 --- a/sim/mips/mips.igen +++ b/sim/mips/mips.igen @@ -78,6 +78,7 @@ // + 000000,5.RS,5.RT,5.RD,00000,100000:SPECIAL:32::ADD "add r<RD>, r<RS>, r<RT>" *mipsI,mipsII,mipsIII,mipsIV: @@ -102,6 +103,7 @@ } + 001000,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::ADDI "addi r<RT>, r<RS>, IMMEDIATE" *mipsI,mipsII,mipsIII,mipsIV: @@ -126,6 +128,13 @@ } + +:function:::void:do_addiu:int rs, int rt, unsigned16 immediate +{ + signed32 temp = GPR[rs] + EXTEND16 (immediate); + GPR[rt] = EXTEND32 (temp); +} + 001001,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::ADDIU "addu r<RT>, r<RS>, <IMMEDIATE>" *mipsI,mipsII,mipsIII,mipsIV: @@ -144,11 +153,17 @@ *tx19: // end-sanitize-tx19 { - signed32 temp = GPR[RS] + EXTEND16 (IMMEDIATE); - GPR[RT] = EXTEND32 (temp); + do_addiu (SD_, RS, RT, IMMEDIATE); } + +:function:::void:do_addu:int rs, int rt, int rd +{ + signed32 temp = GPR[rs] + GPR[rt]; + GPR[rd] = EXTEND32 (temp); +} + 000000,5.RS,5.RT,5.RD,00000,100001:SPECIAL:32::ADDU "addu r<RD>, r<RS>, r<RT>" *mipsI,mipsII,mipsIII,mipsIV: @@ -167,11 +182,16 @@ *tx19: // end-sanitize-tx19 { - signed32 temp = GPR[RS] + GPR[RT]; - GPR[RD] = EXTEND32 (temp); + do_addu (SD_, RS, RT, RD); } + +:function:::void:do_and:int rs, int rt, int rd +{ + GPR[rd] = GPR[rs] & GPR[rt]; +} + 000000,5.RS,5.RT,5.RD,00000,100100:SPECIAL:32::AND "and r<RD>, r<RS>, r<RT>" *mipsI,mipsII,mipsIII,mipsIV: @@ -190,10 +210,11 @@ *tx19: // end-sanitize-tx19 { - GPR[RD] = GPR[RS] & GPR[RT]; + do_and (SD_, RS, RT, RD); } + 001100,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::ANDI "and r<RT>, r<RS>, <IMMEDIATE>" *mipsI,mipsII,mipsIII,mipsIV: @@ -216,6 +237,7 @@ } + 000100,5.RS,5.RT,16.OFFSET:NORMAL:32::BEQ "beq r<RS>, r<RT>, <OFFSET>" *mipsI,mipsII,mipsIII,mipsIV: @@ -240,6 +262,7 @@ } + 010100,5.RS,5.RT,16.OFFSET:NORMAL:32::BEQL "beql r<RS>, r<RT>, <OFFSET>" *mipsII: @@ -268,6 +291,7 @@ } + 000001,5.RS,00001,16.OFFSET:REGIMM:32::BGEZ "bgez r<RS>, <OFFSET>" *mipsI,mipsII,mipsIII,mipsIV: @@ -292,6 +316,7 @@ } + 000001,5.RS!31,10001,16.OFFSET:REGIMM:32::BGEZAL "bgezal r<RS>, <OFFSET>" *mipsI,mipsII,mipsIII,mipsIV: @@ -317,6 +342,7 @@ } + 000001,5.RS!31,10011,16.OFFSET:REGIMM:32::BGEZALL "bgezall r<RS>, <OFFSET>" *mipsII: @@ -348,6 +374,7 @@ } + 000001,5.RS,00011,16.OFFSET:REGIMM:32::BGEZL "bgezl r<RS>, <OFFSET>" *mipsII: @@ -376,6 +403,7 @@ } + 000111,5.RS,00000,16.OFFSET:NORMAL:32::BGTZ "bgtz r<RS>, <OFFSET>" *mipsI,mipsII,mipsIII,mipsIV: @@ -400,6 +428,7 @@ } + 010111,5.RS,00000,16.OFFSET:NORMAL:32::BGTZL "bgtzl r<RS>, <OFFSET>" *mipsII: @@ -430,6 +459,7 @@ } + 000110,5.RS,00000,16.OFFSET:NORMAL:32::BLEZ "blez r<RS>, <OFFSET>" *mipsI,mipsII,mipsIII,mipsIV: @@ -456,6 +486,7 @@ } + 010110,5.RS,00000,16.OFFSET:NORMAL:32::BLEZL "bgezl r<RS>, <OFFSET>" *mipsII: @@ -484,6 +515,7 @@ } + 000001,5.RS,00000,16.OFFSET:REGIMM:32::BLTZ "bltz r<RS>, <OFFSET>" *mipsI,mipsII,mipsIII,mipsIV: @@ -508,6 +540,7 @@ } + 000001,5.RS!31,10000,16.OFFSET:REGIMM:32::BLTZAL "bltzal r<RS>, <OFFSET>" *mipsI,mipsII,mipsIII,mipsIV: @@ -535,6 +568,7 @@ } + 000001,5.RS!31,10010,16.OFFSET:REGIMM:32::BLTZALL "bltzall r<RS>, <OFFSET>" *mipsII: @@ -564,6 +598,7 @@ } + 000001,5.RS,00010,16.OFFSET:REGIMM:32::BLTZL "bltzl r<RS>, <OFFSET>" *mipsII: @@ -594,6 +629,7 @@ } + 000101,5.RS,5.RT,16.OFFSET:NORMAL:32::BNE "bne r<RS>, r<RT>, <OFFSET>" *mipsI,mipsII,mipsIII,mipsIV: @@ -618,6 +654,7 @@ } + 010101,5.RS,5.RT,16.OFFSET:NORMAL:32::BNEL "bnel r<RS>, r<RT>, <OFFSET>" *mipsII: @@ -646,6 +683,7 @@ } + 000000,20.CODE,001101:SPECIAL:32::BREAK "break" *mipsI,mipsII,mipsIII,mipsIV: @@ -668,6 +706,7 @@ } + 0100,ZZ!0!1!3,26.COP_FUN:NORMAL:32::COPz "cop<ZZ> <COP_FUN>" *mipsI,mipsII,mipsIII,mipsIV: @@ -683,6 +722,7 @@ } + 000000,5.RS,5.RT,5.RD,00000,101100:SPECIAL:64::DADD "dadd r<RD>, r<RS>, r<RT>" *mipsIII: @@ -708,6 +748,7 @@ } + 011000,5.RS,5.RT,16.IMMEDIATE:NORMAL:64::DADDI "daddi r<RT>, r<RS>, <IMMEDIATE>" *mipsIII: @@ -732,6 +773,12 @@ } + +:function:64::void:do_daddiu:int rs, int rt, unsigned16 immediate +{ + GPR[rt] = GPR[rs] + EXTEND16 (immediate); +} + 011001,5.RS,5.RT,16.IMMEDIATE:NORMAL:64::DADDIU "daddu r<RT>, r<RS>, <IMMEDIATE>" *mipsIII: @@ -750,10 +797,16 @@ *tx19: // end-sanitize-tx19 { - GPR[RT] = GPR[RS] + EXTEND16 (IMMEDIATE); + do_daddiu (SD_, RS, RT, IMMEDIATE); } + +:function:::void:do_daddu:int rs, int rt, int rd +{ + GPR[rd] = GPR[rs] + GPR[rt]; +} + 000000,5.RS,5.RT,5.RD,00000,101101:SPECIAL:64::DADDU "daddu r<RD>, r<RS>, r<RT>" *mipsIII: @@ -772,32 +825,17 @@ *tx19: // end-sanitize-tx19 { - GPR[RD] = GPR[RS] + GPR[RT]; + do_daddu (SD_, RS, RT, RD); } -000000,5.RS,5.RT,0000000000011110:SPECIAL:64::DDIV -"ddiv r<RS>, r<RT>" -*mipsIII: -*mipsIV: -*vr5000: -// start-sanitize-vr4320 -*vr4320: -// end-sanitize-vr4320 -// start-sanitize-vr5400 -*vr5400: -// end-sanitize-vr5400 -// start-sanitize-r5900 -*r5900: -// end-sanitize-r5900 -// start-sanitize-tx19 -*tx19: -// end-sanitize-tx19 + +:function:64::void:do_ddiv:int rs, int rt { CHECKHILO ("Division"); { - signed64 n = GPR[RS]; - signed64 d = GPR[RT]; + signed64 n = GPR[rs]; + signed64 d = GPR[rt]; if (d == 0) { LO = SIGNED64 (0x8000000000000000); @@ -816,10 +854,8 @@ } } - - -000000,5.RS,5.RT,0000000000,011111:SPECIAL:64::DDIVU -"ddivu r<RS>, r<RT>" +000000,5.RS,5.RT,0000000000011110:SPECIAL:64::DDIV +"ddiv r<RS>, r<RT>" *mipsIII: *mipsIV: *vr5000: @@ -829,14 +865,24 @@ // start-sanitize-vr5400 *vr5400: // end-sanitize-vr5400 +// start-sanitize-r5900 +*r5900: +// end-sanitize-r5900 // start-sanitize-tx19 *tx19: // end-sanitize-tx19 { + do_ddiv (SD_, RS, RT); +} + + + +:function:64::void:do_ddivu:int rs, int rt +{ CHECKHILO ("Division"); { - unsigned64 n = GPR[RS]; - unsigned64 d = GPR[RT]; + unsigned64 n = GPR[rs]; + unsigned64 d = GPR[rt]; if (d == 0) { LO = SIGNED64 (0x8000000000000000); @@ -850,10 +896,10 @@ } } - -000000,5.RS,5.RT,0000000000011010:SPECIAL:32::DIV -"div r<RS>, r<RT>" -*mipsI,mipsII,mipsIII,mipsIV: +000000,5.RS,5.RT,0000000000,011111:SPECIAL:64::DDIVU +"ddivu r<RS>, r<RT>" +*mipsIII: +*mipsIV: *vr5000: // start-sanitize-vr4320 *vr4320: @@ -861,18 +907,21 @@ // start-sanitize-vr5400 *vr5400: // end-sanitize-vr5400 -// start-sanitize-r5900 -*r5900: -// end-sanitize-r5900 -*r3900: // start-sanitize-tx19 *tx19: // end-sanitize-tx19 { + do_ddivu (SD_, RS, RT); +} + + + +:function:::void:do_div:int rs, int rt +{ CHECKHILO("Division"); { - signed32 n = GPR[RS]; - signed32 d = GPR[RT]; + signed32 n = GPR[rs]; + signed32 d = GPR[rt]; if (d == 0) { LO = EXTEND32 (0x80000000); @@ -891,9 +940,8 @@ } } - -000000,5.RS,5.RT,0000000000011011:SPECIAL:32::DIVU -"divu r<RS>, r<RT>" +000000,5.RS,5.RT,0000000000011010:SPECIAL:32::DIV +"div r<RS>, r<RT>" *mipsI,mipsII,mipsIII,mipsIV: *vr5000: // start-sanitize-vr4320 @@ -910,10 +958,17 @@ *tx19: // end-sanitize-tx19 { + do_div (SD_, RS, RT); +} + + + +:function:::void:do_divu:int rs, int rt +{ CHECKHILO ("Division"); { - unsigned32 n = GPR[RS]; - unsigned32 d = GPR[RT]; + unsigned32 n = GPR[rs]; + unsigned32 d = GPR[rt]; if (d == 0) { LO = EXTEND32 (0x80000000); @@ -927,8 +982,30 @@ } } +000000,5.RS,5.RT,0000000000011011:SPECIAL:32::DIVU +"divu r<RS>, r<RT>" +*mipsI,mipsII,mipsIII,mipsIV: +*vr5000: +// start-sanitize-vr4320 +*vr4320: +// end-sanitize-vr4320 +// start-sanitize-vr5400 +*vr5400: +// end-sanitize-vr5400 +// start-sanitize-r5900 +*r5900: +// end-sanitize-r5900 +*r3900: +// start-sanitize-tx19 +*tx19: +// end-sanitize-tx19 +{ + do_divu (SD_, RS, RT); +} + -:function:::void:do_dmult:int rs, int rt, int rd, int signed_p + +:function:::void:do_dmultx:int rs, int rt, int rd, int signed_p { unsigned64 lo; unsigned64 hi; @@ -986,6 +1063,10 @@ GPR[rd] = lo; } +:function:::void:do_dmult:int rs, int rt, int rd +{ + do_dmultx (SD_, rs, rt, rd, 1); +} 000000,5.RS,5.RT,0000000000011100:SPECIAL:64::DMULT "dmult r<RS>, r<RT>" @@ -997,7 +1078,7 @@ *vr4320: // end-sanitize-vr4320 { - do_dmult (SD_, RS, RT, 0, 1); + do_dmult (SD_, RS, RT, 0); } 000000,5.RS,5.RT,5.RD,00000011100:SPECIAL:64::DMULT @@ -1008,11 +1089,16 @@ *vr5400: // end-sanitize-vr5400 { - do_dmult (SD_, RS, RT, RD, 1); + do_dmult (SD_, RS, RT, RD); } +:function:::void:do_dmultu:int rs, int rt, int rd +{ + do_dmultx (SD_, rs, rt, rd, 0); +} + 000000,5.RS,5.RT,0000000000011101:SPECIAL:64::DMULTU "dmultu r<RS>, r<RT>" *mipsIII,mipsIV: @@ -1023,7 +1109,7 @@ *vr4320: // end-sanitize-vr4320 { - do_dmult (SD_, RS, RT, 0, 0); + do_dmultu (SD_, RS, RT, 0); } 000000,5.RS,5.RT,5.RD,00000011101:SPECIAL:64::DMULTU @@ -1034,7 +1120,7 @@ *vr5400: // end-sanitize-vr5400 { - do_dmult (SD_, RS, RT, RD, 0); + do_dmultu (SD_, RS, RT, RD); } @@ -1085,6 +1171,7 @@ } + 000000,5.RS,5.RT,5.RD,00000010100:SPECIAL:64::DSLLV "dsllv r<RD>, r<RT>, r<RS>" *mipsIII: @@ -1108,6 +1195,7 @@ } + 00000000000,5.RT,5.RD,5.SHIFT,111011:SPECIAL:64::DSRA "dsra r<RD>, r<RT>, <SHIFT>" *mipsIII: @@ -1154,6 +1242,12 @@ } +:function:::void:do_srav:int rs, int rt, int rd +{ + int s = MASKED64 (GPR[rs], 5, 0); + GPR[rd] = ((signed64) GPR[rt]) >> s; +} + 000000,5.RS,5.RT,5.RD,00000010111:SPECIAL:64::DSRAV "dsra32 r<RT>, r<RD>, r<RS>" *mipsIII: @@ -1172,8 +1266,7 @@ *tx19: // end-sanitize-tx19 { - int s = MASKED64 (GPR[RS], 5, 0); - GPR[RD] = ((signed64) GPR[RT]) >> s; + do_srav (SD_, RS, RT, RD); } @@ -1270,6 +1363,11 @@ } +:function:::void:do_dsubu:int rs, int rt, int rd +{ + GPR[rd] = GPR[rs] - GPR[rt]; +} + 000000,5.RS,5.RT,5.RD,00000101111:SPECIAL:64::DSUBU "dsubu r<RD>, r<RS>, r<RT>" *mipsIII: @@ -1288,7 +1386,7 @@ *tx19: // end-sanitize-tx19 { - GPR[RD] = GPR[RS] - GPR[RT]; + do_dsubu (SD_, RS, RT, RD); } @@ -1883,6 +1981,14 @@ } +:function:::void:do_mfhi:int rd +{ + GPR[rd] = HI; +#if 0 + HIACCESS = 3; +#endif +} + 000000,0000000000,5.RD,00000,010000:SPECIAL:32::MFHI "mfhi r<RD>" *mipsI,mipsII,mipsIII,mipsIV: @@ -1901,13 +2007,19 @@ *tx19: // end-sanitize-tx19 { - GPR[RD] = HI; + do_mfhi (SD_, RD); +} + + + +:function:::void:do_mflo:int rd +{ + GPR[rd] = LO; #if 0 - HIACCESS = 3; + LOACCESS = 3; /* 3rd instruction will be safe */ #endif } - 000000,0000000000,5.RD,00000,010010:SPECIAL:32::MFLO "mflo r<RD>" *mipsI,mipsII,mipsIII,mipsIV: @@ -1926,13 +2038,11 @@ *tx19: // end-sanitize-tx19 { - GPR[RD] = LO; -#if 0 - LOACCESS = 3; /* 3rd instruction will be safe */ -#endif + do_mflo (SD_, RD); } + 000000,5.RS,5.RT,5.RD,00000001011:SPECIAL:32::MOVN "movn r<RD>, r<RS>, r<RT>" *mipsIV: @@ -1952,6 +2062,7 @@ } + 000000,5.RS,5.RT,5.RD,00000001010:SPECIAL:32::MOVZ "movz r<RD>, r<RS>, r<RT>" *mipsIV: @@ -1971,6 +2082,7 @@ } + 000000,5.RS,000000000000000,010001:SPECIAL:32::MTHI "mthi r<RS>" *mipsI,mipsII,mipsIII,mipsIV: @@ -2000,6 +2112,7 @@ } + 000000,5.RS,000000000000000010011:SPECIAL:32::MTLO "mtlo r<RS>" *mipsI,mipsII,mipsIII,mipsIV: @@ -2029,6 +2142,19 @@ } + +:function:::void:do_mult:int rs, int rt, int rd +{ + signed64 prod; + CHECKHILO ("Multiplication"); + prod = (((signed64)(signed32) GPR[rs]) + * ((signed64)(signed32) GPR[rt])); + LO = EXTEND32 (VL4_8 (prod)); + HI = EXTEND32 (VH4_8 (prod)); + if (rd != 0) + GPR[rd] = LO; +} + 000000,5.RS,5.RT,00000,00000011000:SPECIAL:32::MULT "mult r<RS>, r<RT>" *mipsI,mipsII,mipsIII,mipsIV: @@ -2036,12 +2162,7 @@ *vr4320: // end-sanitize-vr4320 { - signed64 prod; - CHECKHILO ("Multiplication"); - prod = (((signed64)(signed32) GPR[RS]) - * ((signed64)(signed32) GPR[RT])); - LO = EXTEND32 (VL4_8 (prod)); - HI = EXTEND32 (VH4_8 (prod)); + do_mult (SD_, RS, RT, 0); } @@ -2059,17 +2180,22 @@ *tx19: // end-sanitize-tx19 { - signed64 prod; + do_mult (SD_, RS, RT, RD); +} + + +:function:::void:do_multu:int rs, int rt, int rd +{ + unsigned64 prod; CHECKHILO ("Multiplication"); - prod = (((signed64)(signed32) GPR[RS]) - * ((signed64)(signed32) GPR[RT])); + prod = (((unsigned64)(unsigned32) GPR[rs]) + * ((unsigned64)(unsigned32) GPR[rt])); LO = EXTEND32 (VL4_8 (prod)); HI = EXTEND32 (VH4_8 (prod)); - if (RD != 0) - GPR[RD] = LO; + if (rd != 0) + GPR[rd] = LO; } - 000000,5.RS,5.RT,00000,00000011001:SPECIAL:32::MULTU "multu r<RS>, r<RT>" *mipsI,mipsII,mipsIII,mipsIV: @@ -2077,13 +2203,9 @@ *vr4320: // end-sanitize-vr4320 { - unsigned64 prod; - CHECKHILO ("Multiplication"); - prod = (((unsigned64)(unsigned32) GPR[RS]) - * ((unsigned64)(unsigned32) GPR[RT])); - LO = EXTEND32 (VL4_8 (prod)); - HI = EXTEND32 (VH4_8 (prod)); + do_multu (SD_, RS, RT, 0); } + 000000,5.RS,5.RT,5.RD,00000011001:SPECIAL:32::MULTU "multu r<RD>, r<RS>, r<RT>" *vr5000: @@ -2098,17 +2220,15 @@ *tx19: // end-sanitize-tx19 { - unsigned64 prod; - CHECKHILO ("Multiplication"); - prod = (((unsigned64)(unsigned32) GPR[RS]) - * ((unsigned64)(unsigned32) GPR[RT])); - LO = EXTEND32 (VL4_8 (prod)); - HI = EXTEND32 (VH4_8 (prod)); - if (RD != 0) - GPR[RD] = LO; + do_multu (SD_, RS, RT, 0); } +:function:::void:do_nor:int rs, int rt, int rd +{ + GPR[rd] = ~ (GPR[rs] | GPR[rt]); +} + 000000,5.RS,5.RT,5.RD,00000,100111:SPECIAL:32::NOR "nor r<RD>, r<RS>, r<RT>" *mipsI,mipsII,mipsIII,mipsIV: @@ -2127,10 +2247,15 @@ *tx19: // end-sanitize-tx19 { - GPR[RD] = ~ (GPR[RS] | GPR[RT]); + do_nor (SD_, RS, RT, RD); } +:function:::void:do_or:int rs, int rt, int rd +{ + GPR[rd] = (GPR[rs] | GPR[rt]); +} + 000000,5.RS,5.RT,5.RD,00000,100101:SPECIAL:32::OR "or r<RD>, r<RS>, r<RT>" *mipsI,mipsII,mipsIII,mipsIV: @@ -2149,7 +2274,7 @@ *tx19: // end-sanitize-tx19 { - GPR[RD] = (GPR[RS] | GPR[RT]); + do_or (SD_, RS, RT, RD); } @@ -2455,6 +2580,12 @@ } +:function:::void:do_sll:int rt, int rd, int shift +{ + unsigned32 temp = (GPR[rt] << shift); + GPR[rd] = EXTEND32 (temp); +} + 00000000000,5.RT,5.RD,5.SHIFT,000000:SPECIAL:32::SLL "sll r<RD>, r<RT>, <SHIFT>" *mipsI,mipsII,mipsIII,mipsIV: @@ -2473,12 +2604,17 @@ *tx19: // end-sanitize-tx19 { - int s = SHIFT; - unsigned32 temp = (GPR[RT] << s); - GPR[RD] = EXTEND32 (temp); + do_sll (SD_, RT, RD, SHIFT); } +:function:::void:do_sllv:int rs, int rt, int rd +{ + int s = MASKED (GPR[rs], 4, 0); + unsigned32 temp = (GPR[rt] << s); + GPR[rd] = EXTEND32 (temp); +} + 000000,5.RS,5.RT,5.RD,00000000100:SPECIAL:32::SLLV "sllv r<RD>, r<RT>, r<RS>" *mipsI,mipsII,mipsIII,mipsIV: @@ -2497,12 +2633,15 @@ *tx19: // end-sanitize-tx19 { - int s = MASKED (GPR[RS], 4, 0); - unsigned32 temp = (GPR[RT] << s); - GPR[RD] = EXTEND32 (temp); + do_sllv (SD_, RS, RT, RD); } +:function:::void:do_slt:int rs, int rt, int rd +{ + GPR[rd] = ((signed_word) GPR[rs] < (signed_word) GPR[rt]); +} + 000000,5.RS,5.RT,5.RD,00000101010:SPECIAL:32::SLT "slt r<RD>, r<RS>, r<RT>" *mipsI,mipsII,mipsIII,mipsIV: @@ -2521,10 +2660,15 @@ *tx19: // end-sanitize-tx19 { - GPR[RD] = ((signed_word) GPR[RS] < (signed_word) GPR[RT]); + do_slt (SD_, RS, RT, RD); } +:function:::void:do_slti:int rs, int rt, unsigned16 immediate +{ + GPR[rt] = ((signed_word) GPR[rs] < (signed_word) EXTEND16 (immediate)); +} + 001010,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::SLTI "slti r<RT>, r<RS>, <IMMEDIATE>" *mipsI,mipsII,mipsIII,mipsIV: @@ -2543,10 +2687,15 @@ *tx19: // end-sanitize-tx19 { - GPR[RT] = ((signed_word) GPR[RS] < (signed_word) EXTEND16 (IMMEDIATE)); + do_slti (SD_, RS, RT, IMMEDIATE); } +:function:::void:do_sltiu:int rs, int rt, unsigned16 immediate +{ + GPR[rt] = ((unsigned_word) GPR[rs] < (unsigned_word) EXTEND16 (immediate)); +} + 001011,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::SLTIU "sltiu r<RT>, r<RS>, <IMMEDIATE>" *mipsI,mipsII,mipsIII,mipsIV: @@ -2565,7 +2714,14 @@ *tx19: // end-sanitize-tx19 { - GPR[RT] = ((unsigned_word) GPR[RS] < (unsigned_word) EXTEND16 (IMMEDIATE)); + do_sltiu (SD_, RS, RT, IMMEDIATE); +} + + + +:function:::void:do_sltu:int rs, int rt, int rd +{ + GPR[rd] = ((unsigned_word) GPR[rs] < (unsigned_word) GPR[rt]); } 000000,5.RS,5.RT,5.RD,00000101011:SPECIAL:32::SLTU @@ -2586,10 +2742,16 @@ *tx19: // end-sanitize-tx19 { - GPR[RD] = ((unsigned_word) GPR[RS] < (unsigned_word) GPR[RT]); + do_sltiu (SD_, RS, RT, RD); } +:function:::void:do_sra:int rt, int rd, int shift +{ + signed32 temp = (signed32) GPR[rt] >> shift; + GPR[rd] = EXTEND32 (temp); +} + 000000,00000,5.RT,5.RD,5.SHIFT,000011:SPECIAL:32::SRA "sra r<RD>, r<RT>, <SHIFT>" *mipsI,mipsII,mipsIII,mipsIV: @@ -2608,9 +2770,7 @@ *tx19: // end-sanitize-tx19 { - int s = SHIFT; - signed32 temp = (signed32) GPR[RT] >> s; - GPR[RD] = EXTEND32 (temp); + do_sra (SD_, RT, RD, SHIFT); } @@ -2638,6 +2798,12 @@ } +:function:::void:do_srl:int rt, int rd, int shift +{ + unsigned32 temp = (unsigned32) GPR[rt] >> shift; + GPR[rd] = EXTEND32 (temp); +} + 000000,00000,5.RT,5.RD,5.SHIFT,000010:SPECIAL:32::SRL "srl r<RD>, r<RT>, <SHIFT>" *mipsI,mipsII,mipsIII,mipsIV: @@ -2656,12 +2822,17 @@ *tx19: // end-sanitize-tx19 { - int s = SHIFT; - unsigned32 temp = (unsigned32) GPR[RT] >> s; - GPR[RD] = EXTEND32 (temp); + do_srl (SD_, RT, RD, SHIFT); } +:function:::void:do_srlv:int rs, int rt, int rd +{ + int s = MASKED (GPR[rs], 4, 0); + unsigned32 temp = (unsigned32) GPR[rt] >> s; + GPR[rd] = EXTEND32 (temp); +} + 000000,5.RS,5.RT,5.RD,00000000110:SPECIAL:32::SRLV "srlv r<RD>, r<RT>, r<RS>" *mipsI,mipsII,mipsIII,mipsIV: @@ -2680,9 +2851,7 @@ *tx19: // end-sanitize-tx19 { - int s = MASKED (GPR[RS], 4, 0); - unsigned32 temp = (unsigned32) GPR[RT] >> s; - GPR[RD] = EXTEND32 (temp); + do_srlv (SD_, RS, RT, RD); } @@ -2710,6 +2879,12 @@ } +:function:::void:do_subu:int rs, int rt, int rd +{ + signed32 temp = GPR[rs] - GPR[rt]; + GPR[rd] = EXTEND32 (temp); +} + 000000,5.RS,5.RT,5.RD,00000100011:SPECIAL:32::SUBU "subu r<RD>, r<RS>, r<RT>" *mipsI,mipsII,mipsIII,mipsIV: @@ -2728,7 +2903,7 @@ *tx19: // end-sanitize-tx19 { - GPR[RD] = EXTEND32 (GPR[RS] - GPR[RT]); + do_subu (SD_, RS, RT, RD); } @@ -3199,6 +3374,11 @@ } +:function:::void:do_xor:int rs, int rt, int rd +{ + GPR[rd] = GPR[rs] ^ GPR[rt]; +} + 000000,5.RS,5.RT,5.RD,00000100110:SPECIAL:32::XOR "xor r<RD>, r<RS>, r<RT>" *mipsI,mipsII,mipsIII,mipsIV: @@ -3217,10 +3397,15 @@ *tx19: // end-sanitize-tx19 { - GPR[RD] = GPR[RS] ^ GPR[RT]; + do_xor (SD_, RS, RT, RD); } +:function:::void:do_xori:int rs, int rt, unsigned16 immediate +{ + GPR[rt] = GPR[rs] ^ immediate; +} + 001110,5.RS,5.RT,16.IMMEDIATE:NORMAL:32::XORI "xori r<RT>, r<RS>, <IMMEDIATE>" *mipsI,mipsII,mipsIII,mipsIV: @@ -3239,7 +3424,7 @@ *tx19: // end-sanitize-tx19 { - GPR[RT] = GPR[RS] ^ IMMEDIATE; + do_xori (SD_, RS, RT, IMMEDIATE); } |