accel/tcg: Eliminate #if on HAVE_ATOMIC128 and HAVE_CMPXCHG128
authorRichard Henderson <richard.henderson@linaro.org>
Sat, 20 May 2023 01:02:19 +0000 (18:02 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 24 May 2023 01:54:55 +0000 (18:54 -0700)
These symbols will shortly become dynamic runtime tests and
therefore not appropriate for the preprocessor.  Use the
matching CONFIG_* symbols for that purpose.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
accel/tcg/cputlb.c
accel/tcg/user-exec.c
host/include/aarch64/host/atomic128-cas.h
host/include/generic/host/atomic128-ldst.h

index 9cb0b697d184afec3af182637c993c5d4f1b7359..0bd06bf894349d751275400bd55fd901dd4b9155 100644 (file)
@@ -3038,7 +3038,7 @@ void cpu_st16_mmu(CPUArchState *env, target_ulong addr, Int128 val,
 #include "atomic_template.h"
 #endif
 
-#if HAVE_CMPXCHG128 || HAVE_ATOMIC128
+#if defined(CONFIG_ATOMIC128) || defined(CONFIG_CMPXCHG128)
 #define DATA_SIZE 16
 #include "atomic_template.h"
 #endif
index 1e085b121046a2aa3d6cf42e3ad38a2250b79c86..dc8d6b5d4042210ad75da6f42bedc1f88c6c0d39 100644 (file)
@@ -1371,7 +1371,7 @@ static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr,
 #include "atomic_template.h"
 #endif
 
-#if HAVE_ATOMIC128 || HAVE_CMPXCHG128
+#if defined(CONFIG_ATOMIC128) || defined(CONFIG_CMPXCHG128)
 #define DATA_SIZE 16
 #include "atomic_template.h"
 #endif
index 80de58e06d27d727d31b680c6d3313a5188d7cb6..58630107bcce11d817b85fb0f4968e552d67d34c 100644 (file)
@@ -37,6 +37,8 @@ static inline Int128 atomic16_cmpxchg(Int128 *ptr, Int128 cmp, Int128 new)
 
     return int128_make128(oldl, oldh);
 }
+
+# define CONFIG_CMPXCHG128 1
 # define HAVE_CMPXCHG128 1
 #endif
 
index 46911dfb61faf8cde7c588f1939dcfa1a34c7b31..06a62e9dd05eb90141885b2ec4610b9b3b80679b 100644 (file)
@@ -33,7 +33,7 @@ atomic16_set(Int128 *ptr, Int128 val)
 }
 
 # define HAVE_ATOMIC128 1
-#elif !defined(CONFIG_USER_ONLY) && HAVE_CMPXCHG128
+#elif defined(CONFIG_CMPXCHG128) && !defined(CONFIG_USER_ONLY)
 static inline Int128 ATTRIBUTE_ATOMIC128_OPT
 atomic16_read(Int128 *ptr)
 {