MIPS: math-emu: CLASS.D: Zero bits 32-63 of the result
authorAleksandar Markovic <[email protected]>
Mon, 21 Aug 2017 12:24:49 +0000 (14:24 +0200)
committerRalf Baechle <[email protected]>
Tue, 29 Aug 2017 13:21:56 +0000 (15:21 +0200)
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 <[email protected]>
Signed-off-by: Goran Ferenc <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
Cc: Douglas Leung <[email protected]>
Cc: James Hogan <[email protected]>
Cc: Maciej W. Rozycki <[email protected]>
Cc: Masahiro Yamada <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: Petar Jovanovic <[email protected]>
Cc: Raghu Gandham <[email protected]>
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/17142/
Signed-off-by: Ralf Baechle <[email protected]>
arch/mips/math-emu/cp1emu.c

index 58396cb2057a883e60417c2873256438282988b8..a4df2200c725bd616503c1860255c6b4a55dbdf5 100644 (file)
@@ -2144,8 +2144,8 @@ copcsr:
                                return SIGILL;
 
                        DPFROMREG(fs, MIPSInst_FS(ir));
-                       rv.w = ieee754dp_2008class(fs);
-                       rfmt = w_fmt;
+                       rv.l = ieee754dp_2008class(fs);
+                       rfmt = l_fmt;
                        break;
                }