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 RINT FPU instruction

MIPS R6 introduced the following instruction:
Floating-Point Round to Integral
Scalar floating-point round to integral floating point value.

RINT.fmt: FPR[fd] = round_int(FPR[fs])

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/10958/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Markos Chandras and committed by
Ralf Baechle
400bd2e4 83d43305

+24
+24
arch/mips/math-emu/cp1emu.c
··· 1791 1791 break; 1792 1792 } 1793 1793 1794 + case frint_op: { 1795 + union ieee754sp fs; 1796 + 1797 + if (!cpu_has_mips_r6) 1798 + return SIGILL; 1799 + 1800 + SPFROMREG(fs, MIPSInst_FS(ir)); 1801 + rv.l = ieee754sp_tlong(fs); 1802 + rv.s = ieee754sp_flong(rv.l); 1803 + goto copcsr; 1804 + } 1805 + 1794 1806 case fabs_op: 1795 1807 handler.u = ieee754sp_abs; 1796 1808 goto scopuop; ··· 2047 2035 DPFROMREG(fd, MIPSInst_FD(ir)); 2048 2036 rv.d = ieee754dp_msubf(fd, fs, ft); 2049 2037 break; 2038 + } 2039 + 2040 + case frint_op: { 2041 + union ieee754dp fs; 2042 + 2043 + if (!cpu_has_mips_r6) 2044 + return SIGILL; 2045 + 2046 + DPFROMREG(fs, MIPSInst_FS(ir)); 2047 + rv.l = ieee754dp_tlong(fs); 2048 + rv.d = ieee754dp_flong(rv.l); 2049 + goto copcsr; 2050 2050 } 2051 2051 2052 2052 case fabs_op: