From: Andrew Cagney Date: Wed, 15 Apr 1998 14:04:01 +0000 (+0000) Subject: Re-fix 32 bit DSRAV instruction. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=74025eeea7d79d807ac403e680876a32b6ea87e3;p=binutils-gdb.git Re-fix 32 bit DSRAV instruction. Fix mips16 BRANCH, unsigned ADD/SUB and SRAV instructions. --- diff --git a/sim/mips/ChangeLog b/sim/mips/ChangeLog index 6c736d65520..1c74f4d45c1 100644 --- a/sim/mips/ChangeLog +++ b/sim/mips/ChangeLog @@ -1,3 +1,13 @@ +Wed Apr 15 18:31:54 1998 Andrew Cagney + + * mips.igen (DSRAV): Use function do_dsrav. + (SRAV): Use new function do_srav. + + * m16.igen (BEQZ, BNEZ): Compare GPR[TRX] not GPR[RX]. + (B): Sign extend 11 bit immediate. + (EXT-B*): Shift 16 bit immediate left by 1. + (ADDIU*): Don't sign extend immediate value. + Wed Apr 15 10:32:15 1998 Andrew Cagney * m16run.c (sim_engine_run): Restore CIA after handling an event. diff --git a/sim/mips/mips.igen b/sim/mips/mips.igen index b893e8aebe7..7b4102c7daa 100644 --- a/sim/mips/mips.igen +++ b/sim/mips/mips.igen @@ -1287,7 +1287,7 @@ } -:function:::void:do_srav:int rs, int rt, int rd +:function:::void:do_dsrav:int rs, int rt, int rd { int s = MASKED64 (GPR[rs], 5, 0); TRACE_ALU_INPUT2 (GPR[rt], s); @@ -1313,12 +1313,12 @@ *tx19: // end-sanitize-tx19 { - do_srav (SD_, RS, RT, RD); + do_dsrav (SD_, RS, RT, RD); } 00000000000,5.RT,5.RD,5.SHIFT,111010:SPECIAL:64::DSRL -"dsrav r, r, " +"dsrl r, r, " *mipsIII: *mipsIV: *vr5000: @@ -2857,6 +2857,16 @@ } + +:function:::void:do_srav:int rs, int rt, int rd +{ + int s = MASKED (GPR[rs], 4, 0); + signed32 temp = (signed32) GPR[rt] >> s; + TRACE_ALU_INPUT2 (GPR[rt], s); + GPR[rd] = EXTEND32 (temp); + TRACE_ALU_RESULT (GPR[rd]); +} + 000000,5.RS,5.RT,5.RD,00000000111:SPECIAL:32::SRAV "srav r, r, r" *mipsI,mipsII,mipsIII,mipsIV: @@ -2875,12 +2885,11 @@ *tx19: // end-sanitize-tx19 { - int s = MASKED (GPR[RS], 4, 0); - signed32 temp = (signed32) GPR[RT] >> s; - GPR[RD] = EXTEND32 (temp); + do_srav (SD_, RS, RT, RD); } + :function:::void:do_srl:int rt, int rd, int shift { unsigned32 temp = (unsigned32) GPR[rt] >> shift;