From patchwork Wed Sep 27 00:52:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 1839985 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=blHVqzhc; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=blHVqzhc; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RwJ5D5T7Kz1ypJ for ; Wed, 27 Sep 2023 10:53:36 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ACFB3385DC3D for ; Wed, 27 Sep 2023 00:53:34 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2053.outbound.protection.outlook.com [40.107.20.53]) by sourceware.org (Postfix) with ESMTPS id 1844D3852766 for ; Wed, 27 Sep 2023 00:53:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1844D3852766 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hLtNHsXbQ5BHKqqBUqf6LvUR1NhewhRf5fBNxNPUjdo=; b=blHVqzhc0T1AVYPIREc/x5bXRdVCXtLJbNKLuINlX44hp5qBK3SsfAvOFGQ8by5qxUqvhdkev0YYGLn6k130ICehqVljtW++Flp6hi+QufV3nbIUD2pBIJqCtWctzhUphLXzLhiMlwx7R35S4HMyucjCRnggtO1rQFgoRqcSx40= Received: from AS9PR06CA0116.eurprd06.prod.outlook.com (2603:10a6:20b:465::26) by DU0PR08MB8906.eurprd08.prod.outlook.com (2603:10a6:10:47e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 27 Sep 2023 00:53:15 +0000 Received: from AM7EUR03FT011.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:465:cafe::ca) by AS9PR06CA0116.outlook.office365.com (2603:10a6:20b:465::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.35 via Frontend Transport; Wed, 27 Sep 2023 00:53:15 +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; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT011.mail.protection.outlook.com (100.127.140.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.21 via Frontend Transport; Wed, 27 Sep 2023 00:53:15 +0000 Received: ("Tessian outbound 1eb4e931b055:v175"); Wed, 27 Sep 2023 00:53:15 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2f68c3d8af4ee16a X-CR-MTA-TID: 64aa7808 Received: from 3c8a3b130307.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 29C7396D-89D4-4313-AA42-E5C545972782.1; Wed, 27 Sep 2023 00:53:04 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 3c8a3b130307.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 00:53:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dJIexZRv/gRZHh7ZKWGtoo/MBTZjVMegpcETym01imG077uthQ6uymVSqwB7nuM0bKTqzMcPXhG/gxmnYPCT+ukHYlqPcBvaoFnXThBRdZzZ+prxy+AVRoOAsFvpCESZExufN8rhPr28HgciG7fIJWZLbz+Juupc9so/Pzfj/4IBhVrt6lDf7Dt9VHuV76En/l7QdZqceXlhrxGfvUfVjSKaDi8z0SCV3dQR5UaBSeASTPqrjT/jh+fV26WpYFIZ/i3bX6AP02+yhgXs2ZuhclalZ91ue2GT/q1s225xLWfr0E3iZMJsY+jLy8YA9LUnY40CpnW7X9OOXHvfKN30pA== 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=hLtNHsXbQ5BHKqqBUqf6LvUR1NhewhRf5fBNxNPUjdo=; b=EJFzcLBatFewaqmxOKrnAEyyloUNg0m36bw4hZPACOfBr3ogP7URUblfwsU6g3latWqSiFQi4MPEPmgwKwoNEKqCsgtMpZ5SiY/9lU6zmxd+XrwjRaUqJ6uyRzogdM9Tdi0h7i0kt9StI/GMK/58CNIhQIeNG+Imn3URG6oJ5WMQRkRrx+Gs5Inv4vD9l+bKPCdM1U0VIcnIp5rvL08Lgx5C7BqpfaY7iiu/4hwLqwKnfT6tpMzUj0QP97Dr7RTMBoH76Gz+wp4kabPxWPF1uO9PTDWXJ0dci+5ad0xR6/D/UcXrSHwnKcEQXLQqejPrhQ9YHHRnjsUEZSPNAFznyQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hLtNHsXbQ5BHKqqBUqf6LvUR1NhewhRf5fBNxNPUjdo=; b=blHVqzhc0T1AVYPIREc/x5bXRdVCXtLJbNKLuINlX44hp5qBK3SsfAvOFGQ8by5qxUqvhdkev0YYGLn6k130ICehqVljtW++Flp6hi+QufV3nbIUD2pBIJqCtWctzhUphLXzLhiMlwx7R35S4HMyucjCRnggtO1rQFgoRqcSx40= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by AS8PR08MB9743.eurprd08.prod.outlook.com (2603:10a6:20b:615::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 27 Sep 2023 00:53:00 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::662f:8e26:1bf8:aaa1]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::662f:8e26:1bf8:aaa1%7]) with mapi id 15.20.6813.027; Wed, 27 Sep 2023 00:53:00 +0000 Date: Wed, 27 Sep 2023 01:52:52 +0100 From: Tamar Christina To: gcc-patches@gcc.gnu.org Cc: nd@arm.com, Richard.Earnshaw@arm.com, Marcus.Shawcroft@arm.com, Kyrylo.Tkachov@arm.com, richard.sandiford@arm.com Subject: [PATCH]AArch64 Rewrite simd move immediate patterns to new syntax Message-ID: Content-Disposition: inline X-ClientProxiedBy: SN7P220CA0016.NAMP220.PROD.OUTLOOK.COM (2603:10b6:806:123::21) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB5325:EE_|AS8PR08MB9743:EE_|AM7EUR03FT011:EE_|DU0PR08MB8906:EE_ X-MS-Office365-Filtering-Correlation-Id: 454ffdaa-b3f9-44f3-6264-08dbbef4222b x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 0/p8fpi5p+rx4e8YxxN8R/5YRhJmqe2rtrNYrx+oG4Wm6yzCo5eOJaKl64b44Bp/32c/20IFb7Wgxsz7LShYUBZaUkR6oheST90JBdCfOlj6M8i+hZWaDsFWzrSaAkO+hzsVX9PGPZkFOrgs14UksO80hNvz8oZpehHjHpgH8ULyBGStenlNZRGD3JOaK5mCj6NIWscNpAq1EX7T6pxlpWAtszvLCTv/CAwtlpCf5cQ32OZdXRvALypdHtMycSxFK0mxtjvLKKpWTU2HnjLAnobLQRg+iUDExK3tIQWzudc5hRwjEVuKtK6H0PwD2YttwOD0NJZFI/7SAgKJTJcaQTR4n0EHuP6EHYODktT7uQS+3g7/fm9jUgqDVQlU7YyHQG1tbMgmv9+HQqrFukOsmBnpa5lDL5x4DMjEGKWhmuBm/j6FOj+yMtVLTz0uYTNKdtABGCO7okCz4rj4Dj5Ab9U6a8mml3GhdB1ZX3TTMbGU5XLb9qmFLEjtPx2lI9RExusaCx31xcH8yppqpu0qVqTf7F9jdJ7lzzF6hLkdKYjpStPAid3YKFysxgzH4yAEUNoSP5uCyLYD5T4+tJ9FqLUCAu1MqFUUuk7FVBQ0IKPnspvFNquWpQ1WY8vDAhsc+HJdgS/N4kBmdMhvDItJfBMplVFQ9FIE8Y1mrLm3GIo= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB5325.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(136003)(346002)(396003)(376002)(39860400002)(230922051799003)(1800799009)(186009)(451199024)(26005)(6666004)(478600001)(86362001)(4743002)(2616005)(14773004)(36756003)(6486002)(6506007)(5660300002)(44144004)(38100700002)(33964004)(6512007)(8676002)(8936002)(2906002)(4326008)(316002)(41300700001)(66946007)(66476007)(66556008)(6916009)(235185007)(44832011)(4216001)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9743 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: AM7EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6ebc9835-000b-47dc-d069-08dbbef4191d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vXDC897rO+4QajQ+geDpFTjrYPfYqwcrfV9XwhtGCr0qKjbb0Buu/PcbqJ7/ucOdu5lxnwSXRUZN5ZXkXB7OQOnKinL92NpyPjTogitvagzn/nwSCUeFiTSzUo7YrWDppesL6RMGj4QgeBv75gNg0Xamuezky5fJD/N5fXr1C+4OVKHQhYDVoqNex+sNdMIUcXTK6bYc/BXI5UK21wC2RNr7mfedvCpCHOFn9+MhPSIwI19GoIZWSCnoQXBSh3lbP8MFXexjO7cg4ih+HwmOab3T1A+lWJ4Gu9oMx+TIkqsFQTIjMzm8qlVahwvj6KN6o7rA8Jqvw5XqTihj2jd1dJju5STBxw/hewcvJhaoFf/psBtvGltYW+Lua/u1+0eRlHzfJwn2UtpcOWgxBzlGbBTgwjxesGM3XFkPVmgEVfFTF8AJxQ198gMzBITIPvRFgRvjb0TIkII40TozsxX3UOwqZP+cG1X1LmM+r0zmxTNEzUfnMnQ0ttJ40KjksUfOnLpobqCai5+5AIt/lbGsmlye9aKTHyLKQz3GyzDDb16JHlg8lVH0bhslXcZti1nifqZbogvYKGfLrQDX+nGDrSUiKehOWAzgnnHzUESmxwhfXVZ/t5Q9bSBexJ2FuumpFaGy30+bTHOl9m3z8s5vLK6WPXMHLWslivKORnVE2hiUJ/d7wPvyWkZ/Zv0uFWbmk9QLO/pGTNNIbI12ScmyYWv9H+ARM2+3gfh6dgGkLz1yLTpcnYvfca7/vi1HPUxh9kzFBtZV+xiwRYCKjhiGUk719z/11osAqkfkps4ki4GfmMmEKajwXlpJ2+w7NazH 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:(13230031)(4636009)(376002)(396003)(39860400002)(346002)(136003)(230922051799003)(1800799009)(82310400011)(451199024)(186009)(36840700001)(46966006)(40470700004)(6506007)(5660300002)(6486002)(40480700001)(82740400003)(356005)(47076005)(40460700003)(235185007)(81166007)(36860700001)(6666004)(44144004)(70206006)(33964004)(6512007)(70586007)(26005)(44832011)(4743002)(336012)(316002)(4326008)(8676002)(8936002)(478600001)(6916009)(41300700001)(2616005)(2906002)(14773004)(86362001)(36756003)(4216001)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 00:53:15.6998 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 454ffdaa-b3f9-44f3-6264-08dbbef4222b 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: AM7EUR03FT011.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8906 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Hi All, This rewrites the simd MOV patterns to use the new compact syntax. No change in semantics is expected. This will be needed in follow on patches. This also merges the splits into the define_insn which will also be needed soon. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: PR tree-optimization/109154 * config/aarch64/aarch64-simd.md (*aarch64_simd_mov): Rewrite to new syntax. (*aarch64_simd_mov --- diff --git a/gcc/config/aarch64/aarch64-simd.md b/gcc/config/aarch64/aarch64-simd.md index e955691f1be8830efacc237465119764ce2a4942..7b4d5a37a9795fefda785aaacc246918826ed0a2 100644 --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -143,54 +143,57 @@ (define_insn "aarch64_dup_lane_" ) (define_insn "*aarch64_simd_mov" - [(set (match_operand:VDMOV 0 "nonimmediate_operand" - "=w, r, m, m, m, w, ?r, ?w, ?r, w, w") - (match_operand:VDMOV 1 "general_operand" - "m, m, Dz, w, r, w, w, r, r, Dn, Dz"))] + [(set (match_operand:VDMOV 0 "nonimmediate_operand") + (match_operand:VDMOV 1 "general_operand"))] "TARGET_FLOAT && (register_operand (operands[0], mode) || aarch64_simd_reg_or_zero (operands[1], mode))" - "@ - ldr\t%d0, %1 - ldr\t%x0, %1 - str\txzr, %0 - str\t%d1, %0 - str\t%x1, %0 - * return TARGET_SIMD ? \"mov\t%0., %1.\" : \"fmov\t%d0, %d1\"; - * return TARGET_SIMD ? \"umov\t%0, %1.d[0]\" : \"fmov\t%x0, %d1\"; - fmov\t%d0, %1 - mov\t%0, %1 - * return aarch64_output_simd_mov_immediate (operands[1], 64); - fmov\t%d0, xzr" - [(set_attr "type" "neon_load1_1reg, load_8, store_8, neon_store1_1reg,\ - store_8, neon_logic, neon_to_gp, f_mcr,\ - mov_reg, neon_move, f_mcr") - (set_attr "arch" "*,*,*,*,*,*,*,*,*,simd,*")] -) - -(define_insn "*aarch64_simd_mov" - [(set (match_operand:VQMOV 0 "nonimmediate_operand" - "=w, Umn, m, w, ?r, ?w, ?r, w, w") - (match_operand:VQMOV 1 "general_operand" - "m, Dz, w, w, w, r, r, Dn, Dz"))] + {@ [cons: =0, 1; attrs: type, arch] + [w , m ; neon_load1_1reg , * ] ldr\t%d0, %1 + [r , m ; load_8 , * ] ldr\t%x0, %1 + [m , Dz; store_8 , * ] str\txzr, %0 + [m , w ; neon_store1_1reg, * ] str\t%d1, %0 + [m , r ; store_8 , * ] str\t%x1, %0 + [w , w ; neon_logic , simd] mov\t%0., %1. + [w , w ; neon_logic , * ] fmov\t%d0, %d1 + [?r, w ; neon_to_gp , simd] umov\t%0, %1.d[0] + [?r, w ; neon_to_gp , * ] fmov\t%x0, %d1 + [?w, r ; f_mcr , * ] fmov\t%d0, %1 + [?r, r ; mov_reg , * ] mov\t%0, %1 + [w , Dn; neon_move , simd] << aarch64_output_simd_mov_immediate (operands[1], 64); + [w , Dz; f_mcr , * ] fmov\t%d0, xzr + } +) + +(define_insn_and_split "*aarch64_simd_mov" + [(set (match_operand:VQMOV 0 "nonimmediate_operand") + (match_operand:VQMOV 1 "general_operand"))] "TARGET_FLOAT && (register_operand (operands[0], mode) || aarch64_simd_reg_or_zero (operands[1], mode))" - "@ - ldr\t%q0, %1 - stp\txzr, xzr, %0 - str\t%q1, %0 - mov\t%0., %1. - # - # - # - * return aarch64_output_simd_mov_immediate (operands[1], 128); - fmov\t%d0, xzr" - [(set_attr "type" "neon_load1_1reg, store_16, neon_store1_1reg,\ - neon_logic, multiple, multiple,\ - multiple, neon_move, fmov") - (set_attr "length" "4,4,4,4,8,8,8,4,4") - (set_attr "arch" "*,*,*,simd,*,*,*,simd,*")] + {@ [cons: =0, 1; attrs: type, arch, length] + [w , m ; neon_load1_1reg , * , 4] ldr\t%q0, %1 + [Umn, Dz; store_16 , * , 4] stp\txzr, xzr, %0 + [m , w ; neon_store1_1reg, * , 4] str\t%q1, %0 + [w , w ; neon_logic , simd, 4] mov\t%0., %1. + [?r , w ; multiple , * , 8] # + [?w , r ; multiple , * , 8] # + [?r , r ; multiple , * , 8] # + [w , Dn; neon_move , simd, 4] << aarch64_output_simd_mov_immediate (operands[1], 128); + [w , Dz; fmov , * , 4] fmov\t%d0, xzr + } + "&& reload_completed + && !(FP_REGNUM_P (REGNO (operands[0])) + && FP_REGNUM_P (REGNO (operands[1])))" + [(const_int 0)] + { + if (GP_REGNUM_P (REGNO (operands[0])) + && GP_REGNUM_P (REGNO (operands[1]))) + aarch64_simd_emit_reg_reg_move (operands, DImode, 2); + else + aarch64_split_simd_move (operands[0], operands[1]); + DONE; + } ) ;; When storing lane zero we can use the normal STR and its more permissive @@ -276,33 +279,6 @@ (define_insn "vec_store_pair" [(set_attr "type" "neon_stp_q")] ) - -(define_split - [(set (match_operand:VQMOV 0 "register_operand" "") - (match_operand:VQMOV 1 "register_operand" ""))] - "TARGET_FLOAT - && reload_completed - && GP_REGNUM_P (REGNO (operands[0])) - && GP_REGNUM_P (REGNO (operands[1]))" - [(const_int 0)] -{ - aarch64_simd_emit_reg_reg_move (operands, DImode, 2); - DONE; -}) - -(define_split - [(set (match_operand:VQMOV 0 "register_operand" "") - (match_operand:VQMOV 1 "register_operand" ""))] - "TARGET_FLOAT - && reload_completed - && ((FP_REGNUM_P (REGNO (operands[0])) && GP_REGNUM_P (REGNO (operands[1]))) - || (GP_REGNUM_P (REGNO (operands[0])) && FP_REGNUM_P (REGNO (operands[1]))))" - [(const_int 0)] -{ - aarch64_split_simd_move (operands[0], operands[1]); - DONE; -}) - (define_expand "@aarch64_split_simd_mov" [(set (match_operand:VQMOV 0) (match_operand:VQMOV 1))] --- a/gcc/config/aarch64/aarch64-simd.md +++ b/gcc/config/aarch64/aarch64-simd.md @@ -143,54 +143,57 @@ (define_insn "aarch64_dup_lane_" ) (define_insn "*aarch64_simd_mov" - [(set (match_operand:VDMOV 0 "nonimmediate_operand" - "=w, r, m, m, m, w, ?r, ?w, ?r, w, w") - (match_operand:VDMOV 1 "general_operand" - "m, m, Dz, w, r, w, w, r, r, Dn, Dz"))] + [(set (match_operand:VDMOV 0 "nonimmediate_operand") + (match_operand:VDMOV 1 "general_operand"))] "TARGET_FLOAT && (register_operand (operands[0], mode) || aarch64_simd_reg_or_zero (operands[1], mode))" - "@ - ldr\t%d0, %1 - ldr\t%x0, %1 - str\txzr, %0 - str\t%d1, %0 - str\t%x1, %0 - * return TARGET_SIMD ? \"mov\t%0., %1.\" : \"fmov\t%d0, %d1\"; - * return TARGET_SIMD ? \"umov\t%0, %1.d[0]\" : \"fmov\t%x0, %d1\"; - fmov\t%d0, %1 - mov\t%0, %1 - * return aarch64_output_simd_mov_immediate (operands[1], 64); - fmov\t%d0, xzr" - [(set_attr "type" "neon_load1_1reg, load_8, store_8, neon_store1_1reg,\ - store_8, neon_logic, neon_to_gp, f_mcr,\ - mov_reg, neon_move, f_mcr") - (set_attr "arch" "*,*,*,*,*,*,*,*,*,simd,*")] -) - -(define_insn "*aarch64_simd_mov" - [(set (match_operand:VQMOV 0 "nonimmediate_operand" - "=w, Umn, m, w, ?r, ?w, ?r, w, w") - (match_operand:VQMOV 1 "general_operand" - "m, Dz, w, w, w, r, r, Dn, Dz"))] + {@ [cons: =0, 1; attrs: type, arch] + [w , m ; neon_load1_1reg , * ] ldr\t%d0, %1 + [r , m ; load_8 , * ] ldr\t%x0, %1 + [m , Dz; store_8 , * ] str\txzr, %0 + [m , w ; neon_store1_1reg, * ] str\t%d1, %0 + [m , r ; store_8 , * ] str\t%x1, %0 + [w , w ; neon_logic , simd] mov\t%0., %1. + [w , w ; neon_logic , * ] fmov\t%d0, %d1 + [?r, w ; neon_to_gp , simd] umov\t%0, %1.d[0] + [?r, w ; neon_to_gp , * ] fmov\t%x0, %d1 + [?w, r ; f_mcr , * ] fmov\t%d0, %1 + [?r, r ; mov_reg , * ] mov\t%0, %1 + [w , Dn; neon_move , simd] << aarch64_output_simd_mov_immediate (operands[1], 64); + [w , Dz; f_mcr , * ] fmov\t%d0, xzr + } +) + +(define_insn_and_split "*aarch64_simd_mov" + [(set (match_operand:VQMOV 0 "nonimmediate_operand") + (match_operand:VQMOV 1 "general_operand"))] "TARGET_FLOAT && (register_operand (operands[0], mode) || aarch64_simd_reg_or_zero (operands[1], mode))" - "@ - ldr\t%q0, %1 - stp\txzr, xzr, %0 - str\t%q1, %0 - mov\t%0., %1. - # - # - # - * return aarch64_output_simd_mov_immediate (operands[1], 128); - fmov\t%d0, xzr" - [(set_attr "type" "neon_load1_1reg, store_16, neon_store1_1reg,\ - neon_logic, multiple, multiple,\ - multiple, neon_move, fmov") - (set_attr "length" "4,4,4,4,8,8,8,4,4") - (set_attr "arch" "*,*,*,simd,*,*,*,simd,*")] + {@ [cons: =0, 1; attrs: type, arch, length] + [w , m ; neon_load1_1reg , * , 4] ldr\t%q0, %1 + [Umn, Dz; store_16 , * , 4] stp\txzr, xzr, %0 + [m , w ; neon_store1_1reg, * , 4] str\t%q1, %0 + [w , w ; neon_logic , simd, 4] mov\t%0., %1. + [?r , w ; multiple , * , 8] # + [?w , r ; multiple , * , 8] # + [?r , r ; multiple , * , 8] # + [w , Dn; neon_move , simd, 4] << aarch64_output_simd_mov_immediate (operands[1], 128); + [w , Dz; fmov , * , 4] fmov\t%d0, xzr + } + "&& reload_completed + && !(FP_REGNUM_P (REGNO (operands[0])) + && FP_REGNUM_P (REGNO (operands[1])))" + [(const_int 0)] + { + if (GP_REGNUM_P (REGNO (operands[0])) + && GP_REGNUM_P (REGNO (operands[1]))) + aarch64_simd_emit_reg_reg_move (operands, DImode, 2); + else + aarch64_split_simd_move (operands[0], operands[1]); + DONE; + } ) ;; When storing lane zero we can use the normal STR and its more permissive @@ -276,33 +279,6 @@ (define_insn "vec_store_pair" [(set_attr "type" "neon_stp_q")] ) - -(define_split - [(set (match_operand:VQMOV 0 "register_operand" "") - (match_operand:VQMOV 1 "register_operand" ""))] - "TARGET_FLOAT - && reload_completed - && GP_REGNUM_P (REGNO (operands[0])) - && GP_REGNUM_P (REGNO (operands[1]))" - [(const_int 0)] -{ - aarch64_simd_emit_reg_reg_move (operands, DImode, 2); - DONE; -}) - -(define_split - [(set (match_operand:VQMOV 0 "register_operand" "") - (match_operand:VQMOV 1 "register_operand" ""))] - "TARGET_FLOAT - && reload_completed - && ((FP_REGNUM_P (REGNO (operands[0])) && GP_REGNUM_P (REGNO (operands[1]))) - || (GP_REGNUM_P (REGNO (operands[0])) && FP_REGNUM_P (REGNO (operands[1]))))" - [(const_int 0)] -{ - aarch64_split_simd_move (operands[0], operands[1]); - DONE; -}) - (define_expand "@aarch64_split_simd_mov" [(set (match_operand:VQMOV 0) (match_operand:VQMOV 1))]