Skip to contentSkip to conversation

MIPS: math-emu: Regression fixes

PATCH In review Alex Smith 2 participants 3 messages May 23, 2014 MIPS

lore
Share & tools
lore

Alex Smith

author
#0 lore raw

PATCH 1/1 MIPS: math-emu: Regression fixes

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

---
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(-)
arch/mips/math-emu/cp1emu.c +4 -5
index 331334c..08e6a74 100644
@@ -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:
Signature · 1 line
1.9.3
#1 lore raw
Quoted 11 lines · Alex Smith

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

---
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?

Will do. Of course that had to pop up in my mail folder just a mere minutes after me claiming there were no pending issues ...

Ralf

#2 lore raw
Quoted 11 lines · Ralf Baechle
Quoted 11 lines

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

---
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?

Seems your patch was not against e2efc0ab3a but top of tree which resulted in rejects for the first two segments. Just in case you want to look over them, the new commit id of e2efc0ab3a is now 08a07904e182895e1205f399465a3d622c0115b8 and the other patch which was affected is 3f7cac416b5e62d37aa693538729c6c23e9b938b [MIPS: math-emu:
Cleanup coding style.]

Thanks!

Ralf