Re: sparc64 fmulq emulation glitch?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Rene Rebe <rene@xxxxxxxxxxxx>
Date: Mon, 26 Jun 2006 09:02:12 +0200

> int main ()
> {
>         long double a = 2;
>         long double b = 1.0;
>         a *= b;
>         printf ("%Lf\n", a);
> }
> 
> built with: gcc -m64 -mhard-quad-float
> 
> yields: 4

Something is wrong with _FP_MUL_MEAT_2_wide_3mul, which tries to
optimize the 2-limb multiply into 3 multiplies instead of 4.  None of
the other platforms utilizing the soft-fp layer in the kernel try to
use the _3mul version either.

Correctness trumps performance, so we can just use the full 4 multiply
version to fix this bug.

Thanks for the report.

diff-tree 92f282988b4ce3967ee8399f7d1184ebfa04e48b (from 64821324ca49f24be1a66f2f432108f96a24e596)
Author: David S. Miller <davem@xxxxxxxxxxxxxxxxxxxx>
Date:   Thu Jul 27 16:49:21 2006 -0700

    [SPARC64]: Fix quad-float multiply emulation.
    
    Something is wrong with the 3-multiply (vs. 4-multiply) optimized
    version of _FP_MUL_MEAT_2_*(), so just use the slower version
    which actually computes correct values.
    
    Noticed by Rene Rebe
    
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>

diff --git a/include/asm-sparc64/sfp-machine.h b/include/asm-sparc64/sfp-machine.h
index 5015bb8..89d4243 100644
--- a/include/asm-sparc64/sfp-machine.h
+++ b/include/asm-sparc64/sfp-machine.h
@@ -34,7 +34,7 @@
 #define _FP_MUL_MEAT_D(R,X,Y)					\
   _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
 #define _FP_MUL_MEAT_Q(R,X,Y)					\
-  _FP_MUL_MEAT_2_wide_3mul(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
+  _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
 
 #define _FP_DIV_MEAT_S(R,X,Y)	_FP_DIV_MEAT_1_imm(S,R,X,Y,_FP_DIV_HELP_imm)
 #define _FP_DIV_MEAT_D(R,X,Y)	_FP_DIV_MEAT_1_udiv_norm(D,R,X,Y)
-
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux