Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1716406

[PATCH v2 3/6] MIPS: math-emu: CLASS.D: Zero bits 32-63 of the result

From Aleksandar Markovic <aleksandar.markovic@rt-rk.com>
Newsgroups linux.kernel
Subject [PATCH v2 3/6] MIPS: math-emu: CLASS.D: Zero bits 32-63 of the result
Date 2017-08-21 14:40 +0200
Message-ID <ugU9Q-4ml-25@gated-at.bofh.it> (permalink)
References <ugU0a-4jm-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Aleksandar Markovic <aleksandar.markovic@imgtec.com>

Fix content of CLASS.D output bits 32-63 to match hardware behavior.

Prior to this patch, bits 32-63 of CLASS.D output were not
initialized, causing different 32-63 bits content of CLASS.D, based on
circumstances. However, the hardware consistently returns all these
bits zeroed. The documentation is not clear whether these bits should
be zero or unpredictable. Since technically "all zero" case still can
be viewed as belonging to "unpredictable" class of results, it is
better to zero bits 32-63.

Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
Signed-off-by: Goran Ferenc <goran.ferenc@imgtec.com>
Signed-off-by: Aleksandar Markovic <aleksandar.markovic@imgtec.com>
---
 arch/mips/math-emu/cp1emu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
index cabcf2c..1ad15f8 100644
--- a/arch/mips/math-emu/cp1emu.c
+++ b/arch/mips/math-emu/cp1emu.c
@@ -2144,8 +2144,8 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
 				return SIGILL;
 
 			DPFROMREG(fs, MIPSInst_FS(ir));
-			rv.w = ieee754dp_2008class(fs);
-			rfmt = w_fmt;
+			rv.l = ieee754dp_2008class(fs);
+			rfmt = l_fmt;
 			break;
 		}
 
-- 
2.9.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/6] MIPS: math-emu: FP emulation fixes and improvements Aleksandar Markovic <aleksandar.markovic@rt-rk.com> - 2017-08-21 14:30 +0200
  [PATCH v2 2/6] MIPS: math-emu: RINT.<D|S>: Fix several problems by reimplementation Aleksandar Markovic <aleksandar.markovic@rt-rk.com> - 2017-08-21 14:30 +0200
  [PATCH v2 1/6] MIPS: math-emu: CMP.Sxxx.<D|S>: Prevent occurrences of SIGILL crashes Aleksandar Markovic <aleksandar.markovic@rt-rk.com> - 2017-08-21 14:30 +0200
  [PATCH v2 3/6] MIPS: math-emu: CLASS.D: Zero bits 32-63 of the result Aleksandar Markovic <aleksandar.markovic@rt-rk.com> - 2017-08-21 14:40 +0200
  [PATCH v2 4/6] MIPS: math-emu: Add FP emu debugfs statistics for branches Aleksandar Markovic <aleksandar.markovic@rt-rk.com> - 2017-08-21 14:40 +0200
  [PATCH v2 5/6] MIPS: math-emu: Add FP emu debugfs clear functionality Aleksandar Markovic <aleksandar.markovic@rt-rk.com> - 2017-08-21 14:40 +0200
  [PATCH v2 6/6] MIPS: math-emu: Add FP emu debugfs stats for individual instructions Aleksandar Markovic <aleksandar.markovic@rt-rk.com> - 2017-08-21 14:40 +0200

csiph-web