1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/s390.
4 dnl It is always possible to access static and hidden symbols in an
5 dnl position independent way.
6 AC_DEFINE(PI_STATIC_AND_HIDDEN)
8 AC_CACHE_CHECK(for __builtin_tbegin, libc_cv_gcc_builtin_tbegin, [dnl
9 cat > conftest.c <<\EOF
10 #include <htmintrin.h>
11 void testtransaction ()
13 if (__builtin_tbegin (0) == _HTM_TBEGIN_STARTED)
20 dnl test, if the tbegin instruction is used by __builtin_tbegin
21 if AC_TRY_COMMAND([${CC-cc} -mhtm -O2 -S conftest.c -o - | grep -w tbegin > /dev/null]) ;
23 libc_cv_gcc_builtin_tbegin=yes
25 libc_cv_gcc_builtin_tbegin=no
29 if test "$libc_cv_gcc_builtin_tbegin" = no ; then
30 critic_missing="$critic_missing The used GCC has no support for __builtin_tbegin, which is needed for lock-elision on target S390."
34 AC_CACHE_CHECK(for S390 vector instruction support, libc_cv_asm_s390_vx, [dnl
35 cat > conftest.c <<\EOF
38 __asm__ (".machine \"z13\" \n\t"
39 ".machinemode \"zarch_nohighgprs\" \n\t"
40 "vistrbs %%v16,%%v17 \n\t"
41 "locghie %%r1,0" : :);
45 dnl test, if assembler supports S390 vector instructions
46 if AC_TRY_COMMAND([${CC-cc} --shared conftest.c -o conftest.o &> /dev/null]) ;
48 libc_cv_asm_s390_vx=yes
50 libc_cv_asm_s390_vx=no
54 if test "$libc_cv_asm_s390_vx" = yes ;
56 AC_DEFINE(HAVE_S390_VX_ASM_SUPPORT)
58 AC_MSG_WARN([Use binutils with vector-support in order to use optimized implementations.])
61 AC_CACHE_CHECK(for S390 vector support in gcc, libc_cv_gcc_s390_vx, [dnl
62 cat > conftest.c <<\EOF
63 void testvecclobber ()
65 __asm__ ("" : : : "v16");
69 dnl test, if gcc supports S390 vector registers as clobber in inline assembly
70 if AC_TRY_COMMAND([${CC-cc} --shared conftest.c -o conftest.o &> /dev/null]) ;
72 libc_cv_gcc_s390_vx=yes
74 libc_cv_gcc_s390_vx=no
78 if test "$libc_cv_gcc_s390_vx" = yes ;
80 AC_DEFINE(HAVE_S390_VX_GCC_SUPPORT)
83 AC_CACHE_CHECK(for S390 z196 zarch instruction support as default,
84 libc_cv_asm_s390_min_z196_zarch, [dnl
85 cat > conftest.c <<\EOF
86 float testinsn (double e)
89 __asm__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) );
94 dnl test, if assembler supports S390 z196 zarch instructions as default
95 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
96 -o conftest.o &> /dev/null]) ;
98 libc_cv_asm_s390_min_z196_zarch=yes
100 libc_cv_asm_s390_min_z196_zarch=no
104 if test "$libc_cv_asm_s390_min_z196_zarch" = yes ;
106 AC_DEFINE(HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT)
109 test -n "$critic_missing" && AC_MSG_ERROR([
110 *** $critic_missing])