olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh1375235-1.patch

00db10
From 63be4dc8f5be08f40df927377bdf0bae5239ce53 Mon Sep 17 00:00:00 2001
00db10
From: Stefan Liebler <stli@linux.vnet.ibm.com>
00db10
Date: Thu, 27 Jul 2017 10:53:58 +0200
00db10
Subject: [PATCH 01/10] S390: Configure checks
00db10
 HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT.
00db10
00db10
This configure check was added upstream with commit
00db10
e9b424881a4f85284e56d8b561c54ff57a7c1c9b
00db10
"S390: Do not set FE_INEXACT with feraiseexcept (FE_OWERFLOW|FE_UNDERFLOW)."
00db10
00db10
HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT will be defined if gcc/assembler
00db10
can handle zarch z196 instructions by default.
00db10
Thus it is defined on s390x-glibc on RHEL 7, but not for s390-glibc.
00db10
00db10
ChangeLog:
00db10
00db10
	* config.h.in (HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT):
00db10
	New undefine.
00db10
	* sysdeps/s390/configure.ac: Add test for z196 zarch support.
00db10
	* sysdeps/s390/configure: Regenerated.
00db10
---
00db10
 config.h.in               |  3 +++
00db10
 sysdeps/s390/configure    | 36 ++++++++++++++++++++++++++++++++++++
00db10
 sysdeps/s390/configure.in | 26 ++++++++++++++++++++++++++
00db10
 3 files changed, 65 insertions(+)
00db10
00db10
diff --git a/config.h.in b/config.h.in
00db10
index 66ac85a..07bc713 100644
00db10
--- a/config.h.in
00db10
+++ b/config.h.in
00db10
@@ -110,6 +110,9 @@
00db10
 /* Define if assembler supports Intel MPX.  */
00db10
 #undef  HAVE_MPX_SUPPORT
00db10
 
00db10
+/* Define if assembler supports z196 zarch instructions as default on S390.  */
00db10
+#undef  HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
00db10
+
00db10
 /* Define if assembler supports vector instructions on S390.  */
00db10
 #undef  HAVE_S390_VX_ASM_SUPPORT
00db10
 
00db10
diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure
00db10
index eb49a4c..bb670f3 100644
00db10
--- a/sysdeps/s390/configure
00db10
+++ b/sysdeps/s390/configure
00db10
@@ -75,3 +75,39 @@ then
00db10
   $as_echo "#define HAVE_S390_VX_GCC_SUPPORT 1" >>confdefs.h
00db10
 
00db10
 fi
00db10
+
00db10
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 z196 zarch instruction support as default" >&5
00db10
+$as_echo_n "checking for S390 z196 zarch instruction support as default... " >&6; }
00db10
+if ${libc_cv_asm_s390_min_z196_zarch+:} false; then :
00db10
+  $as_echo_n "(cached) " >&6
00db10
+else
00db10
+  cat > conftest.c <<\EOF
00db10
+float testinsn (double e)
00db10
+{
00db10
+    float d;
00db10
+    __asm__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) );
00db10
+    return d;
00db10
+}
00db10
+EOF
00db10
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
00db10
+			-o conftest.o &> /dev/null'
00db10
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
00db10
+  (eval $ac_try) 2>&5
00db10
+  ac_status=$?
00db10
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
00db10
+  test $ac_status = 0; }; } ;
00db10
+then
00db10
+  libc_cv_asm_s390_min_z196_zarch=yes
00db10
+else
00db10
+  libc_cv_asm_s390_min_z196_zarch=no
00db10
+fi
00db10
+rm -f conftest*
00db10
+fi
00db10
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_min_z196_zarch" >&5
00db10
+$as_echo "$libc_cv_asm_s390_min_z196_zarch" >&6; }
00db10
+
00db10
+if test "$libc_cv_asm_s390_min_z196_zarch" = yes ;
00db10
+then
00db10
+  $as_echo "#define HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT 1" >>confdefs.h
00db10
+
00db10
+fi
00db10
diff --git a/sysdeps/s390/configure.in b/sysdeps/s390/configure.in
00db10
index a3b1f25..bad92bd 100644
00db10
--- a/sysdeps/s390/configure.in
00db10
+++ b/sysdeps/s390/configure.in
00db10
@@ -53,3 +53,29 @@ if test "$libc_cv_gcc_s390_vx" = yes ;
00db10
 then
00db10
   AC_DEFINE(HAVE_S390_VX_GCC_SUPPORT)
00db10
 fi
00db10
+
00db10
+AC_CACHE_CHECK(for S390 z196 zarch instruction support as default,
00db10
+	       libc_cv_asm_s390_min_z196_zarch, [dnl
00db10
+cat > conftest.c <<\EOF
00db10
+float testinsn (double e)
00db10
+{
00db10
+    float d;
00db10
+    __asm__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) );
00db10
+    return d;
00db10
+}
00db10
+EOF
00db10
+dnl
00db10
+dnl test, if assembler supports S390 z196 zarch instructions as default
00db10
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
00db10
+			-o conftest.o &> /dev/null]) ;
00db10
+then
00db10
+  libc_cv_asm_s390_min_z196_zarch=yes
00db10
+else
00db10
+  libc_cv_asm_s390_min_z196_zarch=no
00db10
+fi
00db10
+rm -f conftest* ])
00db10
+
00db10
+if test "$libc_cv_asm_s390_min_z196_zarch" = yes ;
00db10
+then
00db10
+  AC_DEFINE(HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT)
00db10
+fi
00db10
-- 
00db10
1.8.3.1
00db10