From patchwork Fri Nov 19 08:45:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 47922 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8BE4F385AC12 for ; Fri, 19 Nov 2021 08:46:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BE4F385AC12 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1637311590; bh=016uHT1hwthnytGX1vq8d9592CY7W4nqF3h6JrxLYh0=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=VpNSuIbPLTuy9vNJHw6P1euZdW2kg4wvWDaFKEeVo90hBmBkH7/6ZhQVUsCWUZcVH /xXwPgIkbwSqezcNJ8F3c+Qn3+91wiU414I5GXaZCxdQLXDEXrLhwIYGPE5h2pJEFH n5Br01ZK9uf5fsL8TQ/ZtpDnMvwPo4/px+X/skbw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80078.outbound.protection.outlook.com [40.107.8.78]) by sourceware.org (Postfix) with ESMTPS id 9CE7A385800F for ; Fri, 19 Nov 2021 08:45:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9CE7A385800F Received: from AS8PR04CA0053.eurprd04.prod.outlook.com (2603:10a6:20b:312::28) by AM7PR08MB5526.eurprd08.prod.outlook.com (2603:10a6:20b:108::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.22; Fri, 19 Nov 2021 08:45:55 +0000 Received: from VE1EUR03FT062.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:312:cafe::f0) by AS8PR04CA0053.outlook.office365.com (2603:10a6:20b:312::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19 via Frontend Transport; Fri, 19 Nov 2021 08:45:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT062.mail.protection.outlook.com (10.152.18.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19 via Frontend Transport; Fri, 19 Nov 2021 08:45:53 +0000 Received: ("Tessian outbound 9a8c656e7c94:v110"); Fri, 19 Nov 2021 08:45:53 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 0d3cf0e4525ce3e9 X-CR-MTA-TID: 64aa7808 Received: from 45642127483d.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 82202D57-48B9-439A-ADA3-EBE0DA645F3F.1; Fri, 19 Nov 2021 08:45:45 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 45642127483d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 19 Nov 2021 08:45:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BIVe+1BSgOLXej66/c+SHMPiUk3NcXbg1crBv5ZIyUEdM48ghb+6FJOGGrjkppg6Wqcd+RW2myPWXwf+UP2FVNQs4xrCFTgUPPzNKEdG7VThU+vKAcQWmzKwcDDO+frcWWkfIy7qsNKua5yKmNHE6cGGAjkNZHbdTx63exNhSjcyowPdHdTTyVS4Zlg2KAoWQMa1TLmSzs3+dpXjiLr9O7/qSDUmz24RWg0PBKtwt7lVwxqmjquvmLjJ9qu2DKwKDF2lNTf1PBr6zGhQjGzNCLZ4b/dol4LKysTpMDlQbdREeUbAw1t8LmMotBLVrbhCEozmUXZcPA7dEvPi6pFyZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=016uHT1hwthnytGX1vq8d9592CY7W4nqF3h6JrxLYh0=; b=ct34/ixciMGzmrWtPpKjuEqVODTj2UlksgdlVPqxWeDc8CAAF6r0KVJ2iOU7NR4qlBkcMBPnfuTbdvESBocTj18Y0IHliTOVB00EnzcHtLUAHM6W7yAObWaNbRbPvy8WPimqHORi7bJrK53ALTv1xxe4xEbATptuIMXLzj3wChIm6DDU9ijyVZOpsSkKyVmy1vd5f4tsn+U7K/WURj41GutWfepStwapVts7Iv6tP53TmqwFAhCN+8saxAbo5pdL/oeFN4IlPdtrf2SxZVPfHSnkfEVYOtUSd0mF2vuOls/GPCp1IKwopBNUqVYX5faEAkM5j+mJSxscBU5Wfmr05Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AM0PR08MB5316.eurprd08.prod.outlook.com (2603:10a6:208:185::14) by AM0PR08MB3922.eurprd08.prod.outlook.com (2603:10a6:208:128::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19; Fri, 19 Nov 2021 08:45:44 +0000 Received: from AM0PR08MB5316.eurprd08.prod.outlook.com ([fe80::1096:1244:d709:fbee]) by AM0PR08MB5316.eurprd08.prod.outlook.com ([fe80::1096:1244:d709:fbee%3]) with mapi id 15.20.4713.022; Fri, 19 Nov 2021 08:45:44 +0000 Date: Fri, 19 Nov 2021 08:45:37 +0000 To: gcc-patches@gcc.gnu.org Subject: [PATCH]middle-end: Handle FMA_CONJ correctly after SLP layout update. Message-ID: Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: SN7P220CA0012.NAMP220.PROD.OUTLOOK.COM (2603:10b6:806:123::17) To AM0PR08MB5316.eurprd08.prod.outlook.com (2603:10a6:208:185::14) MIME-Version: 1.0 Received: from arm.com (217.140.106.55) by SN7P220CA0012.NAMP220.PROD.OUTLOOK.COM (2603:10b6:806:123::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.22 via Frontend Transport; Fri, 19 Nov 2021 08:45:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f3bdbd7f-9981-4a80-2277-08d9ab38ff6a X-MS-TrafficTypeDiagnostic: AM0PR08MB3922:|AM7PR08MB5526: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ZpsBn0h2QSRvWcDfyWxinFIT3ixULjk9BcWJG5BxHwIR4J8JkaBW0EQ/12/BTZHZgpCnmDGrFBN1ifRqYCMRbcUJ7rnprEWWnv/5m/C7drhPTfeWQvRqx94MLXCIt3fdftQTxct+A5gse6E4JRUQkt8gxG8+6JlwppLCumbQzqyrrpKIF0Fl1aZbEuE0N/RQKJnAD8NPCr/rGHYaJJE2nAAWWU3iXVXJ/arm7yWtBlDvuLyj2rN7k7EQghU575XktjvCaW3OxsumrimMhPf/Y5MPd8DtBO5Oe8h4qPx6+McvDNc+PC7X6XJGLFfnkJzfvWfL5+RakBKUfPzNg5u8xIUExtOhsoSILi0dmdNC07biawxkWvqgIaDVqSH/0JP+6Sw2ovz0kyVDD7MyWWrwvPsiiYlVjGqr4av1yzYoglfb1PNsSKulDrgV6GlzpOEreTTGtnHpQm1axNO+Se4jjNl6jZoxYOJfcf36hRz/C78e8/3TDWtKLgGhI6v3UGDZXytNjBwIkIOOKeTIqR5Ty8a2/q4yxIqAMG2sV2WSf+fbbXGeUGKMND+R2RpSsSHuFryP9s/qjePMuMLeoyvTuRdI0VK63eP1qNZKYIMuNQTrhAzk8/z3uz2QL2sYAdmvkEwSyYPhs8mXJ6QuXV2DhvcsD3E42WV0xviBqyaYWWsxxKXff2V3/D3Kz01fKhSPGLQmS46dJVcZDGFtbUH41iGhiBgO0yVFGdJABUlpFU7Jg9SUHWz4gLVeEk+hf7dEjGy7agPoqYlbLRB+w8fbe1/brRPT/DpokVYOkTULQsXZy1DToOhR/iBWOGBg557bF9QG+SNA/943ENw0nL6F4qrlrQ52R1kBZllNT53T0lSEWp8k99IXqdqnXD9K1xEr X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR08MB5316.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(33964004)(44144004)(15650500001)(316002)(6916009)(86362001)(52116002)(7696005)(4326008)(508600001)(36756003)(5660300002)(83380400001)(38100700002)(38350700002)(186003)(2906002)(4743002)(8886007)(235185007)(2616005)(956004)(26005)(55016002)(66946007)(66556008)(8676002)(8936002)(44832011)(66476007)(84970400001)(6666004)(4216001)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3922 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: db5c0235-41e0-42f6-66a0-08d9ab38f93f X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D1OErhmBelLwaQ+apQclKN7g90BEntyroB6ovPifI3T4q9ubz4FTQCTAFNDDpUqG+LS1EpPsU17+NYfCmwnFTV7mtBV2nGeZD/wsajJBjjp7eNkMf5rd911DUCuwGdvCpTzzaqXieyRKBI79OmKUKu6HvDczMEwSt1EcBXaN7u9e4oqrwPKd3m0Klwpus6RQ4nctqnHBdTtWo0vugJ39aPWxKmdjpNznlRgMrBJ/fydyUl/aWKfuDgvpPXAPWp4Z3p4tRplm507yyONw9nHDYAH2FW99op0D+6o05HblHOOGgdkQWUQwH4tbsxOCPaGC4+ww8fWgcWI+aBVRGcJA5nBLGFtNPh9Od+QFRed86wHHPJyG82FhzFfR7/BqJPvIGFoS9L4ZcB3pDlqvlAiCK1JsMerf8Anu6WWbMXYwzUENFvZkR1QCHX9O+vqHBeQuvm8lZOZBq+8BeHYnEGgBSCtudJUYdQ0jQKZzuZY4+RsFxcS4cIedHpYU5i14moAUMhpRIlHSJ6zeSFrLlBGw6z3b3BGnjsV3DKWiirIWhkhIiU1+M1uVtOqqLzrkwh9/OoL0LcizhfVH9bksFE/m42hf4CX6mRrr5wnQ6R6uQU08NiZEzeOikHxZVKwmCxOLh7ZNO59SafhSDZqNcC0Z8uaByEgdeRv985oWaCEOHciGFO1AD4mPZCQyeoAFKWvZf1NNEppjfti8sDQxk8y26iuHAp5IglluD15+Qh0pCfmhr686C2ODIhr//h+I0pIiA/MbblTw+1GrwZzjTZQNcO/GZ1NWg1JBaTUNeq2lgbZT173Xc0IxhX+05lrbuW69axkDCUw6EGIbjJmo6B63enpYOfeEN8nzRZFOCpm/kaAhAA4EO/ndiaLnYnB/W0Ha X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(107886003)(2616005)(4743002)(15650500001)(5660300002)(70586007)(956004)(336012)(6916009)(316002)(47076005)(4326008)(26005)(33964004)(44144004)(8936002)(186003)(7696005)(8886007)(36860700001)(6666004)(235185007)(508600001)(82310400003)(36756003)(70206006)(83380400001)(81166007)(44832011)(8676002)(55016002)(86362001)(2906002)(356005)(84970400001)(4216001)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2021 08:45:53.9920 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3bdbd7f-9981-4a80-2277-08d9ab38ff6a X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5526 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_LOTSOFHASH, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Tamar Christina via Gcc-patches From: Tamar Christina Reply-To: Tamar Christina Cc: nd@arm.com, rguenther@suse.de Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi All, Apologies, I got dinged by the i386 regressions bot for a test I didn't have in my tree at the time I made the previous patch. The bot was telling me that FMA stopped working after I strengthened the FMA check in the previous patch. The reason is that the check is slightly early. The first check can indeed only exit early when either node isn't a mult. However we need to delay till we know if the node is a MUL or FMA before enforcing that both nodes must be a MULT since the node to inspect is different if the operation is a MUL or FMA. Also with the update patch for GCC 11 tree layout update to the new GCC 12 one I had missed that the difference in which node is conjucated is not symmetrical. So the test for it can just be testing the inverse order. It was Currently no detecting when the first node was conjucated instead of the second one. This also made me wonder why my own test didn't detect this. It turns out that the tests, being copied from the _Float16 ones were incorrectly marked as xfail. The _Float16 ones are marked as xfail since C doesn't have a conj operation for _Float16, which means you get extra type-casts in between. While you could use the GCC _Complex extension here I opted to mark them xfail since I wanted to include detection over the widenings next year. Secondly the double tests were being skipped because Adv. SIMD was missing from targets supporting Complex Double vectorization. With these changes all other tests run and pass and only XFAIL ones are correctly the _Float16 ones. Sorry for missing this before, testing should now cover all cases. Bootstrapped Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu and no regressions. Ok for master? Thanks, Tamar gcc/ChangeLog: PR tree-optimization/103311 * tree-vect-slp-patterns.c (vect_validate_multiplication): Fix CONJ test to new codegen. (complex_mul_pattern::matches): Move check downwards. gcc/testsuite/ChangeLog: PR tree-optimization/103311 * gcc.dg/vect/complex/fast-math-bb-slp-complex-mla-double.c: Fix it. * gcc.dg/vect/complex/fast-math-bb-slp-complex-mla-float.c: Likewise. * gcc.dg/vect/complex/fast-math-bb-slp-complex-mls-double.c: Likewise. * gcc.dg/vect/complex/fast-math-bb-slp-complex-mls-float.c: Likewise. * gcc.dg/vect/complex/fast-math-bb-slp-complex-mul-double.c: Likewise. * gcc.dg/vect/complex/fast-math-bb-slp-complex-mul-float.c: Likewise. * lib/target-supports.exp (check_effective_target_vect_complex_add_double): Add Adv. SIMD. --- inline copy of patch -- diff --git a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mla-double.c b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mla-double.c index 462063abc3041d466e8b0261252054a46ef48e15..e13fa3bd31bab016c7a033a7ed590047c757882b 100644 diff --git a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mla-double.c b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mla-double.c index 462063abc3041d466e8b0261252054a46ef48e15..e13fa3bd31bab016c7a033a7ed590047c757882b 100644 --- a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mla-double.c +++ b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mla-double.c @@ -6,5 +6,5 @@ #define N 16 #include "complex-mla-template.c" -/* { dg-final { scan-tree-dump "Found COMPLEX_FMA_CONJ" "slp1" } } */ -/* { dg-final { scan-tree-dump "Found COMPLEX_FMA" "slp1" } } */ +/* { dg-final { scan-tree-dump "Found COMPLEX_FMA_CONJ" "vect" } } */ +/* { dg-final { scan-tree-dump "Found COMPLEX_FMA" "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mla-float.c b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mla-float.c index a88adc8184ece3d6d61c66a42233fde0f1721a78..2d774315df96a37759021ab64e0bdb4eb6292f6e 100644 --- a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mla-float.c +++ b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mla-float.c @@ -6,5 +6,5 @@ #define TYPE float #define N 16 #include "complex-mla-template.c" -/* { dg-final { scan-tree-dump "Found COMPLEX_FMA_CONJ" "slp1" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump "Found COMPLEX_FMA" "slp1" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump "Found COMPLEX_FMA_CONJ" "vect" } } */ +/* { dg-final { scan-tree-dump "Found COMPLEX_FMA" "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mls-double.c b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mls-double.c index a434fd1f1d3235392a0240b5861c85d39c48d551..bfb62f21f972c5a02af4952d2db1799f37011cad 100644 --- a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mls-double.c +++ b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mls-double.c @@ -6,7 +6,5 @@ #define N 16 #include "complex-mls-template.c" -/* { dg-final { scan-tree-dump "Found COMPLEX_ADD_ROT270" "slp1" } } */ -/* { dg-final { scan-tree-dump "Found COMPLEX_FMA" "slp1" } } */ -/* { dg-final { scan-tree-dump "Found COMPLEX_FMS_CONJ" "slp1" } } */ -/* { dg-final { scan-tree-dump "Found COMPLEX_FMS" "slp1" } } */ +/* { dg-final { scan-tree-dump "Found COMPLEX_FMS_CONJ" "vect" } } */ +/* { dg-final { scan-tree-dump "Found COMPLEX_FMS" "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mls-float.c b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mls-float.c index b7ccbbdb75743182022465243efcb128ef97fd0c..930bd11d7fc33ab70ee0dc2a716f12e37ea87290 100644 --- a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mls-float.c +++ b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mls-float.c @@ -7,5 +7,5 @@ #define N 16 #include "complex-mls-template.c" -/* { dg-final { scan-tree-dump "Found COMPLEX_FMS_CONJ" "slp1" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump "Found COMPLEX_FMS" "slp1" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump "Found COMPLEX_FMS_CONJ" "vect" } } */ +/* { dg-final { scan-tree-dump "Found COMPLEX_FMS" "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mul-double.c b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mul-double.c index f7e9386334e1b259d43d35f4bc6b79010d020e6a..86904ea72667a2534a5a8a2447563f2230d3c7db 100644 --- a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mul-double.c +++ b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mul-double.c @@ -6,5 +6,5 @@ #define N 16 #include "complex-mul-template.c" -/* { dg-final { scan-tree-dump "Found COMPLEX_MUL_CONJ" "slp1" } } */ -/* { dg-final { scan-tree-dump "Found COMPLEX_MUL" slp1" } } */ +/* { dg-final { scan-tree-dump "Found COMPLEX_MUL_CONJ" "vect" } } */ +/* { dg-final { scan-tree-dump "Found COMPLEX_MUL" "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mul-float.c b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mul-float.c index 0dc9c52555640c34f794e0f57c04f3ea0510fdc9..27280ae2ba4dfaee1a547d43f75240a7634caa9b 100644 --- a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mul-float.c +++ b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-mul-float.c @@ -7,5 +7,5 @@ #define N 16 #include "complex-mul-template.c" -/* { dg-final { scan-tree-dump "Found COMPLEX_MUL_CONJ" "slp1" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump "Found COMPLEX_MUL" "slp1" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump "Found COMPLEX_MUL_CONJ" "slp1" } } */ +/* { dg-final { scan-tree-dump "Found COMPLEX_MUL" "slp1" } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index e07d563f6f4e39aa6264ecf9074db7be75dae009..d22270659ddcaf8fbb456e409328c8473fb43d9a 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -3632,8 +3632,10 @@ proc check_effective_target_vect_complex_add_float { } { proc check_effective_target_vect_complex_add_double { } { return [check_cached_effective_target_indexed vect_complex_add_double { expr { - ([check_effective_target_aarch64_sve2] - && [check_effective_target_aarch64_little_endian]) + (([check_effective_target_arm_v8_3a_complex_neon_ok] + && [check_effective_target_aarch64_little_endian]) + || ([check_effective_target_aarch64_sve2] + && [check_effective_target_aarch64_little_endian])) }}] } diff --git a/gcc/tree-vect-slp-patterns.c b/gcc/tree-vect-slp-patterns.c index d916fc9cef9a86a0d797caaf2b2f253685e9b7dd..0ee1fab2ed527183a4f0af375d1d2b609b2e092f 100644 --- a/gcc/tree-vect-slp-patterns.c +++ b/gcc/tree-vect-slp-patterns.c @@ -809,14 +809,20 @@ vect_validate_multiplication (slp_tree_to_load_perm_map_t *perm_cache, if (linear_loads_p (perm_cache, left_op[index2]) == PERM_EVENODD) return true; } - else if (kind == PERM_EVENODD) + else if (kind == PERM_EVENODD && !neg_first) { - if ((kind = linear_loads_p (perm_cache, left_op[index2])) == PERM_EVENODD) + if ((kind = linear_loads_p (perm_cache, left_op[index2])) != PERM_EVENEVEN) return false; return true; } - else if (!neg_first) - *conj_first_operand = true; + else if (kind == PERM_EVENEVEN && neg_first) + { + if ((kind = linear_loads_p (perm_cache, left_op[index2])) != PERM_EVENODD) + return false; + + *conj_first_operand = true; + return true; + } else return false; @@ -949,7 +955,7 @@ complex_mul_pattern::matches (complex_operation_t op, bool mul0 = vect_match_expression_p (l0node[0], MULT_EXPR); bool mul1 = vect_match_expression_p (l0node[1], MULT_EXPR); - if (!mul0 || !mul1) + if (!mul0 && !mul1) return IFN_LAST; /* Now operand2+4 may lead to another expression. */ @@ -979,6 +985,8 @@ complex_mul_pattern::matches (complex_operation_t op, if (left_op.length () != 2 || right_op.length () != 2 + || !mul1 + || (!mul0 && !vect_match_expression_p (left_op[1], MULT_EXPR)) || linear_loads_p (perm_cache, left_op[1]) == PERM_ODDEVEN) return IFN_LAST;