]> git.ipfire.org Git - thirdparty/glibc.git/commit
math: Fix x86_64 build for -Os (BZ 33367)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 9 Sep 2025 20:47:21 +0000 (17:47 -0300)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 11 Sep 2025 13:23:33 +0000 (06:23 -0700)
commitb5d88fa6c36bf17d506c235812e20191e4675986
tree5c2509eb220ab0e2db7ac0fb2f42cbb0d09e1c42
parentf0b88eb78416ec822b4c1fd43b85525594dc054f
math: Fix x86_64 build for -Os (BZ 33367)

The compiler might not inline the trunc function call for
USE_TRUNC_BUILTIN [1].

This patch adds an optimized __trunc/__truncf for x86 used
on modf ifunc variant to avoid the trunc libcall.

Checked on x86_64, x86_64-v2, x86_64-v3, and x86_64-v4. Used -O2 and
-Os options. Performed a full make check on x86_64 with both
 optimizations.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121861
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
sysdeps/x86/fpu/math_private.h
sysdeps/x86_64/fpu/multiarch/s_modf-avx.c
sysdeps/x86_64/fpu/multiarch/s_modf-sse4_1.c
sysdeps/x86_64/fpu/multiarch/s_modf.c
sysdeps/x86_64/fpu/multiarch/s_modff-avx.c
sysdeps/x86_64/fpu/multiarch/s_modff-sse4_1.c
sysdeps/x86_64/fpu/multiarch/s_modff.c