* [frv sim] clip cut point for MWCUT
@ 2007-12-18 21:59 DJ Delorie
2007-12-19 14:59 ` Dave Brolley
0 siblings, 1 reply; 3+ messages in thread
From: DJ Delorie @ 2007-12-18 21:59 UTC (permalink / raw)
To: gdb-patches; +Cc: brolley
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;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [frv sim] clip cut point for MWCUT
2007-12-18 21:59 [frv sim] clip cut point for MWCUT DJ Delorie
@ 2007-12-19 14:59 ` Dave Brolley
2007-12-20 1:43 ` DJ Delorie
0 siblings, 1 reply; 3+ messages in thread
From: Dave Brolley @ 2007-12-19 14:59 UTC (permalink / raw)
To: DJ Delorie; +Cc: gdb-patches
Yes. Please commit this patch.
Dave
DJ Delorie wrote:
> 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;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [frv sim] clip cut point for MWCUT
2007-12-19 14:59 ` Dave Brolley
@ 2007-12-20 1:43 ` DJ Delorie
0 siblings, 0 replies; 3+ messages in thread
From: DJ Delorie @ 2007-12-20 1:43 UTC (permalink / raw)
To: brolley; +Cc: gdb-patches
> Yes. Please commit this patch.
Done. Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-12-19 20:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-18 21:59 [frv sim] clip cut point for MWCUT DJ Delorie
2007-12-19 14:59 ` Dave Brolley
2007-12-20 1:43 ` DJ Delorie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox