This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RFA: RX: Set the flags when performing a shift by zero
- From: Nick Clifton <nickc at redhat dot com>
- To: dj at redhat dot com
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 26 Jun 2013 11:35:57 +0100
- Subject: RFA: RX: Set the flags when performing a shift by zero
Hi DJ,
The patch below fixes a problem with the RX simulator's handling of
shift instructions. If the shift was by 0 the simulator would not set
the condition code bits. The RX ISA allows a shift of 0, and the
condition codes should be set. Fixing this also resolves an
unexpected failure in the GCC testsuite (builtin-bitops.c) where gcc's
compilation of the ffs() function relies upon the flag setting
behaviour.
OK to apply ?
Cheers
Nick
sim/rx/ChangeLog
2013-06-25 Nick Clifton <nickc@redhat.com>
* rx/rx.c (SHIFT_OP): A shift by zero still sets the condition
codes.
Index: sim/rx/rx.c
===================================================================
RCS file: /cvs/src/src/sim/rx/rx.c,v
retrieving revision 1.17
diff -u -3 -p -r1.17 rx.c
--- sim/rx/rx.c 16 Jan 2013 10:45:22 -0000 1.17
+++ sim/rx/rx.c 26 Jun 2013 10:33:15 -0000
@@ -732,8 +732,7 @@ poppc()
c = val & carry_mask; \
val OP 1; \
} \
- if (count) \
- set_oszc (val, 4, c); \
+ set_oszc (val, 4, c); \
PD (val); \
}