diff options
author | Markos Chandras <markos.chandras@imgtec.com> | 2015-08-13 03:56:30 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-09-03 06:08:13 -0400 |
commit | 130fe357ee895421a4aefef7b1285bf52f295afe (patch) | |
tree | d21c7a7f04c28fcbc62d925b9c2ef86e550f0d0d | |
parent | 67613f02788d73541c7c9b1c851061b8c223057b (diff) |
MIPS: math-emu: Add support for the MIPS R6 SELNEZ FPU instruction
MIPS R6 introduced the following instruction:
SELNEZ.fmt: FPR[fd] FPR[ft].bit0 ? FPR[fs] : 0
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/10955/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r-- | arch/mips/math-emu/cp1emu.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c index 02ba536f1594..8978d52adf0e 100644 --- a/arch/mips/math-emu/cp1emu.c +++ b/arch/mips/math-emu/cp1emu.c | |||
@@ -1754,6 +1754,17 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
1754 | SPFROMREG(rv.s, MIPSInst_FS(ir)); | 1754 | SPFROMREG(rv.s, MIPSInst_FS(ir)); |
1755 | break; | 1755 | break; |
1756 | 1756 | ||
1757 | case fselnez_op: | ||
1758 | if (!cpu_has_mips_r6) | ||
1759 | return SIGILL; | ||
1760 | |||
1761 | SPFROMREG(rv.s, MIPSInst_FT(ir)); | ||
1762 | if (rv.w & 0x1) | ||
1763 | SPFROMREG(rv.s, MIPSInst_FS(ir)); | ||
1764 | else | ||
1765 | rv.w = 0; | ||
1766 | break; | ||
1767 | |||
1757 | case fabs_op: | 1768 | case fabs_op: |
1758 | handler.u = ieee754sp_abs; | 1769 | handler.u = ieee754sp_abs; |
1759 | goto scopuop; | 1770 | goto scopuop; |
@@ -1963,6 +1974,17 @@ copcsr: | |||
1963 | DPFROMREG(rv.d, MIPSInst_FS(ir)); | 1974 | DPFROMREG(rv.d, MIPSInst_FS(ir)); |
1964 | break; | 1975 | break; |
1965 | 1976 | ||
1977 | case fselnez_op: | ||
1978 | if (!cpu_has_mips_r6) | ||
1979 | return SIGILL; | ||
1980 | |||
1981 | DPFROMREG(rv.d, MIPSInst_FT(ir)); | ||
1982 | if (rv.l & 0x1) | ||
1983 | DPFROMREG(rv.d, MIPSInst_FS(ir)); | ||
1984 | else | ||
1985 | rv.l = 0; | ||
1986 | break; | ||
1987 | |||
1966 | case fabs_op: | 1988 | case fabs_op: |
1967 | handler.u = ieee754dp_abs; | 1989 | handler.u = ieee754dp_abs; |
1968 | goto dcopuop; | 1990 | goto dcopuop; |