x86_64: use a working implementation of atan2

The "generic" files are actually not generic at all. They were
imported for the PowerPC port and assume a matching format for float.
However, x86 uses a different format as the values are stored with 80
bit precision in the FPU. Therefore the generic implementation is
not appropriate whenever it does bit manipulations.

The glibc implementation uses the same sourcecode as the x86 version
for atan2, and there is no reason for us not to do the same.

Should fix #14933

Change-Id: I9addcfdf8b0f980c8842480885b59c0133866756
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2067
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
Adrien Destugues 2019-12-31 23:09:55 +01:00 committed by Adrien Destugues
parent 92e9211d7b
commit 230ade3026

View File

@ -32,7 +32,7 @@ local genericSources =
mplog.c mpsqrt.c mptan.c sincos32.c slowexp.c slowpow.c
e_acos.c e_acosf.c e_acosh.c e_acoshf.c e_acoshl.c e_asin.c e_asinf.c
e_asinl.c e_atan2.c e_atan2f.c e_atanh.c e_atanhf.c e_atanhl.c e_cosh.c
e_asinl.c e_atan2f.c e_atanh.c e_atanhf.c e_atanhl.c e_cosh.c
e_coshf.c e_coshl.c e_exp.c e_exp10.c e_exp10f.c e_exp10l.c e_exp2.c
e_exp2f.c e_expf.c e_fmod.c e_fmodf.c e_gamma_r.c e_gammaf_r.c e_gammal_r.c
e_hypot.c e_hypotf.c e_hypotl.c e_ilogbl.c e_j0.c e_j0f.c e_j0l.c e_j1.c
@ -84,15 +84,17 @@ local genericSources =
w_tgammal.c
;
local x86Sources = e_atan2.S ;
local architectureObject ;
for architectureObject in [ MultiArchSubDirSetup x86_64 ] {
on $(architectureObject) {
local architecture = $(TARGET_PACKAGING_ARCH) ;
MergeObject <$(architecture)>posix_gnu_arch_$(TARGET_ARCH)_e.o :
e_acosl.c e_atan2l.c e_exp2l.S e_expl.S e_fmodl.S e_log10l.S
e_log2l.S e_logl.S e_powl.S e_remainderl.S e_rem_pio2l.c e_scalbl.S
e_sqrt.c e_sqrtf.c e_sqrtl.c
e_acosl.c $(x86Sources) e_atan2l.c e_exp2l.S e_expl.S e_fmodl.S
e_log10l.S e_log2l.S e_logl.S e_powl.S e_remainderl.S e_rem_pio2l.c
e_scalbl.S e_sqrt.c e_sqrtf.c e_sqrtl.c
;
@ -138,6 +140,10 @@ for architectureObject in [ MultiArchSubDirSetup x86_64 ] {
<$(architecture)>posix_gnu_arch_$(TARGET_ARCH)_generic.o
;
SEARCH on [ FGristFiles $(x86Sources) ]
= [ FDirName $(HAIKU_TOP) src system libroot posix glibc arch x86 ] ;
SEARCH on [ FGristFiles $(genericSources) ]
= [ FDirName $(HAIKU_TOP) src system libroot posix glibc arch
generic ]