]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/s390/configure.ac
S390: configure check for vector instruction support in assembler.
[thirdparty/glibc.git] / sysdeps / s390 / configure.ac
CommitLineData
e6ebd2e4 1GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
bbaf00a6 2# Local configure fragment for sysdeps/s390.
e6ebd2e4 3
e6ebd2e4
UD
4dnl It is always possible to access static and hidden symbols in an
5dnl position independent way.
6AC_DEFINE(PI_STATIC_AND_HIDDEN)
4fa8bc3b
SL
7
8dnl Accept as 2.24 or newer.
9AC_CHECK_PROG_VER(AS, $AS, --version,
10 [GNU assembler.* \([0-9]*\.[0-9.]*\)],
11 [2.2[4-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*], critic_missing="$critic_missing The program AS is required in version >= 2.24 for target S390.")
12
5a414ff7
DV
13
14AC_CACHE_CHECK(for __builtin_tbegin, libc_cv_gcc_builtin_tbegin, [dnl
15cat > conftest.c <<\EOF
16#include <htmintrin.h>
17void testtransaction ()
18{
19 if (__builtin_tbegin (0) == _HTM_TBEGIN_STARTED)
20 {
21 __builtin_tend ();
22 }
23}
24EOF
25dnl
26dnl test, if the tbegin instruction is used by __builtin_tbegin
27if AC_TRY_COMMAND([${CC-cc} -mhtm -O2 -S conftest.c -o - | grep -w tbegin > /dev/null]) ;
28then
29 libc_cv_gcc_builtin_tbegin=yes
30else
31 libc_cv_gcc_builtin_tbegin=no
32fi
33rm -f conftest* ])
34
35if test "$enable_lock_elision" = yes && test "$libc_cv_gcc_builtin_tbegin" = no ; then
36 critic_missing="$critic_missing The used GCC has no support for __builtin_tbegin, which is needed for lock-elision on target S390."
37fi
38
4f0a1cea
SL
39
40AC_CACHE_CHECK(for S390 vector instruction support, libc_cv_asm_s390_vx, [dnl
41cat > conftest.c <<\EOF
42void testvecinsn ()
43{
44 __asm__ (".machine \"z13\" \n\t"
45 ".machinemode \"zarch_nohighgprs\" \n\t"
46 "vistrbs %%v16,%%v17 \n\t"
47 "locghie %%r1,0" : :);
48}
49EOF
50dnl
51dnl test, if assembler supports S390 vector instructions
52if AC_TRY_COMMAND([${CC-cc} --shared conftest.c -o conftest.o &> /dev/null]) ;
53then
54 libc_cv_asm_s390_vx=yes
55else
56 libc_cv_asm_s390_vx=no
57fi
58rm -f conftest* ])
59
60if test "$libc_cv_asm_s390_vx" = yes ;
61then
62 AC_DEFINE(HAVE_S390_VX_ASM_SUPPORT)
63else
64 AC_MSG_WARN([Use binutils with vector-support in order to use optimized implementations.])
65fi
66
67
4fa8bc3b
SL
68test -n "$critic_missing" && AC_MSG_ERROR([
69*** $critic_missing])