summaryrefslogtreecommitdiff
path: root/sim/h8300/compile.c
diff options
context:
space:
mode:
authorDavid Edelsohn <dje.gcc@gmail.com>1996-03-11 23:25:53 +0000
committerDavid Edelsohn <dje.gcc@gmail.com>1996-03-11 23:25:53 +0000
commit5d06fa80b20ad5cb5729eadc128b6ac970875eaf (patch)
treee41d706ac9b06d7fa359dcb0d9dad89de23719a5 /sim/h8300/compile.c
parente10bb7b3e9548019333d30c527e0051db4514c92 (diff)
downloadbinutils-gdb-5d06fa80b20ad5cb5729eadc128b6ac970875eaf.tar.gz
(sim_resume, shift insns): Fix setting of overflow flag for shal.
Diffstat (limited to 'sim/h8300/compile.c')
-rw-r--r--sim/h8300/compile.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index 7a2df633c09..2545b1db7eb 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -1171,32 +1171,38 @@ sim_resume (step, siggnal)
printf ("%c", cpu.regs[2]);
goto next;
- OSHIFTS (O_NOT, rd = ~rd);
- OSHIFTS (O_SHLL, c = rd & hm;
+ OSHIFTS (O_NOT, rd = ~rd; v = 0;);
+ OSHIFTS (O_SHLL, c = rd & hm; v = 0;
rd <<= 1);
- OSHIFTS (O_SHLR, c = rd & 1;
+ OSHIFTS (O_SHLR, c = rd & 1; v = 0;
rd = (unsigned int) rd >> 1);
OSHIFTS (O_SHAL, c = rd & hm;
+ v = (rd & hm) != ((rd & (hm >> 1)) << 1);
rd <<= 1);
OSHIFTS (O_SHAR, t = rd & hm;
c = rd & 1;
+ v = 0;
rd >>= 1;
rd |= t;
);
OSHIFTS (O_ROTL, c = rd & hm;
+ v = 0;
rd <<= 1;
rd |= C);
OSHIFTS (O_ROTR, c = rd & 1;
+ v = 0;
rd = (unsigned int) rd >> 1;
if (c) rd |= hm;);
OSHIFTS (O_ROTXL, t = rd & hm;
rd <<= 1;
rd |= C;
c = t;
+ v = 0;
);
OSHIFTS (O_ROTXR, t = rd & 1;
rd = (unsigned int) rd >> 1;
- if (C) rd |= hm; c = t;);
+ if (C) rd |= hm; c = t;
+ v = 0;);
case O (O_JMP, SB):
{
@@ -1433,27 +1439,22 @@ sim_resume (step, siggnal)
shift8:
- /* Set flags after an 8 bit shift op, carry set in insn */
+ /* Set flags after an 8 bit shift op, carry,overflow set in insn */
n = (rd & 0x80);
- v = 0;
nz = rd & 0xff;
SET_B_REG (code->src.reg, rd);
goto next;
-
shift16:
- /* Set flags after an 16 bit shift op, carry set in insn */
+ /* Set flags after an 16 bit shift op, carry,overflow set in insn */
n = (rd & 0x8000);
- v = 0;
nz = rd & 0xffff;
-
SET_W_REG (code->src.reg, rd);
goto next;
shift32:
- /* Set flags after an 32 bit shift op, carry set in insn */
+ /* Set flags after an 32 bit shift op, carry,overflow set in insn */
n = (rd & 0x80000000);
- v = 0;
nz = rd & 0xffffffff;
SET_L_REG (code->src.reg, rd);
goto next;