Blame sysdeps/s390/configure.ac

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 6f956d
AC_CACHE_CHECK(for S390 arch13 zarch instruction support,
Packit Service 6f956d
	       libc_cv_asm_s390_arch13, [dnl
Packit Service 6f956d
cat > conftest.c <<\EOF
Packit Service 6f956d
void testinsn (char *buf)
Packit Service 6f956d
{
Packit Service 6f956d
    __asm__ (".machine \"arch13\" \n\t"
Packit Service 6f956d
	     ".machinemode \"zarch_nohighgprs\" \n\t"
Packit Service 6f956d
	     "lghi %%r0,16 \n\t"
Packit Service 6f956d
	     "mvcrl 0(%0),32(%0)" : : "a" (buf) : "memory", "r0");
Packit Service 6f956d
}
Packit Service 6f956d
EOF
Packit Service 6f956d
dnl test, if assembler supports S390 arch13 instructions
Packit Service 6f956d
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
Packit Service 6f956d
			-o conftest.o &> /dev/null]) ;
Packit Service 6f956d
then
Packit Service 6f956d
  libc_cv_asm_s390_arch13=yes
Packit Service 6f956d
else
Packit Service 6f956d
  libc_cv_asm_s390_arch13=no
Packit Service 6f956d
fi
Packit Service 6f956d
rm -f conftest* ])
Packit Service 6f956d
if test "$libc_cv_asm_s390_arch13" = yes ;
Packit Service 6f956d
then
Packit Service 6f956d
  AC_DEFINE(HAVE_S390_ARCH13_ASM_SUPPORT)
Packit Service 6f956d
fi
Packit Service 6f956d
Packit Service 6f956d
Packit Service f1a508
AC_CACHE_CHECK(for S390 z10 zarch instruction support as default,
Packit Service f1a508
	       libc_cv_asm_s390_min_z10_zarch, [dnl
Packit Service f1a508
cat > conftest.c <<\EOF
Packit Service f1a508
void testinsn (void *a, void *b, int n)
Packit Service f1a508
{
Packit Service f1a508
    __asm__ ("exrl %2,1f \n\t"
Packit Service f1a508
	     "j 2f \n\t"
Packit Service f1a508
	     "1: mvc 0(1,%0),0(%1) \n\t"
Packit Service f1a508
	     "2:"
Packit Service f1a508
	     : : "a" (a), "a" (b), "d" (n)
Packit Service f1a508
	     : "memory", "cc");
Packit Service f1a508
}
Packit Service f1a508
EOF
Packit Service f1a508
dnl
Packit Service f1a508
dnl test, if assembler supports S390 z10 zarch instructions as default
Packit Service f1a508
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
Packit Service f1a508
			-o conftest.o &> /dev/null]) ;
Packit Service f1a508
then
Packit Service f1a508
  libc_cv_asm_s390_min_z10_zarch=yes
Packit Service f1a508
else
Packit Service f1a508
  libc_cv_asm_s390_min_z10_zarch=no
Packit Service f1a508
fi
Packit Service f1a508
rm -f conftest* ])
Packit Service f1a508
Packit Service f1a508
if test "$libc_cv_asm_s390_min_z10_zarch" = yes ;
Packit Service f1a508
then
Packit Service f1a508
  AC_DEFINE(HAVE_S390_MIN_Z10_ZARCH_ASM_SUPPORT)
Packit Service f1a508
fi
Packit Service f1a508
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 d1cdf0
AC_CACHE_CHECK(for S390 z13 zarch instruction support as default,
Packit Service d1cdf0
	       libc_cv_asm_s390_min_z13_zarch, [dnl
Packit Service d1cdf0
cat > conftest.c <<\EOF
Packit Service d1cdf0
int testinsn (void)
Packit Service d1cdf0
{
Packit Service d1cdf0
    int i;
Packit Service d1cdf0
    __asm__ ("vl %%v16,0(%%r15)\n\t"
Packit Service d1cdf0
	     "vlgvf %0,%%v16,0"
Packit Service d1cdf0
	     : "=d" (i) : : "memory", "v16");
Packit Service d1cdf0
    return i;
Packit Service d1cdf0
}
Packit Service d1cdf0
EOF
Packit Service d1cdf0
dnl
Packit Service d1cdf0
dnl test, if assembler supports S390 z13 zarch instructions as default
Packit Service d1cdf0
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
Packit Service d1cdf0
			-o conftest.o &> /dev/null]) ;
Packit Service d1cdf0
then
Packit Service d1cdf0
  libc_cv_asm_s390_min_z13_zarch=yes
Packit Service d1cdf0
else
Packit Service d1cdf0
  libc_cv_asm_s390_min_z13_zarch=no
Packit Service d1cdf0
fi
Packit Service d1cdf0
rm -f conftest* ])
Packit Service d1cdf0
Packit Service d1cdf0
if test "$libc_cv_asm_s390_min_z13_zarch" = yes ;
Packit Service d1cdf0
then
Packit Service d1cdf0
  AC_DEFINE(HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT)
Packit Service d1cdf0
fi
Packit Service d1cdf0
Packit Service 6f956d
AC_CACHE_CHECK(for S390 arch13 zarch instruction support as default,
Packit Service 6f956d
	       libc_cv_asm_s390_min_arch13_zarch, [dnl
Packit Service 6f956d
cat > conftest.c <<\EOF
Packit Service 6f956d
void testinsn (char *buf)
Packit Service 6f956d
{
Packit Service 6f956d
    __asm__ ("lghi %%r0,16 \n\t"
Packit Service 6f956d
	     "mvcrl 0(%0),32(%0)" : : "a" (buf) : "memory", "r0");
Packit Service 6f956d
}
Packit Service 6f956d
EOF
Packit Service 6f956d
dnl test, if assembler supports S390 arch13 zarch instructions as default
Packit Service 6f956d
if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
Packit Service 6f956d
			-o conftest.o &> /dev/null]) ;
Packit Service 6f956d
then
Packit Service 6f956d
  libc_cv_asm_s390_min_arch13_zarch=yes
Packit Service 6f956d
else
Packit Service 6f956d
  libc_cv_asm_s390_min_arch13_zarch=no
Packit Service 6f956d
fi
Packit Service 6f956d
rm -f conftest* ])
Packit Service 6f956d
if test "$libc_cv_asm_s390_min_arch13_zarch" = yes ;
Packit Service 6f956d
then
Packit Service 6f956d
  AC_DEFINE(HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT)
Packit Service 6f956d
fi
Packit Service 6f956d
Packit 6c4009
test -n "$critic_missing" && AC_MSG_ERROR([
Packit 6c4009
*** $critic_missing])