aboutsummaryrefslogtreecommitdiff
path: root/sim/sh/gencode.c
diff options
context:
space:
mode:
authorJoern Rennecke <joern.rennecke@embecosm.com>2004-08-18 11:47:15 +0000
committerJoern Rennecke <joern.rennecke@embecosm.com>2004-08-18 11:47:15 +0000
commita134f341e6c8cac4514564d526d3251adf5bafad (patch)
tree96880b3005bcb81a9ea65e2810cb41f42fea7373 /sim/sh/gencode.c
parentc09bdfe5c9896f7197a7fe5e504ff384b147908b (diff)
downloadgdb-a134f341e6c8cac4514564d526d3251adf5bafad.zip
gdb-a134f341e6c8cac4514564d526d3251adf5bafad.tar.gz
gdb-a134f341e6c8cac4514564d526d3251adf5bafad.tar.bz2
* gencode.c (tab): For shad snd shld, fix result for
(op1 < 0 && shift_amount == 0).
Diffstat (limited to 'sim/sh/gencode.c')
-rw-r--r--sim/sh/gencode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sim/sh/gencode.c b/sim/sh/gencode.c
index 3347591..155138a 100644
--- a/sim/sh/gencode.c
+++ b/sim/sh/gencode.c
@@ -1054,7 +1054,7 @@ op tab[] =
},
{ "n", "mn", "shad <REG_M>,<REG_N>", "0100nnnnmmmm1100",
- "R[n] = (R[m] < 0) ? (R[n] >> ((-R[m])&0x1f)) : (R[n] << (R[m] & 0x1f));",
+ "R[n] = (R[m] < 0) ? (R[m]&0x1f ? R[n] >> ((-R[m])&0x1f) : R[n] >> 31) : (R[n] << (R[m] & 0x1f));",
},
{ "n", "n", "shal <REG_N>", "0100nnnn00100000",
@@ -1068,7 +1068,7 @@ op tab[] =
},
{ "n", "mn", "shld <REG_M>,<REG_N>", "0100nnnnmmmm1101",
- "R[n] = (R[m] < 0) ? (UR[n] >> ((-R[m])&0x1f)): (R[n] << (R[m] & 0x1f));",
+ "R[n] = (R[m] < 0) ? (R[m]&0x1f ? UR[n] >> ((-R[m])&0x1f) : 0): (R[n] << (R[m] & 0x1f));",
},
{ "n", "n", "shll <REG_N>", "0100nnnn00000000",