1
0
Fork 0
remarkable-linux/arch/mips/math-emu
Aleksandar Markovic 085d66519c MIPS: math-emu: Fix final emulation phase for certain instructions
commit 409fcace99 upstream.

Fix final phase of <CLASS|MADDF|MSUBF|MAX|MIN|MAXA|MINA>.<D|S>
emulation. Provide proper generation of SIGFPE signal and updating
debugfs FP exception stats in cases of any exception flags set in
preceding phases of emulation.

CLASS.<D|S> instruction may generate "Unimplemented Operation" FP
exception. <MADDF|MSUBF>.<D|S> instructions may generate "Inexact",
"Unimplemented Operation", "Invalid Operation", "Overflow", and
"Underflow" FP exceptions. <MAX|MIN|MAXA|MINA>.<D|S> instructions
can generate "Unimplemented Operation" and "Invalid Operation" FP
exceptions.

The proper final processing of the cases when any FP exception
flag is set is achieved by replacing "break" statement with "goto
copcsr" statement. With such solution, this patch brings the final
phase of emulation of the above instructions consistent with the
one corresponding to the previously implemented emulation of other
related FPU instructions (ADD, SUB, etc.).

Fixes: 38db37ba06 ("MIPS: math-emu: Add support for the MIPS R6 CLASS FPU instruction")
Fixes: e24c3bec3e ("MIPS: math-emu: Add support for the MIPS R6 MADDF FPU instruction")
Fixes: 83d43305a1 ("MIPS: math-emu: Add support for the MIPS R6 MSUBF FPU instruction")
Fixes: a79f5f9ba5 ("MIPS: math-emu: Add support for the MIPS R6 MAX{, A} FPU instruction")
Fixes: 4e9561b20e ("MIPS: math-emu: Add support for the MIPS R6 MIN{, A} FPU instruction")
Signed-off-by: Aleksandar Markovic <aleksandar.markovic@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Douglas Leung <douglas.leung@mips.com>
Cc: Goran Ferenc <goran.ferenc@mips.com>
Cc: "Maciej W. Rozycki" <macro@imgtec.com>
Cc: Miodrag Dinic <miodrag.dinic@mips.com>
Cc: Paul Burton <paul.burton@mips.com>
Cc: Petar Jovanovic <petar.jovanovic@mips.com>
Cc: Raghu Gandham <raghu.gandham@mips.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/17581/
Signed-off-by: James Hogan <jhogan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-30 08:40:44 +00:00
..
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cp1emu.c MIPS: math-emu: Fix final emulation phase for certain instructions 2017-11-30 08:40:44 +00:00
dp_2008class.c MIPS: math-emu: Add support for the MIPS R6 CLASS FPU instruction 2015-09-03 12:08:14 +02:00
dp_add.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
dp_cmp.c MIPS: math-emu: Remove redundant code from NaN comparison 2015-04-08 01:09:38 +02:00
dp_div.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
dp_fint.c MIPS: math-emu: Cleanup coding style. 2014-05-23 15:11:15 +02:00
dp_flong.c MIPS: math-emu: Cleanup coding style. 2014-05-23 15:11:15 +02:00
dp_fmax.c MIPS: math-emu: <MAXA|MINA>.<D|S>: Fix cases of both infinite inputs 2017-08-29 15:21:55 +02:00
dp_fmin.c MIPS: math-emu: MINA.<D|S>: Fix some cases of infinity and zero inputs 2017-08-29 15:21:55 +02:00
dp_fsp.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
dp_maddf.c MIPS: math-emu: <MADDF|MSUBF>.D: Fix accuracy (64-bit case) 2017-08-29 15:21:56 +02:00
dp_mul.c MIPS: math-emu: Fix code indentation 2016-05-13 14:02:23 +02:00
dp_rint.c MIPS: math-emu: RINT.<D|S>: Fix several problems by reimplementation 2017-08-29 15:21:56 +02:00
dp_simple.c MIPS: math-emu: Add IEEE Std 754-2008 ABS.fmt and NEG.fmt emulation 2016-01-20 00:39:20 +01:00
dp_sqrt.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
dp_sub.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
dp_tint.c MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00
dp_tlong.c MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00
dsemul.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ieee754.c MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00
ieee754.h MIPS: math-emu: RINT.<D|S>: Fix several problems by reimplementation 2017-08-29 15:21:56 +02:00
ieee754d.c MIPS: math-emu: Cleanup coding style. 2014-05-23 15:11:15 +02:00
ieee754dp.c MIPS: math-emu: Always propagate sNaN payload in quieting 2016-05-13 14:02:11 +02:00
ieee754dp.h MIPS: math-emu: Add z argument macros 2016-05-13 14:02:22 +02:00
ieee754int.h MIPS: math-emu: <MADDF|MSUBF>.<D|S>: Clean up "maddf_flags" enumeration 2017-08-29 15:21:56 +02:00
ieee754sp.c MIPS: math-emu: Fix m{add,sub}.s shifts 2016-05-13 14:02:23 +02:00
ieee754sp.h MIPS: math-emu: <MADDF|MSUBF>.S: Fix accuracy (32-bit case) 2017-08-29 15:21:56 +02:00
me-debugfs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sp_2008class.c MIPS: math-emu: Add support for the MIPS R6 CLASS FPU instruction 2015-09-03 12:08:14 +02:00
sp_add.c MIPS: math-emu: Fix m{add,sub}.s shifts 2016-05-13 14:02:23 +02:00
sp_cmp.c MIPS: math-emu: Remove redundant code from NaN comparison 2015-04-08 01:09:38 +02:00
sp_div.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
sp_fdp.c MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00
sp_fint.c MIPS: math-emu: Cleanup coding style. 2014-05-23 15:11:15 +02:00
sp_flong.c MIPS: math-emu: Cleanup coding style. 2014-05-23 15:11:15 +02:00
sp_fmax.c MIPS: math-emu: <MAXA|MINA>.<D|S>: Fix cases of both infinite inputs 2017-08-29 15:21:55 +02:00
sp_fmin.c MIPS: math-emu: MINA.<D|S>: Fix some cases of infinity and zero inputs 2017-08-29 15:21:55 +02:00
sp_maddf.c MIPS: math-emu: <MADDF|MSUBF>.S: Fix accuracy (32-bit case) 2017-08-29 15:21:56 +02:00
sp_mul.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
sp_rint.c MIPS: math-emu: RINT.<D|S>: Fix several problems by reimplementation 2017-08-29 15:21:56 +02:00
sp_simple.c MIPS: math-emu: Add IEEE Std 754-2008 ABS.fmt and NEG.fmt emulation 2016-01-20 00:39:20 +01:00
sp_sqrt.c MIPS: math-emu: Reinstate sNaN quieting handlers 2015-04-08 01:09:31 +02:00
sp_sub.c MIPS: math-emu: Fix m{add,sub}.s shifts 2016-05-13 14:02:23 +02:00
sp_tint.c MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00
sp_tlong.c MIPS: math-emu: Add IEEE Std 754-2008 NaN encoding emulation 2016-01-20 00:39:20 +01:00