From patchwork Mon May 25 05:39:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kumar, Venkataramanan" X-Patchwork-Id: 476083 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 5FA42140D2D for ; Mon, 25 May 2015 15:40:03 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=RaPjRLfF; dkim-atps=neutral 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:message-id:content-type:mime-version; q=dns; s= default; b=xHLk3Sou4Akc2ze4xD8TuN+ktV4NEUYci9rmLQ7ADIrq602J3rHuD oRcfUUt22Mbwg4kAiytjbEYkp629OfunxK/FfsUEtrBhQZewLJq4sDbKpkK/V6HT aS8McwXgqTDoDxhZhPuDdOph6H2tm34xD7urfWbANw+e3DHfD9hCp8= 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:message-id:content-type:mime-version; s= default; bh=FsHh0YTQveA6Ug0LfuqoAHAj+9E=; b=RaPjRLfFGiM3uyd5dRk+ JBXlJlW0oq5HFWmKTH5P7Pi1TxxsCTLQZN4VPEj/1taR0vINTM6wE3C6LA2AR5em 4rWKkiPYioxPxhZaKHiRuyBWc9WF2rPB91dC7t52I47c8DURb19HaktqubWIOWil MUdS+dnI7hbZPxaNr84rhMM= Received: (qmail 76234 invoked by alias); 25 May 2015 05:39:55 -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 76225 invoked by uid 89); 25 May 2015 05:39:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: na01-bn1-obe.outbound.protection.outlook.com Received: from mail-bn1on0142.outbound.protection.outlook.com (HELO na01-bn1-obe.outbound.protection.outlook.com) (157.56.110.142) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Mon, 25 May 2015 05:39:44 +0000 Received: from CY1PR02MB1120.namprd02.prod.outlook.com (25.163.15.146) by CY1PR02MB1215.namprd02.prod.outlook.com (25.163.16.145) with Microsoft SMTP Server (TLS) id 15.1.172.22; Mon, 25 May 2015 05:39:40 +0000 Received: from BY2PR02CA0060.namprd02.prod.outlook.com (10.141.216.50) by CY1PR02MB1120.namprd02.prod.outlook.com (25.163.15.146) with Microsoft SMTP Server (TLS) id 15.1.166.22; Mon, 25 May 2015 05:39:39 +0000 Received: from BN1BFFO11FD048.protection.gbl (2a01:111:f400:7c10::1:104) by BY2PR02CA0060.outlook.office365.com (2a01:111:e400:2c40::50) with Microsoft SMTP Server (TLS) id 15.1.172.22 via Frontend Transport; Mon, 25 May 2015 05:39:39 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.222) smtp.mailfrom=amd.com; arm.com; dkim=none (message not signed) header.d=none; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from atltwp02.amd.com (165.204.84.222) by BN1BFFO11FD048.mail.protection.outlook.com (10.58.145.3) with Microsoft SMTP Server id 15.1.172.14 via Frontend Transport; Mon, 25 May 2015 05:39:39 +0000 X-M-MSG: Received: from satlvexedge01.amd.com (satlvexedge01.amd.com [10.177.96.28]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by atltwp02.amd.com (Axway MailGate 5.3.1) with ESMTPS id 26EB1D16007; Mon, 25 May 2015 01:39:37 -0400 (EDT) Received: from SATLEXDAG03.amd.com (10.181.40.7) by satlvexedge01.amd.com (10.177.96.28) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 25 May 2015 00:39:54 -0500 Received: from SATLEXDAG06.amd.com ([fe80::1557:d877:7f65:c17]) by satlexdag03.amd.com ([fe80::b5e9:cb70:d30c:3fbc%22]) with mapi id 14.03.0195.001; Mon, 25 May 2015 01:39:36 -0400 From: "Kumar, Venkataramanan" To: "James Greenhalgh (james.greenhalgh@arm.com)" , "gcc-patches@gcc.gnu.org" , "Marcus Shawcroft (marcus.shawcroft@arm.com)" Subject: [Ping]: [Patch] [AArch64] PR target 66049: fix add/extend gcc test suite failures Date: Mon, 25 May 2015 05:39:36 +0000 Message-ID: <7794A52CE4D579448B959EED7DD0A4723DD0973D@satlexdag06.amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD048; 1:FRdFwZ1wNdY+QdcxCHEgjNu3d//lXMVp2pfcz5WapsnPi0qe5j6O0DqF7IczSX2IoWb1L92jWLAncGC6SE/+VUdvvMHk4kj35GQx7BSF/alldm28ki2xnwFVikfB3BHgAfAvTtqVrbQCxdH+3kFSrM+g/mU9pEzWnYoZSsBR7/9pkj6nztt5cyh9INVYnmG1CDKaKQ+49Qu3t5TnQP6tVGJ1ntysA00Con6gKZj9eQFKaJQgk1HB33fSx3l/JRhu1mUBwM3XEuZp9DTTI902jA== X-Forefront-Antispam-Report: CIP:165.204.84.222; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(428002)(377454003)(199003)(377424004)(189002)(13464003)(54534003)(99936001)(101416001)(55846006)(92566002)(33656002)(4001540100001)(102836002)(15975445007)(2920100001)(106466001)(4610100001)(2900100001)(53416004)(2501003)(5250100002)(5890100001)(19580405001)(64706001)(50986999)(5001830100001)(189998001)(105586002)(5001920100001)(5260100001)(46102003)(2656002)(87936001)(86362001)(512954002)(568964001)(229853001)(19580395003)(2930100002)(68736005)(84326002)(77156002)(62966003)(5001860100001)(97736004)(54356999)(5001770100001)(107886002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR02MB1120; H:atltwp02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:CY1PR02MB1120; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:CY1PR02MB1215; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(520002)(3002001); SRVR:CY1PR02MB1120; BCL:0; PCL:0; RULEID:; SRVR:CY1PR02MB1120; X-Forefront-PRVS: 058707456E X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2015 05:39:39.2163 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96; Ip=[165.204.84.222]; Helo=[atltwp02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1120 X-OriginatorOrg: amd.com X-IsSubscribed: yes Ping! -----Original Message----- From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-owner@gcc.gnu.org] On Behalf Of Kumar, Venkataramanan Sent: Tuesday, May 19, 2015 9:07 PM To: James Greenhalgh (james.greenhalgh@arm.com); gcc-patches@gcc.gnu.org Cc: Kyrill Tkachov (kyrylo.tkachov@arm.com); ramana.radhakrishnan@arm.com; segher@kernel.crashing.org; Marcus Shawcroft (marcus.shawcroft@arm.com) Subject: [Patch] [AArch64] PR target 66049: fix add/extend gcc test suite failures Hi Maintainers, Please find the attached patch, that fixes add/extend gcc test suite failures in Aarch64 target. Ref: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66049 These tests started to fail after we prevented combiner from converting shift RTX to mult RTX, when the RTX is not inside a memory operation (r222874) . Now I have added new add/extend patterns which are based on shift operations, to fix these cases. Testing status with the patch. (1) GCC bootstrap on AArch64 successful. (2) SPEC2006 INT runs did not show any degradation. (3) gcc regression testing passed. (-----Snip-----) # Comparing 3 common sum files ## /bin/sh ./gcc-fsf-trunk/contrib/compare_tests /tmp/gxx-sum1.24998 /tmp/gxx-sum2.24998 Tests that now work, but didn't before: gcc.target/aarch64/adds1.c scan-assembler adds\tw[0-9]+, w[0-9]+, w[0-9]+, lsl 3 gcc.target/aarch64/adds1.c scan-assembler adds\tx[0-9]+, x[0-9]+, x[0-9]+, lsl 3 gcc.target/aarch64/adds3.c scan-assembler-times adds\tx[0-9]+, x[0-9]+, x[0-9]+, sxtw 2 gcc.target/aarch64/extend.c scan-assembler add\tw[0-9]+,.*uxth #?1 gcc.target/aarch64/extend.c scan-assembler add\tx[0-9]+,.*uxtw #?3 gcc.target/aarch64/extend.c scan-assembler sub\tw[0-9]+,.*uxth #?1 gcc.target/aarch64/extend.c scan-assembler sub\tx[0-9]+,.*uxth #?1 gcc.target/aarch64/extend.c scan-assembler sub\tx[0-9]+,.*uxtw #?3 gcc.target/aarch64/subs1.c scan-assembler subs\tw[0-9]+, w[0-9]+, w[0-9]+, lsl 3 gcc.target/aarch64/subs1.c scan-assembler subs\tx[0-9]+, x[0-9]+, x[0-9]+, lsl 3 gcc.target/aarch64/subs3.c scan-assembler-times subs\tx[0-9]+, x[0-9]+, x[0-9]+, sxtw 2 # No differences found in 3 common sum files (-----Snip-----) The patterns are fixing the regressing tests, so I have not added any new tests. Regarding removal of the old patterns based on "mults", I am planning to do it as a separate work. Is this OK for trunk ? gcc/ChangeLog 2015-05-19 Venkataramanan Kumar * config/aarch64/aarch64.md (*adds_shift_imm_): New pattern. (*subs_shift_imm_): Likewise. (*adds__shift_): Likewise. (*subs__shift_): Likewise. (*add_uxt_shift2): Likewise. (*add_uxtsi_shift2_uxtw): Likewise. (*sub_uxt_shift2): Likewise. (*sub_uxtsi_shift2_uxtw): Likewise. Regards, Venkat. diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 1dbadc0..d0d6a6a 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -1539,6 +1539,38 @@ [(set_attr "type" "alus_sreg,alus_imm,alus_imm")] ) +(define_insn "*adds_shift_imm_" + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ + (plus:GPI (ASHIFT:GPI + (match_operand:GPI 1 "register_operand" "r") + (match_operand:QI 2 "aarch64_shift_imm_" "n")) + (match_operand:GPI 3 "register_operand" "r")) + (const_int 0))) + (set (match_operand:GPI 0 "register_operand" "=r") + (plus:GPI (ASHIFT:GPI (match_dup 1) (match_dup 2)) + (match_dup 3)))] + "" + "adds\\t%0, %3, %1, %2" + [(set_attr "type" "alus_shift_imm")] +) + +(define_insn "*subs_shift_imm_" + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ + (minus:GPI (match_operand:GPI 1 "register_operand" "r") + (ASHIFT:GPI + (match_operand:GPI 2 "register_operand" "r") + (match_operand:QI 3 "aarch64_shift_imm_" "n"))) + (const_int 0))) + (set (match_operand:GPI 0 "register_operand" "=r") + (minus:GPI (match_dup 1) + (ASHIFT:GPI (match_dup 2) (match_dup 3))))] + "" + "subs\\t%0, %1, %2, %3" + [(set_attr "type" "alus_shift_imm")] +) + (define_insn "*adds_mul_imm_" [(set (reg:CC_NZ CC_REGNUM) (compare:CC_NZ @@ -1599,6 +1631,42 @@ [(set_attr "type" "alus_ext")] ) +(define_insn "*adds__shift_" + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ + (plus:GPI (ashift:GPI + (ANY_EXTEND:GPI + (match_operand:ALLX 1 "register_operand" "r")) + (match_operand 2 "aarch64_imm3" "Ui3")) + (match_operand:GPI 3 "register_operand" "r")) + (const_int 0))) + (set (match_operand:GPI 0 "register_operand" "=rk") + (plus:GPI (ashift:GPI (ANY_EXTEND:GPI (match_dup 1)) + (match_dup 2)) + (match_dup 3)))] + "" + "adds\\t%0, %3, %1, xt %2" + [(set_attr "type" "alus_ext")] +) + +(define_insn "*subs__shift_" + [(set (reg:CC_NZ CC_REGNUM) + (compare:CC_NZ + (minus:GPI (match_operand:GPI 1 "register_operand" "r") + (ashift:GPI + (ANY_EXTEND:GPI + (match_operand:ALLX 2 "register_operand" "r")) + (match_operand 3 "aarch64_imm3" "Ui3"))) + (const_int 0))) + (set (match_operand:GPI 0 "register_operand" "=rk") + (minus:GPI (match_dup 1) + (ashift:GPI (ANY_EXTEND:GPI (match_dup 2)) + (match_dup 3))))] + "" + "subs\\t%0, %1, %2, xt %3" + [(set_attr "type" "alus_ext")] +) + (define_insn "*adds__multp2" [(set (reg:CC_NZ CC_REGNUM) (compare:CC_NZ @@ -1894,6 +1962,38 @@ [(set_attr "type" "adc_reg")] ) +(define_insn "*add_uxt_shift2" + [(set (match_operand:GPI 0 "register_operand" "=rk") + (plus:GPI (and:GPI + (ashift:GPI (match_operand:GPI 1 "register_operand" "r") + (match_operand 2 "aarch64_imm3" "Ui3")) + (match_operand 3 "const_int_operand" "n")) + (match_operand:GPI 4 "register_operand" "r")))] + "aarch64_uxt_size (INTVAL (operands[2]), INTVAL (operands[3])) != 0" + "* + operands[3] = GEN_INT (aarch64_uxt_size (INTVAL(operands[2]), + INTVAL (operands[3]))); + return \"add\t%0, %4, %1, uxt%e3 %2\";" + [(set_attr "type" "alu_ext")] +) + +;; zero_extend version of above +(define_insn "*add_uxtsi_shift2_uxtw" + [(set (match_operand:DI 0 "register_operand" "=rk") + (zero_extend:DI + (plus:SI (and:SI + (ashift:SI (match_operand:SI 1 "register_operand" "r") + (match_operand 2 "aarch64_imm3" "Ui3")) + (match_operand 3 "const_int_operand" "n")) + (match_operand:SI 4 "register_operand" "r"))))] + "aarch64_uxt_size (INTVAL (operands[2]), INTVAL (operands[3])) != 0" + "* + operands[3] = GEN_INT (aarch64_uxt_size (INTVAL (operands[2]), + INTVAL (operands[3]))); + return \"add\t%w0, %w4, %w1, uxt%e3 %2\";" + [(set_attr "type" "alu_ext")] +) + (define_insn "*add_uxt_multp2" [(set (match_operand:GPI 0 "register_operand" "=rk") (plus:GPI (and:GPI @@ -2150,6 +2250,38 @@ [(set_attr "type" "adc_reg")] ) +(define_insn "*sub_uxt_shift2" + [(set (match_operand:GPI 0 "register_operand" "=rk") + (minus:GPI (match_operand:GPI 4 "register_operand" "rk") + (and:GPI + (ashift:GPI (match_operand:GPI 1 "register_operand" "r") + (match_operand 2 "aarch64_imm3" "Ui3")) + (match_operand 3 "const_int_operand" "n"))))] + "aarch64_uxt_size (INTVAL (operands[2]),INTVAL (operands[3])) != 0" + "* + operands[3] = GEN_INT (aarch64_uxt_size (INTVAL (operands[2]), + INTVAL (operands[3]))); + return \"sub\t%0, %4, %1, uxt%e3 %2\";" + [(set_attr "type" "alu_ext")] +) + +;; zero_extend version of above +(define_insn "*sub_uxtsi_shift2_uxtw" + [(set (match_operand:DI 0 "register_operand" "=rk") + (zero_extend:DI + (minus:SI (match_operand:SI 4 "register_operand" "rk") + (and:SI + (ashift:SI (match_operand:SI 1 "register_operand" "r") + (match_operand 2 "aarch64_imm3" "Ui3")) + (match_operand 3 "const_int_operand" "n")))))] + "aarch64_uxt_size (INTVAL (operands[2]),INTVAL (operands[3])) != 0" + "* + operands[3] = GEN_INT (aarch64_uxt_size (INTVAL (operands[2]), + INTVAL (operands[3]))); + return \"sub\t%w0, %w4, %w1, uxt%e3 %2\";" + [(set_attr "type" "alu_ext")] +) + (define_insn "*sub_uxt_multp2" [(set (match_operand:GPI 0 "register_operand" "=rk") (minus:GPI (match_operand:GPI 4 "register_operand" "rk")