From 30458d39d6f791293f844ab9f75c4f465d52e74c Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Mon, 30 Sep 2002 20:11:08 +0000 Subject: [PATCH] Fix handling of v850e bit-twiddle instructions. * simops.c (OP_E6077E0): And op1 with 7 after reading register, not before. (BIT_CHANGE_OP): Likewise. --- sim/v850/ChangeLog | 6 ++++++ sim/v850/simops.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog index 100ece186e5..2053096ece5 100644 --- a/sim/v850/ChangeLog +++ b/sim/v850/ChangeLog @@ -1,3 +1,9 @@ +2002-09-27 Jim Wilson + + * simops.c (OP_E6077E0): And op1 with 7 after reading register, not + before. + (BIT_CHANGE_OP): Likewise. + 2002-09-26 Jim Wilson * simops (OP_10007E0): Don't subtract 4 from PC. diff --git a/sim/v850/simops.c b/sim/v850/simops.c index eba728fa287..04045234629 100644 --- a/sim/v850/simops.c +++ b/sim/v850/simops.c @@ -1897,7 +1897,7 @@ OP_E607E0 (void) temp = load_mem (State.regs[ OP[0] ], 1); PSW &= ~PSW_Z; - if ((temp & (1 << State.regs[ OP[1] & 0x7 ])) == 0) + if ((temp & (1 << (State.regs[ OP[1] ] & 0x7))) == 0) PSW |= PSW_Z; trace_output (OP_BIT); @@ -1924,7 +1924,7 @@ OP_22207E0 (void) \ trace_input (name, OP_BIT_CHANGE, 0); \ \ - bit = 1 << State.regs[ OP[1] & 0x7 ]; \ + bit = 1 << (State.regs[ OP[1] ] & 0x7); \ temp = load_mem (State.regs[ OP[0] ], 1); \ \ PSW &= ~PSW_Z; \ -- 2.30.2