Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH mips-for-linux-next] MIPS: math-emu: Regression fixes
@ 2014-05-23 12:49 Alex Smith
  2014-05-23 12:49 ` Alex Smith
  2014-05-23 12:58 ` Ralf Baechle
  0 siblings, 2 replies; 4+ messages in thread
From: Alex Smith @ 2014-05-23 12:49 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, Alex Smith

Fix some errors introduced by commit e2efc0ab3a ("MIPS: math-emu:
Remove most ifdefery."), which result in incorrect behaviour of the
FPU emulator.

Signed-off-by: Alex Smith <alex.smith@imgtec.com>
---
Ralf, the above commit in mips-for-linux-next causes a regression
which this patch fixes (the regression I was seeing is fixed by the
last change, but I also noticed a couple of incorrect ISA level
checks which I fixed up as well). Could you squash this into that
commit?
---
 arch/mips/math-emu/cp1emu.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index 331334c..08e6a74 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -1512,7 +1512,7 @@ copcsr:
 			goto copcsr;
 
 		case fcvtl_op:
-			if (!cpu_has_mips_3_4_5 && cpu_has_mips64)
+			if (!cpu_has_mips_3_4_5 && !cpu_has_mips64)
 				return SIGILL;
 
 			SPFROMREG(fs, MIPSInst_FS(ir));
@@ -1524,7 +1524,7 @@ copcsr:
 		case ftruncl_op:
 		case fceill_op:
 		case ffloorl_op:
-			if (!cpu_has_mips_3_4_5 && cpu_has_mips64)
+			if (!cpu_has_mips_3_4_5 && !cpu_has_mips64)
 				return SIGILL;
 
 			oldrm = ieee754_csr.rm;
@@ -1808,11 +1808,10 @@ dcopuop:
 			cbit = fpucondbit[MIPSInst_RT(ir) >> 2];
 		else
 			cbit = FPU_CSR_COND;
-		cond = ctx->fcr31 & cbit;
 		if (rv.w)
-			ctx->fcr31 |= cond;
+			ctx->fcr31 |= cbit;
 		else
-			ctx->fcr31 &= ~cond;
+			ctx->fcr31 &= ~cbit;
 		break;
 
 	case d_fmt:
-- 
1.9.3

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

end of thread, other threads:[~2014-05-23 13:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-23 12:49 [PATCH mips-for-linux-next] MIPS: math-emu: Regression fixes Alex Smith
2014-05-23 12:49 ` Alex Smith
2014-05-23 12:58 ` Ralf Baechle
2014-05-23 13:17   ` Ralf Baechle

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