summaryrefslogtreecommitdiff
path: root/libc/sysdeps
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2024-05-01 05:01:22 -0700
committerWaldemar Brodkorb <wbx@openadk.org>2024-05-21 06:07:32 +0200
commiteec59f10c4541a6fb6861332bc8428259a232c32 (patch)
treef0457293c27ca781277b31704c421411fba83ba1 /libc/sysdeps
parent799cd4cf0ae124dcd4c80524f564b126e25ac870 (diff)
xtensa: use compiler-provided XCHAL macros
Starting with gcc-13 the compiler provides configuration-specific macro definitions for the target xtensa core. Use them when available instead of the configuration overlay file xtensa-config.h Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'libc/sysdeps')
-rw-r--r--libc/sysdeps/linux/xtensa/bits/xtensa-config.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/xtensa/bits/xtensa-config.h b/libc/sysdeps/linux/xtensa/bits/xtensa-config.h
index b99928b1e..bfcd571d2 100644
--- a/libc/sysdeps/linux/xtensa/bits/xtensa-config.h
+++ b/libc/sysdeps/linux/xtensa/bits/xtensa-config.h
@@ -32,21 +32,41 @@
macros. */
#undef XCHAL_HAVE_NSA
+#ifdef __XCHAL_HAVE_NSA
+#define XCHAL_HAVE_NSA __XCHAL_HAVE_NSA
+#else
#define XCHAL_HAVE_NSA 1
+#endif
#undef XCHAL_HAVE_LOOPS
+#ifdef __XCHAL_HAVE_LOOPS
+#define XCHAL_HAVE_LOOPS __XCHAL_HAVE_LOOPS
+#else
#define XCHAL_HAVE_LOOPS 1
+#endif
/* Assume the maximum number of AR registers. This currently only affects
the __window_spill function, and it is always safe to flush extra. */
#undef XCHAL_NUM_AREGS
+#ifdef __XCHAL_NUM_AREGS
+#define XCHAL_NUM_AREGS __XCHAL_NUM_AREGS
+#else
#define XCHAL_NUM_AREGS 64
+#endif
#undef XCHAL_HAVE_S32C1I
+#ifdef __XCHAL_HAVE_S32C1I
+#define XCHAL_HAVE_S32C1I __XCHAL_HAVE_S32C1I
+#else
#define XCHAL_HAVE_S32C1I 1
+#endif
#undef XCHAL_HAVE_EXCLUSIVE
+#ifdef __XCHAL_HAVE_EXCLUSIVE
+#define XCHAL_HAVE_EXCLUSIVE __XCHAL_HAVE_EXCLUSIVE
+#else
#define XCHAL_HAVE_EXCLUSIVE 0
+#endif
#endif /* !XTENSA_CONFIG_H */