aboutsummaryrefslogtreecommitdiff
path: root/target-cris/op.c
diff options
context:
space:
mode:
authoredgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-01 17:25:33 +0000
committeredgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-01 17:25:33 +0000
commitbbaf29c76994ef762523bc8893a88cac701c87e7 (patch)
tree5d39be7749d8f177f79402bca5da5bc2388e27f8 /target-cris/op.c
parentbffd92fed9393021200915586be8d1b0cc711286 (diff)
* target-cris/op.c: Make sure the bit-test insn only updates the XNZ flags.
* target-cris/helper.c: Update ERP for user-mode simulation aswell. * hw/etraxfs_timer.c: Support multiple timers. * hw/etraxfs_ser.c: Multiple ports, the data just goes to stdout. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4004 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-cris/op.c')
-rw-r--r--target-cris/op.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/target-cris/op.c b/target-cris/op.c
index 36cfa3f20c..aeb80de4a3 100644
--- a/target-cris/op.c
+++ b/target-cris/op.c
@@ -967,6 +967,8 @@ void OPPROTO op_btst_T0_T1 (void)
The N flag is set according to the selected bit in the dest reg.
The Z flag is set if the selected bit and all bits to the right are
zero.
+ The X flag is cleared.
+ Other flags are left untouched.
The destination reg is not affected.*/
unsigned int fz, sbit, bset, mask, masked_t0;
@@ -975,8 +977,11 @@ void OPPROTO op_btst_T0_T1 (void)
mask = sbit == 31 ? -1 : (1 << (sbit + 1)) - 1;
masked_t0 = T0 & mask;
fz = !(masked_t0 | bset);
+
+ /* Clear the X, N and Z flags. */
+ T0 = env->pregs[PR_CCS] & ~(X_FLAG | N_FLAG | Z_FLAG);
/* Set the N and Z flags accordingly. */
- T0 = (bset << 3) | (fz << 2);
+ T0 |= (bset << 3) | (fz << 2);
RETURN();
}