diff options
Diffstat (limited to 'sim/mips/gencode.c')
-rw-r--r-- | sim/mips/gencode.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/sim/mips/gencode.c b/sim/mips/gencode.c index f5221ae..d2ca749 100644 --- a/sim/mips/gencode.c +++ b/sim/mips/gencode.c @@ -2266,12 +2266,12 @@ build_instruction (doisa, features, mips16, insn) printf(" %sword64 d2 = op2;\n", (boolU ? "u" : "")); printf(" if (d2 == 0)\n"); printf(" {\n"); - printf(" LO%s = 0x8000000000000000LL;\n", pipe); + printf(" LO%s = SIGNED64 (0x8000000000000000);\n", pipe); printf(" HI%s = 0;\n", pipe); printf(" }\n"); - printf(" else if (d2 == -1 && d1 == 0x8000000000000000LL)\n"); + printf(" else if (d2 == -1 && d1 == SIGNED64 (0x8000000000000000))\n"); printf(" {\n"); - printf(" LO%s = 0x8000000000000000LL;\n", pipe); + printf(" LO%s = SIGNED64 (0x8000000000000000);\n", pipe); printf(" HI%s = 0;\n", pipe); printf(" }\n"); printf(" else\n"); @@ -3936,19 +3936,16 @@ build_instruction (doisa, features, mips16, insn) printf(" definition on page B-113 */\n"); printf(" signed64 t = ((unsigned64)HI_UW(0) << 32) | (unsigned64)LO_UW(0);\n"); printf(" signed64 u = ((unsigned64)HI_UW(2) << 32) | (unsigned64)LO_UW(2);\n"); - printf(" signed64 x000000007FFFFFFF = LSMASK64 (31);\n"); - printf(" signed64 x0000000080000000 = x000000007FFFFFFF + 1;\n"); - printf(" signed64 minus0000000080000000 = -x0000000080000000;\n"); - printf(" if ( t > x000000007FFFFFFF )\n"); - printf(" GPR_SD(destreg,0) = x000000007FFFFFFF;\n"); - printf(" else if ( t < minus0000000080000000 )\n"); - printf(" GPR_SD(destreg,0) = minus0000000080000000;\n"); + printf(" if ( t > SIGNED64 (0x000000007FFFFFFF) )\n"); + printf(" GPR_SD(destreg,0) = SIGNED64 (0x000000007FFFFFFF);\n"); + printf(" else if ( t < - SIGNED64 (0x0000000080000000) )\n"); + printf(" GPR_SD(destreg,0) = - SIGNED64 (0x0000000080000000);\n"); printf(" else\n"); printf(" GPR_SD(destreg,0) = t;\n"); - printf(" if ( u > x000000007FFFFFFF )\n"); - printf(" GPR_SD(destreg,1) = x000000007FFFFFFF;\n"); - printf(" else if ( u < minus0000000080000000 )\n"); - printf(" GPR_SD(destreg,1) = minus0000000080000000;\n"); + printf(" if ( u > SIGNED64 (0x000000007FFFFFFF) )\n"); + printf(" GPR_SD(destreg,1) = SIGNED64 (0x000000007FFFFFFF);\n"); + printf(" else if ( u < - SIGNED64 (0x0000000080000000) )\n"); + printf(" GPR_SD(destreg,1) = - SIGNED64 (0x0000000080000000);\n"); printf(" else\n"); printf(" GPR_SD(destreg,1) = u;\n"); printf(" }\n"); |