]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/s390/configure.ac
S390: Do not set FE_INEXACT with feraiseexcept (FE_OWERFLOW|FE_UNDERFLOW).
[thirdparty/glibc.git] / sysdeps / s390 / configure.ac
1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/s390.
3
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)
7
8 dnl Accept as 2.24 or newer.
9 AC_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
13
14 AC_CACHE_CHECK(for __builtin_tbegin, libc_cv_gcc_builtin_tbegin, [dnl
15 cat > conftest.c <<\EOF
16 #include <htmintrin.h>
17 void testtransaction ()
18 {
19 if (__builtin_tbegin (0) == _HTM_TBEGIN_STARTED)
20 {
21 __builtin_tend ();
22 }
23 }
24 EOF
25 dnl
26 dnl test, if the tbegin instruction is used by __builtin_tbegin
27 if AC_TRY_COMMAND([${CC-cc} -mhtm -O2 -S conftest.c -o - | grep -w tbegin > /dev/null]) ;
28 then
29 libc_cv_gcc_builtin_tbegin=yes
30 else
31 libc_cv_gcc_builtin_tbegin=no
32 fi
33 rm -f conftest* ])
34
35 if 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."
37 fi
38
39
40 AC_CACHE_CHECK(for S390 vector instruction support, libc_cv_asm_s390_vx, [dnl
41 cat > conftest.c <<\EOF
42 void 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 }
49 EOF
50 dnl
51 dnl test, if assembler supports S390 vector instructions
52 if AC_TRY_COMMAND([${CC-cc} --shared conftest.c -o conftest.o &> /dev/null]) ;
53 then
54 libc_cv_asm_s390_vx=yes
55 else
56 libc_cv_asm_s390_vx=no
57 fi
58 rm -f conftest* ])
59
60 if test "$libc_cv_asm_s390_vx" = yes ;
61 then
62 AC_DEFINE(HAVE_S390_VX_ASM_SUPPORT)
63 else
64 AC_MSG_WARN([Use binutils with vector-support in order to use optimized implementations.])
65 fi
66
67 AC_CACHE_CHECK(for S390 vector support in gcc, libc_cv_gcc_s390_vx, [dnl
68 cat > conftest.c <<\EOF
69 void testvecclobber ()
70 {
71 __asm__ ("" : : : "v16");
72 }
73 EOF
74 dnl
75 dnl test, if gcc supports S390 vector registers as clobber in inline assembly
76 if AC_TRY_COMMAND([${CC-cc} --shared conftest.c -o conftest.o &> /dev/null]) ;
77 then
78 libc_cv_gcc_s390_vx=yes
79 else
80 libc_cv_gcc_s390_vx=no
81 fi
82 rm -f conftest* ])
83
84 if test "$libc_cv_gcc_s390_vx" = yes ;
85 then
86 AC_DEFINE(HAVE_S390_VX_GCC_SUPPORT)
87 fi
88
89 AC_CACHE_CHECK(for S390 z196 zarch instruction support as default,
90 libc_cv_asm_s390_min_z196_zarch, [dnl
91 cat > conftest.c <<\EOF
92 float testinsn (double e)
93 {
94 float d;
95 __asm__ ("ledbra %0,5,%1,4" : "=f" (d) : "f" (e) );
96 return d;
97 }
98 EOF
99 dnl
100 dnl test, if assembler supports S390 z196 zarch instructions as default
101 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c
102 -o conftest.o &> /dev/null]) ;
103 then
104 libc_cv_asm_s390_min_z196_zarch=yes
105 else
106 libc_cv_asm_s390_min_z196_zarch=no
107 fi
108 rm -f conftest* ])
109
110 if test "$libc_cv_asm_s390_min_z196_zarch" = yes ;
111 then
112 AC_DEFINE(HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT)
113 fi
114
115 test -n "$critic_missing" && AC_MSG_ERROR([
116 *** $critic_missing])