From patchwork Tue Apr 2 11:20:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 1074245 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=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-498747-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com 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 44YRcz3gg0z9sTQ for ; Tue, 2 Apr 2019 22:22:09 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:in-reply-to:references:message-id; q=dns; s= default; b=vAf+jN7THGYTxL8UP/6PoHc0pvFwRdLD905M/NansHjpkJXljCnze pmGhdvjcGyymWzfqdWZHw4j68SWOqqjBlXrXXjQpx1XfzwZN9huI1vCYxDsiXOMa JZ8vAwVcfSrS/5Vg0ML7kP8ZJw88eWmVfF9pYFyCSnwrvgJWHYojP0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:in-reply-to:references:message-id; s=default; bh=VjYpkt6bXEnyXA5eIxnF3vgTHpQ=; b=KGPodNmm0nyykgvTYtllTxFLleDC VIpYAfMVVapJY/b9hlo3SGcNR0F63wmn9VAuZ9vFB8cgZXO+DztRFvXaXl3xjN4b lcNdMfAXK6pBYhO2tFgkwgMkYNP0OlVhVIKhD6kDtBtlWT6Lgp8EHwMr8AeOL3lJ R+7p8BUnXZHRr54= Received: (qmail 71934 invoked by alias); 2 Apr 2019 11:22:01 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 71925 invoked by uid 89); 2 Apr 2019 11:22:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.4 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=cS, 8192 X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 02 Apr 2019 11:21:58 +0000 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x32BGEUj018604 for ; Tue, 2 Apr 2019 07:21:56 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2rm53865kx-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 02 Apr 2019 07:21:31 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 2 Apr 2019 12:21:05 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 2 Apr 2019 12:21:04 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x32BL3ST62259316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 2 Apr 2019 11:21:04 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D5A314203F for ; Tue, 2 Apr 2019 11:21:03 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A625642041 for ; Tue, 2 Apr 2019 11:21:03 +0000 (GMT) Received: from nelson.boeblingen.de.ibm.com (unknown [9.152.97.200]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS for ; Tue, 2 Apr 2019 11:21:03 +0000 (GMT) From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [PATCH 01/14] S/390: arch13: Add arch13 as architecture option Date: Tue, 2 Apr 2019 13:20:48 +0200 In-Reply-To: <1554204061-30488-1-git-send-email-krebbel@linux.ibm.com> References: <1554204061-30488-1-git-send-email-krebbel@linux.ibm.com> x-cbid: 19040211-0008-0000-0000-000002D55353 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19040211-0009-0000-0000-00002241567F Message-Id: <1554204061-30488-2-git-send-email-krebbel@linux.ibm.com> X-IsSubscribed: yes This patch enables the command line options and provides the proper macros for checking. gcc/ChangeLog: 2019-04-02 Andreas Krebbel * common/config/s390/s390-common.c (processor_flags_table): New entry for arch13. * config.gcc: Support arch13 with the --with-arch= configure flag. * config/s390/driver-native.c (s390_host_detect_local_cpu): * config/s390/s390-opts.h (enum processor_type): Add PROCESSOR_ARCH13. * config/s390/s390.c (s390_get_sched_attrmask) (s390_get_unit_mask): Add PROCESSOR_ARCH13. * config/s390/s390.h (enum processor_flags): Add PF_VXE2 and PF_ARCH13. * config/s390/s390.md (TARGET_CPU_ARCH13, TARGET_CPU_ARCH13_P) (TARGET_CPU_VXE2, TARGET_CPU_VXE2_P, TARGET_ARCH13) (TARGET_ARCH13_P, TARGET_VXE2, TARGET_VXE2_P): New macro definitions. * config/s390/s390.opt: Support arch13 as processor type in command line options. gcc/testsuite/ChangeLog: 2019-04-02 Andreas Krebbel * gcc.target/s390/s390.exp: Run tests in arch13 subdir. * lib/target-supports.exp (check_effective_target_s390_vxe2): New runtime check for the vxe2 hardware feature on IBM Z. --- gcc/common/config/s390/s390-common.c | 21 ++++++++++++--------- gcc/config.gcc | 2 +- gcc/config/s390/driver-native.c | 2 +- gcc/config/s390/s390-opts.h | 1 + gcc/config/s390/s390.c | 3 +++ gcc/config/s390/s390.h | 19 ++++++++++++++++++- gcc/config/s390/s390.md | 10 +++++++++- gcc/config/s390/s390.opt | 3 +++ gcc/testsuite/gcc.target/s390/s390.exp | 3 +++ gcc/testsuite/lib/target-supports.exp | 16 ++++++++++++++++ 10 files changed, 67 insertions(+), 13 deletions(-) diff --git a/gcc/common/config/s390/s390-common.c b/gcc/common/config/s390/s390-common.c index 95699fb..f9c3a95 100644 --- a/gcc/common/config/s390/s390-common.c +++ b/gcc/common/config/s390/s390-common.c @@ -32,21 +32,24 @@ EXPORTED_CONST int processor_flags_table[] = /* z900 */ PF_IEEE_FLOAT | PF_ZARCH, /* z990 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT, /* z9-109 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT - | PF_EXTIMM, + | PF_EXTIMM, /* z9-ec */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT - | PF_EXTIMM | PF_DFP, + | PF_EXTIMM | PF_DFP, /* z10 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT - | PF_EXTIMM | PF_DFP | PF_Z10, + | PF_EXTIMM | PF_DFP | PF_Z10, /* z196 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT - | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196, + | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196, /* zEC12 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT - | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX, + | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX, /* z13 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT - | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX - | PF_Z13 | PF_VX, + | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX + | PF_Z13 | PF_VX, /* z14 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT - | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX - | PF_Z13 | PF_VX | PF_VXE | PF_Z14 + | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX + | PF_Z13 | PF_VX | PF_VXE | PF_Z14, + /* arch13 */ PF_IEEE_FLOAT | PF_ZARCH | PF_LONG_DISPLACEMENT + | PF_EXTIMM | PF_DFP | PF_Z10 | PF_Z196 | PF_ZEC12 | PF_TX + | PF_Z13 | PF_VX | PF_VXE | PF_Z14 | PF_VXE2 | PF_ARCH13 }; /* Change optimizations to be performed, depending on the diff --git a/gcc/config.gcc b/gcc/config.gcc index 3eb2e80..0a8830a 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -4727,7 +4727,7 @@ case "${target}" in for which in arch tune; do eval "val=\$with_$which" case ${val} in - "" | native | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13 | z14 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12) + "" | native | z900 | z990 | z9-109 | z9-ec | z10 | z196 | zEC12 | z13 | z14 | arch5 | arch6 | arch7 | arch8 | arch9 | arch10 | arch11 | arch12 | arch13 ) # OK ;; *) diff --git a/gcc/config/s390/driver-native.c b/gcc/config/s390/driver-native.c index 95b85f0..0352a79 100644 --- a/gcc/config/s390/driver-native.c +++ b/gcc/config/s390/driver-native.c @@ -120,7 +120,7 @@ s390_host_detect_local_cpu (int argc, const char **argv) cpu = "z14"; break; default: - cpu = "z14"; + cpu = "arch13"; break; } } diff --git a/gcc/config/s390/s390-opts.h b/gcc/config/s390/s390-opts.h index e58eee4..db9dc62 100644 --- a/gcc/config/s390/s390-opts.h +++ b/gcc/config/s390/s390-opts.h @@ -37,6 +37,7 @@ enum processor_type PROCESSOR_2827_ZEC12, PROCESSOR_2964_Z13, PROCESSOR_3906_Z14, + PROCESSOR_ARCH13, PROCESSOR_NATIVE, PROCESSOR_max }; diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 5f26437..5c55ebe 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -337,6 +337,7 @@ const struct s390_processor processor_table[] = { "zEC12", "zEC12", PROCESSOR_2827_ZEC12, &zEC12_cost, 10 }, { "z13", "z13", PROCESSOR_2964_Z13, &zEC12_cost, 11 }, { "z14", "arch12", PROCESSOR_3906_Z14, &zEC12_cost, 12 }, + { "arch13", "", PROCESSOR_ARCH13, &zEC12_cost, 13 }, { "native", "", PROCESSOR_NATIVE, NULL, 0 } }; @@ -14313,6 +14314,7 @@ s390_get_sched_attrmask (rtx_insn *insn) mask |= S390_SCHED_ATTR_MASK_GROUPOFTWO; break; case PROCESSOR_3906_Z14: + case PROCESSOR_ARCH13: if (get_attr_z14_cracked (insn)) mask |= S390_SCHED_ATTR_MASK_CRACKED; if (get_attr_z14_expanded (insn)) @@ -14349,6 +14351,7 @@ s390_get_unit_mask (rtx_insn *insn, int *units) mask |= 1 << 3; break; case PROCESSOR_3906_Z14: + case PROCESSOR_ARCH13: *units = 4; if (get_attr_z14_unit_lsu (insn)) mask |= 1 << 0; diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index fcb85d6..c7aa67c 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -39,7 +39,9 @@ enum processor_flags PF_Z13 = 512, PF_VX = 1024, PF_Z14 = 2048, - PF_VXE = 4096 + PF_VXE = 4096, + PF_VXE2 = 8192, + PF_ARCH13 = 16384 }; /* This is necessary to avoid a warning about comparing different enum @@ -98,6 +100,14 @@ enum processor_flags (s390_arch_flags & PF_VXE) #define TARGET_CPU_VXE_P(opts) \ (opts->x_s390_arch_flags & PF_VXE) +#define TARGET_CPU_ARCH13 \ + (s390_arch_flags & PF_ARCH13) +#define TARGET_CPU_ARCH13_P(opts) \ + (opts->x_s390_arch_flags & PF_ARCH13) +#define TARGET_CPU_VXE2 \ + (s390_arch_flags & PF_VXE2) +#define TARGET_CPU_VXE2_P(opts) \ + (opts->x_s390_arch_flags & PF_VXE2) #define TARGET_HARD_FLOAT_P(opts) (!TARGET_SOFT_FLOAT_P(opts)) @@ -150,6 +160,13 @@ enum processor_flags (TARGET_VX && TARGET_CPU_VXE) #define TARGET_VXE_P(opts) \ (TARGET_VX_P (opts) && TARGET_CPU_VXE_P (opts)) +#define TARGET_ARCH13 (TARGET_ZARCH && TARGET_CPU_ARCH13) +#define TARGET_ARCH13_P(opts) \ + (TARGET_ZARCH_P (opts->x_target_flags) && TARGET_CPU_ARCH13_P (opts)) +#define TARGET_VXE2 \ + (TARGET_VX && TARGET_CPU_VXE2) +#define TARGET_VXE2_P(opts) \ + (TARGET_VX_P (opts) && TARGET_CPU_VXE2_P (opts)) #ifdef HAVE_AS_MACHINE_MACHINEMODE #define S390_USE_TARGET_ATTRIBUTE 1 diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index b455b63..bbe1ea5 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -510,7 +510,7 @@ (const (symbol_ref "s390_tune_attr"))) (define_attr "cpu_facility" - "standard,ieee,zarch,cpu_zarch,longdisp,extimm,dfp,z10,z196,zEC12,vx,z13,z14,vxe" + "standard,ieee,zarch,cpu_zarch,longdisp,extimm,dfp,z10,z196,zEC12,vx,z13,z14,vxe,arch13,vxe2" (const_string "standard")) (define_attr "enabled" "" @@ -567,6 +567,14 @@ (and (eq_attr "cpu_facility" "vxe") (match_test "TARGET_VXE")) (const_int 1) + + (and (eq_attr "cpu_facility" "arch13") + (match_test "TARGET_ARCH13")) + (const_int 1) + + (and (eq_attr "cpu_facility" "vxe2") + (match_test "TARGET_VXE2")) + (const_int 1) ] (const_int 0))) diff --git a/gcc/config/s390/s390.opt b/gcc/config/s390/s390.opt index b6d987c..0fb738f 100644 --- a/gcc/config/s390/s390.opt +++ b/gcc/config/s390/s390.opt @@ -110,6 +110,9 @@ EnumValue Enum(processor_type) String(arch12) Value(PROCESSOR_3906_Z14) EnumValue +Enum(processor_type) String(arch13) Value(PROCESSOR_ARCH13) + +EnumValue Enum(processor_type) String(native) Value(PROCESSOR_NATIVE) DriverOnly mbackchain diff --git a/gcc/testsuite/gcc.target/s390/s390.exp b/gcc/testsuite/gcc.target/s390/s390.exp index 4dfb8b5..86f7e43 100644 --- a/gcc/testsuite/gcc.target/s390/s390.exp +++ b/gcc/testsuite/gcc.target/s390/s390.exp @@ -215,6 +215,9 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/target-attribute/*.{c,S}]] \ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/arch12/*.{c,S}]] \ "" "-O3 -march=arch12 -mzarch" +dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/arch13/*.{c,S}]] \ + "" "-O3 -march=arch13 -mzarch" + dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/vxe/*.{c,S}]] \ "" "-O3 -march=arch12 -mzarch" diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 90efaea..0dc1e18 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -8961,6 +8961,22 @@ proc check_effective_target_s390_vxe { } { } "-march=z14 -mzarch" ] } +# Same as above but for the arch13 vector enhancement facility. Test +# is performed with the vector shift left double by bit instruction. +proc check_effective_target_s390_vxe2 { } { + if ![istarget s390*-*-*] then { + return 0; + } + + return [check_runtime s390_check_vxe2 { + int main (void) + { + asm ("vsld %%v24, %%v26, %%v28, 3" : : : "v24", "v26", "v28"); + return 0; + } + } "-march=arch13 -mzarch" ] +} + #For versions of ARM architectures that have hardware div insn, #disable the divmod transform