Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] fix branch emulation for floating-point exceptions
@ 2006-04-26 19:22 Win Treese
  2006-04-26 21:28 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Win Treese @ 2006-04-26 19:22 UTC (permalink / raw)
  To: linux-mips

In the branch emulation for floating-point exceptions,  
__compute_return_epc
must determine for bc1f et al which condition code bit to test. This  
is based on bits <4:2>
of the rt field. The switch statement to distinguish bc1f et al needs  
to use only the
two low bits of rt, but the old code tests on the whole rt field.  
This patch masks off
the proper bits.

Signed-off-by: Win Treese <treese@acm.org>

Index: a/arch/mips/kernel/branch.c
===================================================================
--- a/arch/mips/kernel/branch.c (revision 18809)
+++ a/arch/mips/kernel/branch.c (working copy)
@@ -184,7 +184,7 @@
                 bit = (insn.i_format.rt >> 2);
                 bit += (bit != 0);
                 bit += 23;
-               switch (insn.i_format.rt) {
+               switch (insn.i_format.rt & 3) {
                 case 0: /* bc1f */
                 case 2: /* bc1fl */
                         if (~fcr31 & (1 << bit))

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] fix branch emulation for floating-point exceptions
  2006-04-26 19:22 [PATCH] fix branch emulation for floating-point exceptions Win Treese
@ 2006-04-26 21:28 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2006-04-26 21:28 UTC (permalink / raw)
  To: Win Treese; +Cc: linux-mips

On Wed, Apr 26, 2006 at 03:22:22PM -0400, Win Treese wrote:

> In the branch emulation for floating-point exceptions,  
> __compute_return_epc
> must determine for bc1f et al which condition code bit to test. This  
> is based on bits <4:2>
> of the rt field. The switch statement to distinguish bc1f et al needs  
> to use only the
> two low bits of rt, but the old code tests on the whole rt field.  
> This patch masks off
> the proper bits.

One of those bugs that have managed to hide since day one ...  I applied
your fix but: your mailer is converting tabs to spaces, so patch is going
to barf on the patch ...

> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
                                                         ^^^^^^^^^^^^^

... and it would also break long lines ...

  Ralf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-04-26 21:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-26 19:22 [PATCH] fix branch emulation for floating-point exceptions Win Treese
2006-04-26 21:28 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox