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>
This commit is contained in:
parent
0e8d95e27b
commit
848126d11e
47
configure
vendored
47
configure
vendored
@ -2481,41 +2481,6 @@ if compile_prog "" "" ; then
|
|||||||
int128=yes
|
int128=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#########################################
|
|
||||||
# See if 128-bit atomic operations are supported.
|
|
||||||
|
|
||||||
atomic128=no
|
|
||||||
if test "$int128" = "yes"; then
|
|
||||||
cat > $TMPC << EOF
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
if compile_prog "" "" ; then
|
|
||||||
atomic128=yes
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
cmpxchg128=no
|
|
||||||
if test "$int128" = yes && test "$atomic128" = no; then
|
|
||||||
cat > $TMPC << EOF
|
|
||||||
int main(void)
|
|
||||||
{
|
|
||||||
unsigned __int128 x = 0, y = 0;
|
|
||||||
__sync_val_compare_and_swap_16(&x, y, x);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
if compile_prog "" "" ; then
|
|
||||||
cmpxchg128=yes
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
# check if ccache is interfering with
|
# check if ccache is interfering with
|
||||||
# semantic analysis of macros
|
# semantic analysis of macros
|
||||||
@ -2959,18 +2924,6 @@ if test "$have_tsan" = "yes" && test "$have_tsan_iface_fiber" = "yes" ; then
|
|||||||
echo "CONFIG_TSAN=y" >> $config_host_mak
|
echo "CONFIG_TSAN=y" >> $config_host_mak
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$int128" = "yes" ; then
|
|
||||||
echo "CONFIG_INT128=y" >> $config_host_mak
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$atomic128" = "yes" ; then
|
|
||||||
echo "CONFIG_ATOMIC128=y" >> $config_host_mak
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$cmpxchg128" = "yes" ; then
|
|
||||||
echo "CONFIG_CMPXCHG128=y" >> $config_host_mak
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$rdma" = "yes" ; then
|
if test "$rdma" = "yes" ; then
|
||||||
echo "CONFIG_RDMA=y" >> $config_host_mak
|
echo "CONFIG_RDMA=y" >> $config_host_mak
|
||||||
echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak
|
echo "RDMA_LIBS=$rdma_libs" >> $config_host_mak
|
||||||
|
39
meson.build
39
meson.build
@ -1869,6 +1869,45 @@ config_host_data.set('CONFIG_ATOMIC64', cc.links('''
|
|||||||
return 0;
|
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 + '''
|
config_host_data.set('CONFIG_GETAUXVAL', cc.links(gnu_source_prefix + '''
|
||||||
#include <sys/auxv.h>
|
#include <sys/auxv.h>
|
||||||
int main(void) {
|
int main(void) {
|
||||||
|
Loading…
Reference in New Issue
Block a user