mirror of git://sourceware.org/git/glibc.git
x86: Fix x86_64 build failure with -Os (BZ 33367)
The13cfd77bf5change broke theb5d88fa6c3fix by removing the symbol to __symbol redirections. Although it works for -O2 with both gcc and clang, with -Os without the redirection, the libcall might still be issued. This patch reinstates theb5d88fa6c3fix, with a modification that allows each ifunc variant to control which trunc to issue. This is required for clang, which defines HAVE_X86_INLINE_TRUNC to 1 (meaning that trunc will always be lowered to the instruction on -Os). Checked on x86_64-linux-gnu with -O2 and -Os with gcc-15 and clang-18. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
parent
8efe2b03db
commit
422c3a5baf
|
|
@ -25,12 +25,15 @@ __modf (double x, double *iptr)
|
|||
{
|
||||
uint64_t t = asuint64 (x);
|
||||
#if USE_TRUNC_BUILTIN
|
||||
# ifndef TRUNC
|
||||
# define TRUNC trunc
|
||||
# endif
|
||||
if (is_inf (t))
|
||||
{
|
||||
*iptr = x;
|
||||
return copysign (0.0, x);
|
||||
}
|
||||
*iptr = trunc (x);
|
||||
*iptr = TRUNC (x);
|
||||
return copysign (x - *iptr, x);
|
||||
#else
|
||||
int e = get_exponent (t);
|
||||
|
|
|
|||
|
|
@ -25,12 +25,15 @@ __modff (float x, float *iptr)
|
|||
{
|
||||
uint32_t t = asuint (x);
|
||||
#if USE_TRUNCF_BUILTIN
|
||||
# ifndef TRUNCF
|
||||
# define TRUNCF truncf
|
||||
# endif
|
||||
if (is_inf (t))
|
||||
{
|
||||
*iptr = x;
|
||||
return copysignf (0.0, x);
|
||||
}
|
||||
*iptr = truncf (x);
|
||||
*iptr = TRUNCF (x);
|
||||
return copysignf (x - *iptr, x);
|
||||
#else
|
||||
int e = get_exponent (t);
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
#define __modf __modf_avx
|
||||
#define TRUNC __trunc
|
||||
#include <sysdeps/ieee754/dbl-64/s_modf.c>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
#define __modf __modf_sse41
|
||||
#define TRUNC __trunc
|
||||
#include <sysdeps/ieee754/dbl-64/s_modf.c>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
#define __modff __modff_avx
|
||||
#define TRUNCF __truncf
|
||||
#include <sysdeps/ieee754/flt-32/s_modff.c>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
#define __modff __modff_sse41
|
||||
#define TRUNCF __truncf
|
||||
#include <sysdeps/ieee754/flt-32/s_modff.c>
|
||||
|
|
|
|||
Loading…
Reference in New Issue