aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2015-04-03 18:26:49 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-04-07 19:10:05 -0400
commit2d83fea786d7aeb5b3b76bd492d9b3bccc0f823c (patch)
treeff3ca66d494d9b367aeefa99f07b70aa5eeb72e7 /arch/mips/kernel
parent80cbfad790962125b542cb0cb637954c04386b30 (diff)
MIPS: Correct FP ISA requirements
Correct ISA requirements for floating-point instructions: * the CU3 exception signifies a real COP3 instruction in MIPS I & II, * the BC1FL and BC1TL instructions are not supported in MIPS I, * the SQRT.fmt instructions are indeed supported in MIPS II, * the LDC1 and SDC1 instructions are indeed supported in MIPS32r1, * the CEIL.W.fmt, FLOOR.W.fmt, ROUND.W.fmt and TRUNC.W.fmt instructions are indeed supported in MIPS32, * the CVT.L.fmt and CVT.fmt.L instructions are indeed supported in MIPS32r2 and MIPS32r6, * the CEIL.L.fmt, FLOOR.L.fmt, ROUND.L.fmt and TRUNC.L.fmt instructions are indeed supported in MIPS32r2 and MIPS32r6, * the RSQRT.fmt and RECIP.fmt instructions are indeed supported in MIPS64r1, Also simplify conditionals for MIPS III and MIPS IV FPU instructions and the handling of the MOVCI minor opcode. Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/9700/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r--arch/mips/kernel/traps.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index dc6eaf4d93ea..88f04f0d2d21 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -1349,19 +1349,18 @@ asmlinkage void do_cpu(struct pt_regs *regs)
1349 1349
1350 case 3: 1350 case 3:
1351 /* 1351 /*
1352 * Old (MIPS I and MIPS II) processors will set this code 1352 * The COP3 opcode space and consequently the CP0.Status.CU3
1353 * for COP1X opcode instructions that replaced the original 1353 * bit and the CP0.Cause.CE=3 encoding have been removed as
1354 * COP3 space. We don't limit COP1 space instructions in 1354 * of the MIPS III ISA. From the MIPS IV and MIPS32r2 ISAs
1355 * the emulator according to the CPU ISA, so we want to 1355 * up the space has been reused for COP1X instructions, that
1356 * treat COP1X instructions consistently regardless of which 1356 * are enabled by the CP0.Status.CU1 bit and consequently
1357 * code the CPU chose. Therefore we redirect this trap to 1357 * use the CP0.Cause.CE=1 encoding for Coprocessor Unusable
1358 * the FP emulator too. 1358 * exceptions. Some FPU-less processors that implement one
1359 * 1359 * of these ISAs however use this code erroneously for COP1X
1360 * Then some newer FPU-less processors use this code 1360 * instructions. Therefore we redirect this trap to the FP
1361 * erroneously too, so they are covered by this choice 1361 * emulator too.
1362 * as well.
1363 */ 1362 */
1364 if (raw_cpu_has_fpu) { 1363 if (raw_cpu_has_fpu || !cpu_has_mips_4_5_64_r2_r6) {
1365 force_sig(SIGILL, current); 1364 force_sig(SIGILL, current);
1366 break; 1365 break;
1367 } 1366 }