aboutsummaryrefslogtreecommitdiff
path: root/sim/sh/gencode.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@tuliptree.org>1995-11-29 20:41:46 +0000
committerJim Wilson <wilson@tuliptree.org>1995-11-29 20:41:46 +0000
commit9dfb65e66194759d72c45f61afb839aad60c6bcf (patch)
treefc1cd0122b9082462aa21574977398db88c90150 /sim/sh/gencode.c
parent3dbf33eeb425669fe2e4240e2038f77c6c2f241d (diff)
downloadgdb-9dfb65e66194759d72c45f61afb839aad60c6bcf.zip
gdb-9dfb65e66194759d72c45f61afb839aad60c6bcf.tar.gz
gdb-9dfb65e66194759d72c45f61afb839aad60c6bcf.tar.bz2
* gencode.c (tab): In shad/shld definitions, negate R[m] before
the and operation instead of after. For shad delete cast. For shld use UR instead of R and delete cast.
Diffstat (limited to 'sim/sh/gencode.c')
-rw-r--r--sim/sh/gencode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sim/sh/gencode.c b/sim/sh/gencode.c
index 7c7f426..acba02a 100644
--- a/sim/sh/gencode.c
+++ b/sim/sh/gencode.c
@@ -149,12 +149,12 @@ op tab[] =
{"n","n","rotr <REG_N>", "0100nnnn00000101", "T=R[n]&1;R[n] = UR[n]>> 1;R[n]|=(T<<31);"},
{"","","rte", "0000000000101011",
"{ int tmp = PC; PC=RLAT(R[15])+2;R[15]+=4;SET_SR(RLAT(R[15]) & 0x3f3);R[15]+=4;SL(tmp+2);}"},
- {"","","rts", "0000000000001011", "ult=PC;PC=PR;SL(ult+2);"},
+ {"","","rts", "0000000000001011", "ult=PC;PC=PR-2;SL(ult+2);"},
{"","","sett", "0000000000011000", "T=1;"},
{"n","mn","shad <REG_M>,<REG_N>", "0100nnnnmmmm1100",
- "R[n] = (R[m] < 0) ? (((int)R[n]) >> -(R[m]&0x1f) ): (R[n] << ((R[m]) & 0x1f)) ;"},
+ "R[n] = (R[m] < 0) ? (R[n] >> ((-R[m])&0x1f)) : (R[n] << (R[m] & 0x1f));"},
{"n","mn","shld <REG_M>,<REG_N>", "0100nnnnmmmm1101",
- "R[n] = (R[m] < 0) ? (((unsigned int)R[n]) >> -(R[m]&0x1f) ): (R[n] << ((R[m]) & 0x1f)) ;"},
+ "R[n] = (R[m] < 0) ? (UR[n] >> ((-R[m])&0x1f)): (R[n] << (R[m] & 0x1f));"},
{"n","n","shal <REG_N>", "0100nnnn00100000", "T=R[n]<0; R[n]<<=1;"},
{"n","n","shar <REG_N>", "0100nnnn00100001", "T=R[n]&1; R[n] = R[n] >> 1;"},
{"n","n","shll <REG_N>", "0100nnnn00000000", "T=R[n]<0; R[n]<<=1;"},
@@ -227,7 +227,7 @@ op tab[] =
{"", "", "fabs <FREG_N>", "1111nnnn01011101", "F[n] = fabs (F[n]);"},
{"", "", "fsqrt <FREG_N>", "1111nnnn01101101", "F[n] = sqrt (F[n]);"},
{"", "", "float FPUL,<FREG_N>", "1111nnnn00101101", "F[n] = (float)FPUL;"},
- {"", "", "ftrc <FREG_N>, FPUL", "1111nnnn00111101", "FPUL = (int)F[n];"},
+ {"", "", "ftrc <FREG_N>, FPUL", "1111nnnn00111101", "if (F[n] != F[n]) /* NaN */ FPUL = 0x80000000; else FPUL = (int)F[n];"},
{"", "", "ftst/nan <FREG_N>", "1111nnnn01111101", "T = isnan (F[n]);"},
{"", "", "fsts FPUL,<FREG_N>", "1111nnnn00001101", "*(int *)buf = FPUL; F[n] = *(float *)buf;"},
{"", "", "flds <FREG_N>,FPUL", "1111nnnn00011101", "*(float *)buf = F[n]; FPUL = *(int *)buf;"},