From patchwork Mon Mar 18 15:08:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 1057903 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-100697-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="nEG+J4+o"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44NKP56wZYz9s3q for ; Tue, 19 Mar 2019 02:10:17 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=vMC9gY5T5jQn8Kg4p7zwY9NJk5PnuIa jl6Ka5u8hCk5MaDxHtxj5NCxnPQA/5Tal+sEjvBalnNb4QBeZtQr4JNFKV6vtA17 7l6Z5ajszM90iHh0DPGAMrRVWrVdklmwRMQa7aGj39nxHmart25Vd/7JPpvY+tUQ ZZWCbvS4Qwsc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:in-reply-to:references :message-id; s=default; bh=nnAgwSsuEiecXNnpeFZPlRqyvaI=; b=nEG+J 4+oz/KEpWXtMI5BFbjT8n90Dj4T8A82Gaj8mb7R0/VLmFr1L5AnDJ9+38QDQ6RDp LLji3iUg5A4wxqvSIkXm2VyNSH0gTbHWjL37OybBlFNzwV5bF7HaR7Q6mvL8EqT0 0KwyP3EPF/RHMdQVR5tXCMYgmCyv1VlMGvgm60= Received: (qmail 55903 invoked by alias); 18 Mar 2019 15:09:49 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 55832 invoked by uid 89); 18 Mar 2019 15:09:49 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KHOP_DYNAMIC, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=eval X-HELO: mx0a-001b2d01.pphosted.com From: Stefan Liebler To: libc-alpha@sourceware.org Cc: Stefan Liebler Subject: [PATCH 2/5] S390: Add configure check to detect support for arch13. Date: Mon, 18 Mar 2019 16:08:59 +0100 In-Reply-To: <1552921742-31456-1-git-send-email-stli@linux.ibm.com> References: <1552921742-31456-1-git-send-email-stli@linux.ibm.com> x-cbid: 19031815-0008-0000-0000-000002CEBEC1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19031815-0009-0000-0000-0000223ACD99 Message-Id: <1552921742-31456-2-git-send-email-stli@linux.ibm.com> Add two configure checks which detect if arch13 is supported by the assembler at all - by explicitely setting the machine - and if it is supported with default settings. ChangeLog: * config.h.in (HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT, HAVE_S390_ARCH13_ASM_SUPPORT): New undefine. * sysdeps/s390/configure.ac: Add checks for arch13 support. * sysdeps/s390/configure: Regenerated. --- config.h.in | 6 ++++ sysdeps/s390/configure | 71 +++++++++++++++++++++++++++++++++++++++ sysdeps/s390/configure.ac | 49 +++++++++++++++++++++++++++ 3 files changed, 126 insertions(+) diff --git a/config.h.in b/config.h.in index f059ec0435..824dfe8d8c 100644 --- a/config.h.in +++ b/config.h.in @@ -71,6 +71,9 @@ /* Define if assembler supports z13 zarch instructions as default on S390. */ #undef HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT +/* Define if assembler supports arch13 zarch instruction as default on S390. */ +#undef HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT + /* Define if assembler supports vector instructions on S390. */ #undef HAVE_S390_VX_ASM_SUPPORT @@ -78,6 +81,9 @@ on S390. */ #undef HAVE_S390_VX_GCC_SUPPORT +/* Define if assembler supports arch13 instructions on S390. */ +#undef HAVE_S390_ARCH13_ASM_SUPPORT + /* Define if assembler supports Intel MPX. */ #undef HAVE_MPX_SUPPORT diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure index 4a44775e30..fa46e9e351 100644 --- a/sysdeps/s390/configure +++ b/sysdeps/s390/configure @@ -112,6 +112,43 @@ then fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 arch13 zarch instruction support" >&5 +$as_echo_n "checking for S390 arch13 zarch instruction support... " >&6; } +if ${libc_cv_asm_s390_arch13+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c <<\EOF +void testinsn (char *buf) +{ + __asm__ (".machine \"arch13\" \n\t" + ".machinemode \"zarch_nohighgprs\" \n\t" + "lghi %%r0,16 \n\t" + "mvcrl 0(%0),32(%0)" : : "a" (buf) : "memory", "r0"); +} +EOF +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --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_asm_s390_arch13=yes +else + libc_cv_asm_s390_arch13=no +fi +rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_arch13" >&5 +$as_echo "$libc_cv_asm_s390_arch13" >&6; } +if test "$libc_cv_asm_s390_arch13" = yes ; +then + $as_echo "#define HAVE_S390_ARCH13_ASM_SUPPORT 1" >>confdefs.h + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 z10 zarch instruction support as default" >&5 $as_echo_n "checking for S390 z10 zarch instruction support as default... " >&6; } if ${libc_cv_asm_s390_min_z10_zarch+:} false; then : @@ -225,5 +262,39 @@ then fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for S390 arch13 zarch instruction support as default" >&5 +$as_echo_n "checking for S390 arch13 zarch instruction support as default... " >&6; } +if ${libc_cv_asm_s390_min_arch13_zarch+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c <<\EOF +void testinsn (char *buf) +{ + __asm__ ("lghi %%r0,16 \n\t" + "mvcrl 0(%0),32(%0)" : : "a" (buf) : "memory", "r0"); +} +EOF +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --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_asm_s390_min_arch13_zarch=yes +else + libc_cv_asm_s390_min_arch13_zarch=no +fi +rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_s390_min_arch13_zarch" >&5 +$as_echo "$libc_cv_asm_s390_min_arch13_zarch" >&6; } +if test "$libc_cv_asm_s390_min_arch13_zarch" = yes ; +then + $as_echo "#define HAVE_S390_MIN_ARCH13_ZARCH_ASM_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 4dfb5574b4..3ed5a8ef87 100644 --- a/sysdeps/s390/configure.ac +++ b/sysdeps/s390/configure.ac @@ -80,6 +80,32 @@ then AC_DEFINE(HAVE_S390_VX_GCC_SUPPORT) fi +AC_CACHE_CHECK(for S390 arch13 zarch instruction support, + libc_cv_asm_s390_arch13, [dnl +cat > conftest.c <<\EOF +void testinsn (char *buf) +{ + __asm__ (".machine \"arch13\" \n\t" + ".machinemode \"zarch_nohighgprs\" \n\t" + "lghi %%r0,16 \n\t" + "mvcrl 0(%0),32(%0)" : : "a" (buf) : "memory", "r0"); +} +EOF +dnl test, if assembler supports S390 arch13 instructions +if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c + -o conftest.o &> /dev/null]) ; +then + libc_cv_asm_s390_arch13=yes +else + libc_cv_asm_s390_arch13=no +fi +rm -f conftest* ]) +if test "$libc_cv_asm_s390_arch13" = yes ; +then + AC_DEFINE(HAVE_S390_ARCH13_ASM_SUPPORT) +fi + + AC_CACHE_CHECK(for S390 z10 zarch instruction support as default, libc_cv_asm_s390_min_z10_zarch, [dnl cat > conftest.c <<\EOF @@ -163,5 +189,28 @@ then AC_DEFINE(HAVE_S390_MIN_Z13_ZARCH_ASM_SUPPORT) fi +AC_CACHE_CHECK(for S390 arch13 zarch instruction support as default, + libc_cv_asm_s390_min_arch13_zarch, [dnl +cat > conftest.c <<\EOF +void testinsn (char *buf) +{ + __asm__ ("lghi %%r0,16 \n\t" + "mvcrl 0(%0),32(%0)" : : "a" (buf) : "memory", "r0"); +} +EOF +dnl test, if assembler supports S390 arch13 zarch instructions as default +if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS --shared conftest.c + -o conftest.o &> /dev/null]) ; +then + libc_cv_asm_s390_min_arch13_zarch=yes +else + libc_cv_asm_s390_min_arch13_zarch=no +fi +rm -f conftest* ]) +if test "$libc_cv_asm_s390_min_arch13_zarch" = yes ; +then + AC_DEFINE(HAVE_S390_MIN_ARCH13_ZARCH_ASM_SUPPORT) +fi + test -n "$critic_missing" && AC_MSG_ERROR([ *** $critic_missing])