|
Packit |
6c4009 |
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
|
|
Packit |
6c4009 |
# Local configure fragment for sysdeps/s390.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
dnl It is always possible to access static and hidden symbols in an
|
|
Packit |
6c4009 |
dnl position independent way.
|
|
Packit |
6c4009 |
AC_DEFINE(PI_STATIC_AND_HIDDEN)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
AC_CACHE_CHECK(for __builtin_tbegin, libc_cv_gcc_builtin_tbegin, [dnl
|
|
Packit |
6c4009 |
cat > conftest.c <<\EOF
|
|
Packit |
6c4009 |
#include <htmintrin.h>
|
|
Packit |
6c4009 |
void testtransaction ()
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
if (__builtin_tbegin (0) == _HTM_TBEGIN_STARTED)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
__builtin_tend ();
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
EOF
|
|
Packit |
6c4009 |
dnl
|
|
Packit |
6c4009 |
dnl test, if the tbegin instruction is used by __builtin_tbegin
|
|
Packit |
6c4009 |
if AC_TRY_COMMAND([${CC-cc} -mhtm -O2 -S conftest.c -o - | grep -w tbegin > /dev/null]) ;
|
|
Packit |
6c4009 |
then
|
|
Packit |
6c4009 |
libc_cv_gcc_builtin_tbegin=yes
|
|
Packit |
6c4009 |
else
|
|
Packit |
6c4009 |
libc_cv_gcc_builtin_tbegin=no
|
|
Packit |
6c4009 |
fi
|
|
Packit |
6c4009 |
rm -f conftest* ])
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
if test "$libc_cv_gcc_builtin_tbegin" = no ; then
|
|
Packit |
6c4009 |
critic_missing="$critic_missing The used GCC has no support for __builtin_tbegin, which is needed for lock-elision on target S390."
|
|
Packit |
6c4009 |
fi
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
AC_CACHE_CHECK(for S390 vector instruction support, libc_cv_asm_s390_vx, [dnl
|
|
Packit |
6c4009 |
cat > conftest.c <<\EOF
|
|
Packit |
6c4009 |
void testvecinsn ()
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
__asm__ (".machine \"z13\" \n\t"
|
|
Packit |
6c4009 |
".machinemode \"zarch_nohighgprs\" \n\t"
|
|
Packit |
6c4009 |
"vistrbs %%v16,%%v17 \n\t"
|
|
Packit |
6c4009 |
"locghie %%r1,0" : :);
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
EOF
|
|
Packit |
6c4009 |
dnl
|
|
Packit |
6c4009 |
dnl test, if assembler supports S390 vector instructions
|
|
Packit |
6c4009 |
if AC_TRY_COMMAND([${CC-cc} --shared conftest.c -o conftest.o &> /dev/null]) ;
|
|
Packit |
6c4009 |
then
|
|
Packit |
6c4009 |
libc_cv_asm_s390_vx=yes
|
|
Packit |
6c4009 |
else
|
|
Packit |
6c4009 |
libc_cv_asm_s390_vx=no
|
|
Packit |
6c4009 |
fi
|
|
Packit |
6c4009 |
rm -f conftest* ])
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
if test "$libc_cv_asm_s390_vx" = yes ;
|
|
Packit |
6c4009 |
then
|
|
Packit |
6c4009 |
AC_DEFINE(HAVE_S390_VX_ASM_SUPPORT)
|
|
Packit |
6c4009 |
else
|
|
Packit |
6c4009 |
AC_MSG_WARN([Use binutils with vector-support in order to use optimized implementations.])
|
|
Packit |
6c4009 |
fi
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
AC_CACHE_CHECK(for S390 vector support in gcc, libc_cv_gcc_s390_vx, [dnl
|
|
Packit |
6c4009 |
cat > conftest.c <<\EOF
|
|
Packit |
6c4009 |
void testvecclobber ()
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
__asm__ ("" : : : "v16");
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
EOF
|
|
Packit |
6c4009 |
dnl
|
|
Packit |
6c4009 |
dnl test, if gcc supports S390 vector registers as clobber in inline assembly
|
|
Packit |
6c4009 |
if AC_TRY_COMMAND([${CC-cc} --shared conftest.c -o conftest.o &> /dev/null]) ;
|
|
Packit |
6c4009 |
then
|
|
Packit |
6c4009 |
libc_cv_gcc_s390_vx=yes
|
|
Packit |
6c4009 |
else
|
|
Packit |
6c4009 |
libc_cv_gcc_s390_vx=no
|
|
Packit |
6c4009 |
fi
|
|
Packit |
6c4009 |
rm -f conftest* ])
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
if test "$libc_cv_gcc_s390_vx" = yes ;
|
|
Packit |
6c4009 |
then
|
|
Packit |
6c4009 |
AC_DEFINE(HAVE_S390_VX_GCC_SUPPORT)
|
|
Packit |
6c4009 |
fi
|
|
Packit |
6c4009 |
|
|
Packit Service |
36afce |
AC_CACHE_CHECK(for S390 arch13 zarch instruction support,
|
|
Packit Service |
36afce |
libc_cv_asm_s390_arch13, [dnl
|
|
Packit Service |
36afce |
cat > conftest.c <<\EOF
|
|
Packit Service |
36afce |
void testinsn (char *buf)
|
|
Packit Service |
36afce |
{
|
|
Packit Service |
36afce |
__asm__ (".machine \"arch13\" \n\t"
|
|
Packit Service |
36afce |
".machinemode \"zarch_nohighgprs\" \n\t"
|
|
Packit Service |
36afce |
"lghi %%r0,16 \n\t"
|
|
Packit Service |
36afce |
"mvcrl 0(%0),32(%0)" : : "a" (buf) : "memory", "r0");
|
|
Packit Service |
36afce |
}
|
|
Packit Service |
36afce |
EOF
|
|
Packit Service |
36afce |
dnl test, if assembler supports S390 arch13 instructions
|
|
Packit Service |
36afce |
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
|
|
Packit Service |
36afce |
-o conftest.o &> /dev/null]) ;
|
|
Packit Service |
36afce |
then
|
|
Packit Service |
36afce |
libc_cv_asm_s390_arch13=yes
|
|
Packit Service |
36afce |
else
|
|
Packit Service |
36afce |
libc_cv_asm_s390_arch13=no
|
|
Packit Service |
36afce |
fi
|
|
Packit Service |
36afce |
rm -f conftest* ])
|
|
Packit Service |
36afce |
if test "$libc_cv_asm_s390_arch13" = yes ;
|
|
Packit Service |
36afce |
then
|
|
Packit Service |
36afce |
AC_DEFINE(HAVE_S390_ARCH13_ASM_SUPPORT)
|
|
Packit Service |
36afce |
fi
|
|
Packit Service |
36afce |
|
|
Packit Service |
36afce |
|
|
Packit Service |
e1ea4c |
AC_CACHE_CHECK(for S390 z10 zarch instruction support as default,
|
|
Packit Service |
e1ea4c |
libc_cv_asm_s390_min_z10_zarch, [dnl
|
|
Packit Service |
e1ea4c |
cat > conftest.c <<\EOF
|
|
Packit Service |
e1ea4c |
void testinsn (void *a, void *b, int n)
|
|
Packit Service |
e1ea4c |
{
|
|
Packit Service |
e1ea4c |
__asm__ ("exrl %2,1f \n\t"
|
|
Packit Service |
e1ea4c |
"j 2f \n\t"
|
|
Packit Service |
e1ea4c |
"1: mvc 0(1,%0),0(%1) \n\t"
|
|
Packit Service |
e1ea4c |
"2:"
|
|
Packit Service |
e1ea4c |
: : "a" (a), "a" (b), "d" (n)
|
|
Packit Service |
e1ea4c |
: "memory", "cc");
|
|
Packit Service |
e1ea4c |
}
|
|
Packit Service |
e1ea4c |
EOF
|
|
Packit Service |
e1ea4c |
dnl
|
|
Packit Service |
e1ea4c |
dnl test, if assembler supports S390 z10 zarch instructions as default
|
|
Packit Service |
e1ea4c |
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
|
|
Packit Service |
e1ea4c |
-o conftest.o &> /dev/null]) ;
|
|
Packit Service |
e1ea4c |
then
|
|
Packit Service |
e1ea4c |
libc_cv_asm_s390_min_z10_zarch=yes
|
|
Packit Service |
e1ea4c |
else
|
|
Packit Service |
e1ea4c |
libc_cv_asm_s390_min_z10_zarch=no
|
|
Packit Service |
e1ea4c |
fi
|
|
Packit Service |
e1ea4c |
rm -f conftest* ])
|
|
Packit Service |
e1ea4c |
|
|
Packit Service |
e1ea4c |
if test "$libc_cv_asm_s390_min_z10_zarch" = yes ;
|
|
Packit Service |
e1ea4c |
then
|
|
Packit Service |
e1ea4c |
AC_DEFINE(HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT)
|
|
Packit Service |
e1ea4c |
fi
|
|
Packit Service |
e1ea4c |
|
|
Packit |
6c4009 |
AC_CACHE_CHECK(for S390 z196 zarch instruction support as default,
|
|
Packit |
6c4009 |
libc_cv_asm_s390_min_z196_zarch, [dnl
|
|
Packit |
6c4009 |
cat > conftest.c <<\EOF
|
|
Packit |
6c4009 |
float testinsn (double e)
|
|
Packit |
6c4009 |
{
|
|
Packit |
6c4009 |
float d;
|
|
Packit |
6c4009 |
__asm__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) );
|
|
Packit |
6c4009 |
return d;
|
|
Packit |
6c4009 |
}
|
|
Packit |
6c4009 |
EOF
|
|
Packit |
6c4009 |
dnl
|
|
Packit |
6c4009 |
dnl test, if assembler supports S390 z196 zarch instructions as default
|
|
Packit |
6c4009 |
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
|
|
Packit |
6c4009 |
-o conftest.o &> /dev/null]) ;
|
|
Packit |
6c4009 |
then
|
|
Packit |
6c4009 |
libc_cv_asm_s390_min_z196_zarch=yes
|
|
Packit |
6c4009 |
else
|
|
Packit |
6c4009 |
libc_cv_asm_s390_min_z196_zarch=no
|
|
Packit |
6c4009 |
fi
|
|
Packit |
6c4009 |
rm -f conftest* ])
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
if test "$libc_cv_asm_s390_min_z196_zarch" = yes ;
|
|
Packit |
6c4009 |
then
|
|
Packit |
6c4009 |
AC_DEFINE(HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT)
|
|
Packit |
6c4009 |
fi
|
|
Packit |
6c4009 |
|
|
Packit Service |
5de704 |
AC_CACHE_CHECK(for S390 z13 zarch instruction support as default,
|
|
Packit Service |
5de704 |
libc_cv_asm_s390_min_z13_zarch, [dnl
|
|
Packit Service |
5de704 |
cat > conftest.c <<\EOF
|
|
Packit Service |
5de704 |
int testinsn (void)
|
|
Packit Service |
5de704 |
{
|
|
Packit Service |
5de704 |
int i;
|
|
Packit Service |
5de704 |
__asm__ ("vl %%v16,0(%%r15)\n\t"
|
|
Packit Service |
5de704 |
"vlgvf %0,%%v16,0"
|
|
Packit Service |
5de704 |
: "=d" (i) : : "memory", "v16");
|
|
Packit Service |
5de704 |
return i;
|
|
Packit Service |
5de704 |
}
|
|
Packit Service |
5de704 |
EOF
|
|
Packit Service |
5de704 |
dnl
|
|
Packit Service |
5de704 |
dnl test, if assembler supports S390 z13 zarch instructions as default
|
|
Packit Service |
5de704 |
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
|
|
Packit Service |
5de704 |
-o conftest.o &> /dev/null]) ;
|
|
Packit Service |
5de704 |
then
|
|
Packit Service |
5de704 |
libc_cv_asm_s390_min_z13_zarch=yes
|
|
Packit Service |
5de704 |
else
|
|
Packit Service |
5de704 |
libc_cv_asm_s390_min_z13_zarch=no
|
|
Packit Service |
5de704 |
fi
|
|
Packit Service |
5de704 |
rm -f conftest* ])
|
|
Packit Service |
5de704 |
|
|
Packit Service |
5de704 |
if test "$libc_cv_asm_s390_min_z13_zarch" = yes ;
|
|
Packit Service |
5de704 |
then
|
|
Packit Service |
5de704 |
AC_DEFINE(HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT)
|
|
Packit Service |
5de704 |
fi
|
|
Packit Service |
5de704 |
|
|
Packit Service |
36afce |
AC_CACHE_CHECK(for S390 arch13 zarch instruction support as default,
|
|
Packit Service |
36afce |
libc_cv_asm_s390_min_arch13_zarch, [dnl
|
|
Packit Service |
36afce |
cat > conftest.c <<\EOF
|
|
Packit Service |
36afce |
void testinsn (char *buf)
|
|
Packit Service |
36afce |
{
|
|
Packit Service |
36afce |
__asm__ ("lghi %%r0,16 \n\t"
|
|
Packit Service |
36afce |
"mvcrl 0(%0),32(%0)" : : "a" (buf) : "memory", "r0");
|
|
Packit Service |
36afce |
}
|
|
Packit Service |
36afce |
EOF
|
|
Packit Service |
36afce |
dnl test, if assembler supports S390 arch13 zarch instructions as default
|
|
Packit Service |
36afce |
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
|
|
Packit Service |
36afce |
-o conftest.o &> /dev/null]) ;
|
|
Packit Service |
36afce |
then
|
|
Packit Service |
36afce |
libc_cv_asm_s390_min_arch13_zarch=yes
|
|
Packit Service |
36afce |
else
|
|
Packit Service |
36afce |
libc_cv_asm_s390_min_arch13_zarch=no
|
|
Packit Service |
36afce |
fi
|
|
Packit Service |
36afce |
rm -f conftest* ])
|
|
Packit Service |
36afce |
if test "$libc_cv_asm_s390_min_arch13_zarch" = yes ;
|
|
Packit Service |
36afce |
then
|
|
Packit Service |
36afce |
AC_DEFINE(HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT)
|
|
Packit Service |
36afce |
fi
|
|
Packit Service |
36afce |
|
|
Packit |
6c4009 |
test -n "$critic_missing" && AC_MSG_ERROR([
|
|
Packit |
6c4009 |
*** $critic_missing])
|