aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2015-08-13 03:56:29 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-09-03 06:08:12 -0400
commit67613f02788d73541c7c9b1c851061b8c223057b (patch)
tree1212cdfb5cab6af325dcad759cf908d7740f2a3a
parentf8c3c6717a7128f9601b20f890d658283d59561a (diff)
MIPS: math-emu: Add support for the MIPS R6 SELEQZ FPU instruction
MIPS R6 introduced the following instruction: SELEQZ.fmt: FPR[fd]  FPR[ft].bit0 ? 0 : FPR[fs] Add support for emulating the single and double precision formats of the said instruction. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/10954/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/math-emu/cp1emu.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index ef41fc895e75..02ba536f1594 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -1743,6 +1743,17 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
1743 SPFROMREG(rv.s, MIPSInst_FS(ir)); 1743 SPFROMREG(rv.s, MIPSInst_FS(ir));
1744 break; 1744 break;
1745 1745
1746 case fseleqz_op:
1747 if (!cpu_has_mips_r6)
1748 return SIGILL;
1749
1750 SPFROMREG(rv.s, MIPSInst_FT(ir));
1751 if (rv.w & 0x1)
1752 rv.w = 0;
1753 else
1754 SPFROMREG(rv.s, MIPSInst_FS(ir));
1755 break;
1756
1746 case fabs_op: 1757 case fabs_op:
1747 handler.u = ieee754sp_abs; 1758 handler.u = ieee754sp_abs;
1748 goto scopuop; 1759 goto scopuop;
@@ -1940,6 +1951,18 @@ copcsr:
1940 return 0; 1951 return 0;
1941 DPFROMREG(rv.d, MIPSInst_FS(ir)); 1952 DPFROMREG(rv.d, MIPSInst_FS(ir));
1942 break; 1953 break;
1954
1955 case fseleqz_op:
1956 if (!cpu_has_mips_r6)
1957 return SIGILL;
1958
1959 DPFROMREG(rv.d, MIPSInst_FT(ir));
1960 if (rv.l & 0x1)
1961 rv.l = 0;
1962 else
1963 DPFROMREG(rv.d, MIPSInst_FS(ir));
1964 break;
1965
1943 case fabs_op: 1966 case fabs_op:
1944 handler.u = ieee754dp_abs; 1967 handler.u = ieee754dp_abs;
1945 goto dcopuop; 1968 goto dcopuop;