linux-mips
[Top] [All Lists]

[PATCH] fix branch emulation for floating-point exceptions

To: linux-mips@linux-mips.org
Subject: [PATCH] fix branch emulation for floating-point exceptions
From: Win Treese <treese@acm.org>
Date: Wed, 26 Apr 2006 15:22:22 -0400
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
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))


<Prev in Thread] Current Thread [Next in Thread>