diff mbox series

[uclibc-ng-devel] xtensa: use compiler-provided XCHAL macros

Message ID 20240501120122.1124348-1-jcmvbkbc@gmail.com
State New
Headers show
Series [uclibc-ng-devel] xtensa: use compiler-provided XCHAL macros | expand

Commit Message

Max Filippov May 1, 2024, 12:01 p.m. UTC
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>
---
 .../sysdeps/linux/xtensa/bits/xtensa-config.h | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
diff mbox series

Patch

diff --git a/libc/sysdeps/linux/xtensa/bits/xtensa-config.h b/libc/sysdeps/linux/xtensa/bits/xtensa-config.h
index b99928b1e058..bfcd571d26e2 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 */