Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Markos Chandras and committed by
Ralf Baechle
130fe357 67613f02

+22
+22
arch/mips/math-emu/cp1emu.c
··· 1754 1754 SPFROMREG(rv.s, MIPSInst_FS(ir)); 1755 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 1768 case fabs_op: 1758 1769 handler.u = ieee754sp_abs; 1759 1770 goto scopuop; ··· 1972 1961 rv.l = 0; 1973 1962 else 1974 1963 DPFROMREG(rv.d, MIPSInst_FS(ir)); 1964 + break; 1965 + 1966 + case fselnez_op: 1967 + if (!cpu_has_mips_r6) 1968 + return SIGILL; 1969 + 1970 + DPFROMREG(rv.d, MIPSInst_FT(ir)); 1971 + if (rv.l & 0x1) 1972 + DPFROMREG(rv.d, MIPSInst_FS(ir)); 1973 + else 1974 + rv.l = 0; 1975 1975 break; 1976 1976 1977 1977 case fabs_op: