This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[frv sim] clip cut point for MWCUT
- From: DJ Delorie <dj at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: brolley at redhat dot com
- Date: Tue, 18 Dec 2007 16:45:57 -0500
- Subject: [frv sim] clip cut point for MWCUT
The MWCUT opcode only looks at the six LSBs of the cut point register.
The frv.c code was looking at the whole register, resulting in
incorrect cut results. This patch clips the cut_point argument to six
bits (0..63). Ok to apply?
* frv/frv.c (frvbf_cut): Only look at the six LSBs of
cut_point.
Index: frv.c
===================================================================
RCS file: /cvs/src/src/sim/frv/frv.c,v
retrieving revision 1.9
diff -p -U3 -r1.9 frv.c
--- frv.c 24 Aug 2007 14:28:36 -0000 1.9
+++ frv.c 18 Dec 2007 21:42:50 -0000
@@ -1055,6 +1055,7 @@ SI
frvbf_cut (SIM_CPU *current_cpu, SI reg1, SI reg2, SI cut_point)
{
SI result;
+ cut_point &= 0x3f;
if (cut_point < 32)
{
result = reg1 << cut_point;