Skip to content

release/19.x: [compiler-rt] Stop using x86 builtin on AArch64 with GCC (#93890) #115006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions compiler-rt/lib/builtins/int_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,12 @@
#define crt_copysign(x, y) __builtin_copysign((x), (y))
#define crt_copysignf(x, y) __builtin_copysignf((x), (y))
#define crt_copysignl(x, y) __builtin_copysignl((x), (y))
#if __has_builtin(__builtin_copysignf128)
// We define __has_builtin to always return 0 for GCC versions below 10,
// but __builtin_copysignf128 is available since version 7.
#if __has_builtin(__builtin_copysignf128) || \
(defined(__GNUC__) && __GNUC__ >= 7)
#define crt_copysignf128(x, y) __builtin_copysignf128((x), (y))
#elif __has_builtin(__builtin_copysignq) || (defined(__GNUC__) && __GNUC__ >= 7)
#elif __has_builtin(__builtin_copysignq)
#define crt_copysignf128(x, y) __builtin_copysignq((x), (y))
#endif
#endif
Expand All @@ -80,9 +83,11 @@
#define crt_fabs(x) __builtin_fabs((x))
#define crt_fabsf(x) __builtin_fabsf((x))
#define crt_fabsl(x) __builtin_fabsl((x))
#if __has_builtin(__builtin_fabsf128)
// We define __has_builtin to always return 0 for GCC versions below 10,
// but __builtin_fabsf128 is available since version 7.
#if __has_builtin(__builtin_fabsf128) || (defined(__GNUC__) && __GNUC__ >= 7)
#define crt_fabsf128(x) __builtin_fabsf128((x))
#elif __has_builtin(__builtin_fabsq) || (defined(__GNUC__) && __GNUC__ >= 7)
#elif __has_builtin(__builtin_fabsq)
#define crt_fabsf128(x) __builtin_fabsq((x))
#endif
#endif
Expand Down
Loading