From patchwork Tue Jun 16 08:26:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schulze Frielinghaus X-Patchwork-Id: 1310123 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=QoKf9KIf; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49mLvg4Sl1z9sRN for ; Tue, 16 Jun 2020 18:29:03 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 68C50388A82B; Tue, 16 Jun 2020 08:29:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68C50388A82B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592296141; bh=nVe1ONwo5x0nxgXR8z2nqnw30yTRcHsX9s+iJY+BCP4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=QoKf9KIfOGZ8c5eRfME5+o0SEl9evfi2LCWX49H0NBgyba+fnZTsu8ysdRCHwYuss mVUUuniYS41rujm7NMYsemmz1v9svwaUI2X522s0Qt/lkqWy9k2LdZqcsd5kbTeLzu 8NtVfJ7cl8KPipJVJUYBr7K4r6hXset3epI1wWJY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 4D68A383E832 for ; Tue, 16 Jun 2020 08:28:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4D68A383E832 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05G85jTZ106415 for ; Tue, 16 Jun 2020 04:28:55 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 31mtxfn73f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 16 Jun 2020 04:28:55 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 05G8Lrt5022110 for ; Tue, 16 Jun 2020 08:28:54 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma04ams.nl.ibm.com with ESMTP id 31mpe7vyb8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 16 Jun 2020 08:28:53 +0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 05G8SpOL9109854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Jun 2020 08:28:51 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1788A42045; Tue, 16 Jun 2020 08:28:51 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E84BC42041; Tue, 16 Jun 2020 08:28:50 +0000 (GMT) Received: from m35lp38.lnxne.boe (unknown [9.152.108.100]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 16 Jun 2020 08:28:50 +0000 (GMT) To: gcc-patches@gcc.gnu.org, krebbel@linux.ibm.com Subject: [PATCH] S/390: Emit vector alignment hints for z13 if AS accepts them Date: Tue, 16 Jun 2020 10:26:28 +0200 Message-Id: <20200616082627.2560620-1-stefansf@linux.ibm.com> X-Mailer: git-send-email 2.25.3 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.687 definitions=2020-06-16_02:2020-06-15, 2020-06-16 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 suspectscore=9 phishscore=0 lowpriorityscore=0 mlxscore=0 cotscore=-2147483648 bulkscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006160058 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Stefan Schulze Frielinghaus via Gcc-patches From: Stefan Schulze Frielinghaus Reply-To: Stefan Schulze Frielinghaus Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Since 87cb9423add vector alignment hints are emitted for target z13, too. This patch changes this behaviour in the sense that alignment hints are only emitted for target z13 if the assembler accepts them. Bootstrapped and regtested on S/390. Ok for master? gcc/ChangeLog: * config.in: Regenerate. * config/s390/s390.c (print_operand): Emit vector alignment hints for target z13, if AS accepts them. For other targets the logic stays the same. * config/s390/s390.h (TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS): Define macro. * configure: Regenerate. * configure.ac: Check HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13. --- gcc/config.in | 7 +++++++ gcc/config/s390/s390.c | 4 +--- gcc/config/s390/s390.h | 7 +++++++ gcc/configure | 31 +++++++++++++++++++++++++++++++ gcc/configure.ac | 5 +++++ 5 files changed, 51 insertions(+), 3 deletions(-) diff --git a/gcc/config.in b/gcc/config.in index 809e7b26823..364eba47737 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -706,6 +706,13 @@ #endif +/* Define if your assembler supports vl/vst/vlm/vstm with an optional + alignment hint argument on z13. */ +#ifndef USED_FOR_TARGET +#undef HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13 +#endif + + /* Define if your assembler supports VSX instructions. */ #ifndef USED_FOR_TARGET #undef HAVE_AS_VSX diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 56e3e87425a..758315c0c72 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -7853,15 +7853,13 @@ print_operand (FILE *file, rtx x, int code) switch (code) { case 'A': -#ifdef HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS - if (TARGET_Z13 && MEM_P (x)) + if (TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS && MEM_P (x)) { if (MEM_ALIGN (x) >= 128) fprintf (file, ",4"); else if (MEM_ALIGN (x) == 64) fprintf (file, ",3"); } -#endif return; case 'C': fprintf (file, s390_branch_condition_mnemonic (x, FALSE)); diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index 2e29dbe97e8..e4ef63e4080 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -167,6 +167,13 @@ enum processor_flags (TARGET_VX && TARGET_CPU_VXE2) #define TARGET_VXE2_P(opts) \ (TARGET_VX_P (opts) && TARGET_CPU_VXE2_P (opts)) +#if defined(HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13) +#define TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS TARGET_Z13 +#elif defined(HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS) +#define TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS TARGET_Z14 +#else +#define TARGET_VECTOR_LOADSTORE_ALIGNMENT_HINTS 0 +#endif #ifdef HAVE_AS_MACHINE_MACHINEMODE #define S390_USE_TARGET_ATTRIBUTE 1 diff --git a/gcc/configure b/gcc/configure index def9d9a48be..f224679ed3e 100755 --- a/gcc/configure +++ b/gcc/configure @@ -28241,6 +28241,37 @@ if test $gcc_cv_as_s390_vector_loadstore_alignment_hints = yes; then $as_echo "#define HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS 1" >>confdefs.h +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for vector load/store alignment hints on z13" >&5 +$as_echo_n "checking assembler for vector load/store alignment hints on z13... " >&6; } +if ${gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13+:} false; then : + $as_echo_n "(cached) " >&6 +else + gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13=no + if test x$gcc_cv_as != x; then + $as_echo ' vl %v24,0(%r15),3 ' > conftest.s + if { ac_try='$gcc_cv_as $gcc_cv_as_flags -mzarch -march=z13 -o conftest.o conftest.s >&5' + { { 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 + gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13=yes + else + echo "configure: failed program was" >&5 + cat conftest.s >&5 + fi + rm -f conftest.o conftest.s + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13" >&5 +$as_echo "$gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13" >&6; } +if test $gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13 = yes; then + +$as_echo "#define HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13 1" >>confdefs.h + fi diff --git a/gcc/configure.ac b/gcc/configure.ac index e769c9c87d4..e83f0833ef3 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -5106,6 +5106,11 @@ configured with --enable-newlib-nano-formatted-io.]) [ vl %v24,0(%r15),3 ],, [AC_DEFINE(HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS, 1, [Define if your assembler supports vl/vst/vlm/vstm with an optional alignment hint argument.])]) + gcc_GAS_CHECK_FEATURE([vector load/store alignment hints on z13], + gcc_cv_as_s390_vector_loadstore_alignment_hints_on_z13,, [-mzarch -march=z13], + [ vl %v24,0(%r15),3 ],, + [AC_DEFINE(HAVE_AS_VECTOR_LOADSTORE_ALIGNMENT_HINTS_ON_Z13, 1, + [Define if your assembler supports vl/vst/vlm/vstm with an optional alignment hint argument on z13.])]) ;; esac