public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Stefan Liebler <stli@linux.vnet.ibm.com>
To: libc-alpha@sourceware.org
Cc: Stefan Liebler <stli@linux.vnet.ibm.com>
Subject: [PATCH 03/14] S390: Configure check for vector support in gcc.
Date: Tue, 23 Feb 2016 09:22:00 -0000	[thread overview]
Message-ID: <1456219278-5258-4-git-send-email-stli@linux.vnet.ibm.com> (raw)
In-Reply-To: <1456219278-5258-1-git-send-email-stli@linux.vnet.ibm.com>

The S390 specific test checks if the gcc has support for vector registers
by compiling an inline assembly which clobbers vector registers.
On success the macro HAVE_S390_VX_GCC_SUPPORT is defined.
This macro can be used to determine if e.g. clobbering vector registers
is allowed or not.

ChangeLog:

	* config.h.in (HAVE_S390_VX_GCC_SUPPORT): New macro undefine.
	* sysdeps/s390/configure.ac: Add test for S390 vector register
	support in gcc.
	* sysdeps/s390/configure: Regenerated.
---
 config.h.in               |  4 ++++
 sysdeps/s390/configure    | 32 ++++++++++++++++++++++++++++++++
 sysdeps/s390/configure.ac | 21 +++++++++++++++++++++
 3 files changed, 57 insertions(+)

diff --git a/config.h.in b/config.h.in
index 13c0044..0143ef4 100644
--- a/config.h.in
+++ b/config.h.in
@@ -73,6 +73,10 @@
 /* Define if assembler supports vector instructions on S390.  */
 #undef  HAVE_S390_VX_ASM_SUPPORT
 
+/* Define if gcc supports vector registers as clobbers in inline assembly
+   on S390.  */
+#undef  HAVE_S390_VX_GCC_SUPPORT
+
 /* Define if assembler supports Intel MPX.  */
 #undef  HAVE_MPX_SUPPORT
 
diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure
index 0fa54c3..c9fb69c 100644
--- a/sysdeps/s390/configure
+++ b/sysdeps/s390/configure
@@ -144,6 +144,38 @@ else
 $as_echo "$as_me: WARNING: Use binutils with vector-support in order to use optimized implementations." >&2;}
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 vector support in gcc" >&5
+$as_echo_n "checking for S390 vector support in gcc... " >&6; }
+if ${libc_cv_gcc_s390_vx+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.c <<\EOF
+void testvecclobber ()
+{
+  __asm__ ("" : : : "v16");
+}
+EOF
+if { ac_try='${CC-cc} --shared conftest.c -o conftest.o &> /dev/null'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } ;
+then
+  libc_cv_gcc_s390_vx=yes
+else
+  libc_cv_gcc_s390_vx=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gcc_s390_vx" >&5
+$as_echo "$libc_cv_gcc_s390_vx" >&6; }
+
+if test "$libc_cv_gcc_s390_vx" = yes ;
+then
+  $as_echo "#define HAVE_S390_VX_GCC_SUPPORT 1" >>confdefs.h
+
+fi
 
 test -n "$critic_missing" && as_fn_error $? "
 *** $critic_missing" "$LINENO" 5
diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac
index 4da134e..1db6d84 100644
--- a/sysdeps/s390/configure.ac
+++ b/sysdeps/s390/configure.ac
@@ -64,6 +64,27 @@ else
   AC_MSG_WARN([Use binutils with vector-support in order to use optimized implementations.])
 fi
 
+AC_CACHE_CHECK(for S390 vector support in gcc, libc_cv_gcc_s390_vx, [dnl
+cat > conftest.c <<\EOF
+void testvecclobber ()
+{
+  __asm__ ("" : : : "v16");
+}
+EOF
+dnl
+dnl test, if gcc supports S390 vector registers as clobber in inline assembly
+if AC_TRY_COMMAND([${CC-cc} --shared conftest.c -o conftest.o &> /dev/null]) ;
+then
+  libc_cv_gcc_s390_vx=yes
+else
+  libc_cv_gcc_s390_vx=no
+fi
+rm -f conftest* ])
+
+if test "$libc_cv_gcc_s390_vx" = yes ;
+then
+  AC_DEFINE(HAVE_S390_VX_GCC_SUPPORT)
+fi
 
 test -n "$critic_missing" && AC_MSG_ERROR([
 *** $critic_missing])
-- 
2.3.0

  parent reply	other threads:[~2016-02-23  9:21 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23  9:22 [PATCH 00/14] S390: Optimize iconv modules Stefan Liebler
2016-02-23  9:21 ` [PATCH 01/14] S390: Get rid of make warning: overriding recipe for target gconv-modules Stefan Liebler
2016-04-14 14:16   ` Stefan Liebler
2016-04-21 15:00     ` Stefan Liebler
2016-04-28  6:55       ` Stefan Liebler
2016-05-04 13:15         ` [PING] " Stefan Liebler
2016-05-04 13:40           ` Andreas Schwab
2016-05-09 14:33             ` Stefan Liebler
2016-05-18 15:28               ` Stefan Liebler
2016-05-24 15:02                 ` Stefan Liebler
2016-05-25 15:29                   ` [COMMITTED] " Stefan Liebler
2016-05-25 15:37                     ` Joseph Myers
2016-05-25 15:58                       ` Stefan Liebler
2016-05-25 16:32                         ` Joseph Myers
2016-02-23  9:21 ` [PATCH 02/14] S390: Mention s390-specific gconv-modues before common ones Stefan Liebler
2016-04-15 10:27   ` Florian Weimer
2016-04-21 14:50     ` Stefan Liebler
2016-02-23  9:21 ` [PATCH 13/14] Fix ucs4le_internal_loop in error case Stefan Liebler
2016-02-23 17:42   ` Joseph Myers
2016-02-25  9:00     ` Stefan Liebler
2016-03-18 13:04       ` Stefan Liebler
2016-03-31  9:20         ` Stefan Liebler
2016-03-31  9:45       ` Andreas Schwab
2016-02-23  9:22 ` [PATCH 06/14] S390: Optimize iso-8859-1 to ibm037 iconv-module Stefan Liebler
2016-04-21 15:05   ` Stefan Liebler
2016-02-23  9:22 ` [PATCH 11/14] S390: Fix utf32 to utf8 handling of low surrogates (disable cu41) Stefan Liebler
2016-04-21 15:25   ` Stefan Liebler
2016-02-23  9:22 ` [PATCH 05/14] S390: Optimize builtin iconv-modules Stefan Liebler
2016-03-18 12:58   ` Stefan Liebler
2016-04-21 14:51     ` Stefan Liebler
2016-02-23  9:22 ` Stefan Liebler [this message]
2016-02-23  9:22 ` [PATCH 04/14] S390: Optimize 8bit-generic iconv modules Stefan Liebler
2016-04-15 13:05   ` Florian Weimer
2016-04-21 15:35     ` Stefan Liebler
2016-02-23  9:22 ` [PATCH 08/14] S390: Optimize utf8-utf16 module Stefan Liebler
2016-04-21 15:20   ` Stefan Liebler
2016-02-23  9:22 ` [PATCH 12/14] S390: Fix utf32 to utf16 handling of low surrogates (disable cu42) Stefan Liebler
2016-04-21 15:30   ` Stefan Liebler
2016-02-23  9:22 ` [PATCH 07/14] S390: Optimize utf8-utf32 module Stefan Liebler
2016-04-21 15:15   ` Stefan Liebler
2016-02-23  9:22 ` [PATCH 09/14] S390: Optimize utf16-utf32 module Stefan Liebler
2016-04-21 14:55   ` Stefan Liebler
2016-02-23  9:23 ` [PATCH 10/14] S390: Use s390-64 specific ionv-modules on s390-32, too Stefan Liebler
2016-02-23 12:06   ` Stefan Liebler
2016-04-21 15:10   ` Stefan Liebler
2016-02-23  9:23 ` [PATCH 14/14] Fix UTF-16 surrogate handling Stefan Liebler
2016-02-23 17:57   ` Joseph Myers
2016-02-25 12:57     ` Stefan Liebler
2016-03-18 13:05       ` Stefan Liebler
2016-03-22 14:39         ` Stefan Liebler
2016-03-31  9:18           ` Stefan Liebler
2016-04-07 14:35             ` Stefan Liebler
2016-04-07 15:18           ` Andreas Schwab
2016-03-01 15:01 ` [PATCH 00/14] S390: Optimize iconv modules Stefan Liebler
2016-03-08 12:33   ` Stefan Liebler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1456219278-5258-4-git-send-email-stli@linux.vnet.ibm.com \
    --to=stli@linux.vnet.ibm.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).