summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorMarc-André Lureau2022-02-28 12:49:19 +0100
committerMarc-André Lureau2022-03-22 11:46:17 +0100
commit848126d11e93ff2a13d0d816244ed82aef83854f (patch)
tree7b0033ab252d05c5a31f20f011f6c0bbf18ec248 /meson.build
parentqapi: remove needless include (diff)
downloadqemu-848126d11e93ff2a13d0d816244ed82aef83854f.tar.gz
qemu-848126d11e93ff2a13d0d816244ed82aef83854f.tar.xz
qemu-848126d11e93ff2a13d0d816244ed82aef83854f.zip
meson: move int128 checks from configure
(note: the test isn't working as intended, the next patches fixes it) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build39
1 files changed, 39 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 282e7c4650..85f3f84ec6 100644
--- a/meson.build
+++ b/meson.build
@@ -1869,6 +1869,45 @@ config_host_data.set('CONFIG_ATOMIC64', cc.links('''
return 0;
}'''))
+has_int128 = cc.links('''
+ __int128_t a;
+ __uint128_t b;
+ int main (void) {
+ a = a + b;
+ b = a * b;
+ a = a * a;
+ return 0;
+ }''')
+
+config_host_data.set('CONFIG_INT128', has_int128)
+
+if has_int128
+ has_atomic128 = cc.links('''
+ int main(void)
+ {
+ unsigned __int128 x = 0, y = 0;
+ y = __atomic_load(&x, 0);
+ __atomic_store(&x, y, 0);
+ __atomic_compare_exchange(&x, &y, x, 0, 0, 0);
+ return 0;
+ }''')
+
+ config_host_data.set('CONFIG_ATOMIC128', has_atomic128)
+
+ if not has_atomic128
+ has_cmpxchg128 = cc.links('''
+ int main(void)
+ {
+ unsigned __int128 x = 0, y = 0;
+ __sync_val_compare_and_swap_16(&x, y, x);
+ return 0;
+ }
+ ''')
+
+ config_host_data.set('CONFIG_CMPXCHG128', has_cmpxchg128)
+ endif
+endif
+
config_host_data.set('CONFIG_GETAUXVAL', cc.links(gnu_source_prefix + '''
#include <sys/auxv.h>
int main(void) {