Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Mar 2019 16:56:26 +0100
From:      Hans Petter Selasky <hps@selasky.org>
To:        sgk@troutmask.apl.washington.edu
Cc:        freebsd-toolchain@freebsd.org, freebsd-current@freebsd.org
Subject:   Re: Optimization bug with floating-point?
Message-ID:  <e4b75a93-8ec9-2cc0-641e-7bbd5f466e10@selasky.org>
In-Reply-To: <20190313155009.GA34852@troutmask.apl.washington.edu>
References:  <20190313024506.GA31746@troutmask.apl.washington.edu> <20190313151635.GA34757@troutmask.apl.washington.edu> <14ead2c2-b586-309d-947f-1395b5284dd1@selasky.org> <20190313155009.GA34852@troutmask.apl.washington.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On 3/13/19 4:50 PM, Steve Kargl wrote:
> Using sin() and cos() directly as in
> 
> /* Double precision csinh() without using C's double complex.s */
> void
> dp_csinh(double x, double y, double *re, double *im)
> {
>     double c, s;
>     *re = sinh(x) * cos(y);
>     *im = cosh(x) * sin(y);
> }
> 
> does not change the result.  I'll also note that libm
> is compiled by clang, and I do not recompile it for the
> tests.  Both gcc8 and cc are using the same libm.
> 
> I've also tested clang of amd64 with the -m32, it fails
> as well.

Hi,

I cannot see this is failing with 11-stable userland. Can you check with 
objdump() that clang doesn't optimise it to sincos() ?

FreeBSD clang version 3.8.0 (tags/RELEASE_380/final 262564) (based on 
LLVM 3.8.0)
Target: x86_64-unknown-freebsd11.0
Thread model: posix
InstalledDir: /usr/bin

cc -lm -O2 -Wall test.c && ./a.out
Max ULP: 2.297073
Count: 0

clang40 -lm -O2 test6.c
 > ./a.out
Max ULP: 2.297073
Count: 0

clang50 -lm -O2 test6.c
 > ./a.out
Max ULP: 2.297073
Count: 0

clang60 -lm -O2 test6.c
 > ./a.out
Max ULP: 2.297073
Count: 0

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e4b75a93-8ec9-2cc0-641e-7bbd5f466e10>