summaryrefslogtreecommitdiff
path: root/arch/mips/math-emu/cp1emu.c
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2015-08-13 07:56:32 (GMT)
committerRalf Baechle <ralf@linux-mips.org>2015-09-03 10:08:13 (GMT)
commit83d43305a1df2aa2976e3ccf012e4cf0dc29673d (patch)
tree0cb65c74cbe19e526aff633130e253355bcc3ce9 /arch/mips/math-emu/cp1emu.c
parente24c3bec3e8e254a3784b3e4c97bd3a76fbcc807 (diff)
downloadlinux-83d43305a1df2aa2976e3ccf012e4cf0dc29673d.tar.xz
MIPS: math-emu: Add support for the MIPS R6 MSUBF FPU instruction
MIPS R6 introduced the following instruction: Floating Point Fused Multiply Subtract: MSUBF.fmt To perform a fused multiply-subtract of FP values. MSUBF.fmt: FPR[fd] = FPR[fd] - (FPR[fs] x FPR[ft]) Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/10957/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/math-emu/cp1emu.c')
-rw-r--r--arch/mips/math-emu/cp1emu.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index 67390ec..54964b3 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -1778,6 +1778,19 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
break;
}
+ case fmsubf_op: {
+ union ieee754sp ft, fs, fd;
+
+ if (!cpu_has_mips_r6)
+ return SIGILL;
+
+ SPFROMREG(ft, MIPSInst_FT(ir));
+ SPFROMREG(fs, MIPSInst_FS(ir));
+ SPFROMREG(fd, MIPSInst_FD(ir));
+ rv.s = ieee754sp_msubf(fd, fs, ft);
+ break;
+ }
+
case fabs_op:
handler.u = ieee754sp_abs;
goto scopuop;
@@ -2011,6 +2024,19 @@ copcsr:
break;
}
+ case fmsubf_op: {
+ union ieee754dp ft, fs, fd;
+
+ if (!cpu_has_mips_r6)
+ return SIGILL;
+
+ DPFROMREG(ft, MIPSInst_FT(ir));
+ DPFROMREG(fs, MIPSInst_FS(ir));
+ DPFROMREG(fd, MIPSInst_FD(ir));
+ rv.d = ieee754dp_msubf(fd, fs, ft);
+ break;
+ }
+
case fabs_op:
handler.u = ieee754dp_abs;
goto dcopuop;