NetBSD-Bugs archive

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

Re: toolchain/45310: some mixed int/float computations are wrong on mips64



The following reply was made to PR port-mips/45310; it has been noted by GNATS.

From: David Laight <david%l8s.co.uk@localhost>
To: Manuel Bouyer <bouyer%antioche.eu.org@localhost>
Cc: port-mips-maintainer%NetBSD.org@localhost, gnats-bugs%NetBSD.org@localhost,
        netbsd-bugs%NetBSD.org@localhost
Subject: Re: toolchain/45310: some mixed int/float computations are wrong on 
mips64
Date: Fri, 2 Sep 2011 18:37:53 +0100

 On Wed, Aug 31, 2011 at 10:05:27PM +0200, Manuel Bouyer wrote:
 >
 > -    if (__predict_false(exp < 0 || exp - mant_dig > sizeof(UINTXX_T)*8-1))
 > +    if (__predict_false(exp < 0 ||
 > +        exp - (long)mant_dig > (long)sizeof(UINTXX_T)*8-1))
 >              return 0;
 
 As a complete aside to the problem being discussed, I discovered that
 the __predict_false() above won't necessarily have the desired effect.
 
 I had to change some code to (effectively):
        if (__predict_false(exp < 0) ||
            __predict_false(exp - (long)mant_dig > (long)sizeof(UINTXX_T)*8-1)))
 in order to get the desired static branch prediction.
 
        David
 
 -- 
 David Laight: david%l8s.co.uk@localhost
 


Home | Main Index | Thread Index | Old Index