From patchwork Tue Dec 14 09:40:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamar Christina X-Patchwork-Id: 1567629 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=QNzKBQb8; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4JCth133N0z9s3q for ; Tue, 14 Dec 2021 20:42:09 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9AE073858423 for ; Tue, 14 Dec 2021 09:42:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9AE073858423 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1639474926; bh=jQvb0BaOwTTVu1mqb+PubvBNWjA2ODUy4oe32OZIpEk=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=QNzKBQb8eDbJNFRfOoSzwOFZRC3FPLrRpZTOr9/WQFv/FZUn2zZwybB7FiAO6XLrc F3Czgw+I9Ae51vIGP/xfNg4Au3CsyjpfM1D01rLrttvx9i96sbuOGBi4G7ZRP7gmN3 tgsPbi50VIAuc1lu0nI4VxUDWUhHdnxl6WDkl/1Q= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150075.outbound.protection.outlook.com [40.107.15.75]) by sourceware.org (Postfix) with ESMTPS id 273033858D28 for ; Tue, 14 Dec 2021 09:41:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 273033858D28 Received: from AM5PR0402CA0022.eurprd04.prod.outlook.com (2603:10a6:203:90::32) by PA4PR08MB6285.eurprd08.prod.outlook.com (2603:10a6:102:e0::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.16; Tue, 14 Dec 2021 09:41:19 +0000 Received: from VE1EUR03FT006.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:90:cafe::28) by AM5PR0402CA0022.outlook.office365.com (2603:10a6:203:90::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.16 via Frontend Transport; Tue, 14 Dec 2021 09:41:19 +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 VE1EUR03FT006.mail.protection.outlook.com (10.152.18.116) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12 via Frontend Transport; Tue, 14 Dec 2021 09:41:19 +0000 Received: ("Tessian outbound 9a8c656e7c94:v110"); Tue, 14 Dec 2021 09:41:19 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fde5426007524cf9 X-CR-MTA-TID: 64aa7808 Received: from f1f3901fa4c4.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id D051E30F-5A36-48F9-8B18-7C0B0AE51606.1; Tue, 14 Dec 2021 09:41:02 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f1f3901fa4c4.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 14 Dec 2021 09:41:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aR1ftXD5UlSTSHc3z9wVhFqLmzQ1+7HW9Rw9FkgFGjzgawygjTd5k5iLxC8cdcEfC/Lq7X4Nu+2NQHHdzazotF+E+fzPrkW42YCP3BVpJRoeDc4HnciTIWcDrqEhALVCTMmLcEThGU2sVyDT9PtMREFlWqW3djk2mOgq2ZUf/Fzuv6v4A7vIIwlUsiuAdri+uMXAMba+FvpbPZEaJ6H/TOGNyk13/ZFY3qcUpdvmbWW5kbC9BO/WHU3iREYlLhInVz2Y74Va+vUCGt5slfmY2tYyjzxM0ySXSJFMT7/O2UiYzzq5Fx2PUidsUOuxs2d0tATCBWY8sYuG4ptFjqEoNg== 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=jQvb0BaOwTTVu1mqb+PubvBNWjA2ODUy4oe32OZIpEk=; b=jacQTxrCm5eQeqOyACPEXhqsDNJaSu4qBVi2PA00uCXmcNIS3JJywJn1VdfLZBUR5MM1HD0JhBefFFgzCqbssCT52qSlQUd7DOrzi8gf5R5PjG3JuXw4IaZORWqB9gjT5Mg4opjkdk4zbJy6MOu0MVTrO7cQaDs7mde0NQVPD2x5egg1r/zeIzNVO/bJrtFlY7zqkgMXOIRkPXJKHLOgB1qc+1TAQwx/9JP8Hsn7bX/os3QJSr5KLJeYESkNl+SUBPeBLucNz5HYZbkja8lTJUIHpeCDbLMXigGclArpRwXHmjAwNjQMs+CR01DD+ql8UAdXFsCx7Kyv0Sw+FaNajg== 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 VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) by VI1PR08MB3054.eurprd08.prod.outlook.com (2603:10a6:803:4a::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Tue, 14 Dec 2021 09:40:58 +0000 Received: from VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::12a:3d2c:81ff:8fcc]) by VI1PR08MB5325.eurprd08.prod.outlook.com ([fe80::12a:3d2c:81ff:8fcc%8]) with mapi id 15.20.4778.017; Tue, 14 Dec 2021 09:40:58 +0000 Date: Tue, 14 Dec 2021 09:40:56 +0000 To: gcc-patches@gcc.gnu.org Subject: [PATCH]AArch64 Fix the AAPCs for new partial and full SIMD structure types [PR103094] Message-ID: Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: LO4P123CA0001.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:150::6) To VI1PR08MB5325.eurprd08.prod.outlook.com (2603:10a6:803:13e::17) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 35ae4b82-225a-40cc-0fdc-08d9bee5e1f3 X-MS-TrafficTypeDiagnostic: VI1PR08MB3054:EE_|VE1EUR03FT006:EE_|PA4PR08MB6285:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8882;OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: O8ewMecE3dl+NduCsDlT5G9492A6clFyODIgQIu/pKiEYRPTGdEJA5p3roic7E+t+ZquomfgS1mIjpY1EPmLQwnfN2UO9bs6ZmeedJCaf42ljy/8BVL32xpk+qobxzMBYolA9smwzhEsPmUlszJI0Vw/BUtSULLS3ZwTPcNUyL12NneeO4EHmhFAy0ObdAyIjn+uMMtpDQuTpEpfeV4LbbYX0/JgQvwjkP4FWeS0dM7aUKtXQUbY+gq43h7gRthjF8NFN1p3rpC86SyZJ2l/wTF578GVyFgCG1Nah2CXvD0dEnMbE/VCQmO/j53Xm5zk4BUclPK2GqK3OsMFwZmUw+CSD9fa9ULZpdpNodkeIbrUxicH/aVmkXEC+JBJozWQop38GDiuzYDCbQ8A6khzQ+SU7hWPUBxdS3EENWBhze9JB4iw16juTN7uHc7cgF90WH50f9IjkCjI2YoEJEkvEIUbgJgzhVERd2FmVwbUaKSe+lnbxqvg/JSQInJMsMtKU1DQ3oz7R6objRkimnC0AgsL35uag//9mcYy9u8HGetXWzFkmLV62Co8JHCIpxsgbaNT3TGlAbVS9cr2C2KHEmEf5m8ODat6a6ei6tZpOlsTYJY4pDJvHro5cLBCgDafmnJnGIkj/IRLAa7/0V7/vPBWAotew8uxdqw3wtLfOdt/kuhQdn9J6Q4JKtohpMqpbx4aqG1wpD80ELDBmcBjYFNGmN4Cf3tfTIpoRfUU0vI98DkbJCjYKlni+bSFKPtM2i61iK2iCxB8DhjEsjJaG9zbcl0ieTonow/FKzizsYMO0INVSoTVOkjz6th7l1IC3GnsY8wXbw1lLPDIpZ3NWwMY2NW8e5yGaTttUI1H4T0= 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:(4636009)(366004)(2906002)(26005)(2616005)(83380400001)(235185007)(86362001)(5660300002)(36756003)(8936002)(186003)(508600001)(6512007)(84970400001)(38350700002)(6916009)(38100700002)(66556008)(33964004)(6506007)(316002)(6486002)(66476007)(44832011)(66946007)(52116002)(8676002)(44144004)(4326008)(4216001)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3054 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: VE1EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3e1a1d90-b6e1-49ff-44de-08d9bee5d53c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tC+khh8oI4G58RJ2uPdrQjeGhcS+zsDvzYo9Sc2bZXhV4cvf74t/Jg40lTdwRX7xJ2FottUgixxcBJ+2NZlJwDLFW36U8cpB0I/1yMoBD8eXTqlcswrQ2YD/JzLAwIq82u4abtACRELUwdKWpfrztgWxuG4hbslgpv0p2oeTupcR2vE7ly08u2qP4hborU8wIX0/8vlGQZ3DGDgr8Jptk+sMC6W59mEGHXwVUQA8Ca+z3KYzFlG+cXSm1b/wEvsyLvxzMKYKWaU7vAKp72N/6PaHoaUozuH9LON6VB4B6Sd+YBd2tTuS1sVUouK8/Ic/3IPkC6XwfOvOhItvZ2GCJ66uiKBSa0P5D7SyIDaQtGKjE7WyQxTXJgCcyzEyPT2GVjBw6Jurzi3c7syelU6a+wZ20qWQAuJS0lI8VSiFM0Cyuiy6f9CSGCmR2AWR11i+oajHsRXXJNUFgXnO5YT7GRNMg74bpyQEX8ZgxQtJbrXyJS+AR6NFDaywj+wUbnIGxRP+rhsyvG4A6IYonTQaz8j9V0f+mDCS7sPGzqRM/Gt9zySzu5aKlP4Pe2BHHWINNZilYg5mU5Vcfcm++YFEUwtDJ+nGzvhJtOe1s+jKRBZT9aMQE1NnNNnKzO+JZ7yZHzUN1aPoo3ScScruRGCdMWWPE2lCAnTg6mPMhk+qDm3nOPWWzt9wZC+S/wcYGwvo0NlLEsBBkvpUoCm5Sn9roLuVTKzq0cBPGly8v6kV3kHU6U+AM5yFRr42bKMI8iUdcV5HP/UaYJiVBB6y+Hk/CEMUWIOVWyCp0WJu9Nhpnd8tHoo8rBvG7qoNyVF11irTb0P1dNVn3J2Rt/ZmPViACRZy/0rTDRwmUD+qmfAiJ5ldiAPMhaFjr3VjyFlrLEpJHDbLzBswG7PZwHKqUgsdfQ== 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)(46966006)(36840700001)(40470700001)(82310400004)(36756003)(356005)(6506007)(2616005)(336012)(8936002)(86362001)(84970400001)(70586007)(508600001)(83380400001)(81166007)(70206006)(316002)(47076005)(6916009)(4326008)(40460700001)(2906002)(186003)(235185007)(36860700001)(44832011)(6486002)(5660300002)(6512007)(33964004)(26005)(44144004)(8676002)(4216001)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Dec 2021 09:41:19.5820 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 35ae4b82-225a-40cc-0fdc-08d9bee5e1f3 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: VE1EUR03FT006.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6285 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_LOTSOFHASH, KAM_SHORT, 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: Richard.Earnshaw@arm.com, nd@arm.com, richard.sandiford@arm.com, Marcus.Shawcroft@arm.com Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi All, The new partial and full vector types added to AArch64, e.g. int8x8x2_t with mode V2x8QI are incorrectly being defined as being short vectors and not being composite types. This causes the layout code to incorrectly conclude that the registers are packed. i.e. for V2x8QI it thinks those 16-bytes are in the same registers. Because of this the code under !aarch64_composite_type_p is unreachable but also lacked any extra checks to see that nregs is what we expected it to be. I have also updated aarch64_advsimd_full_struct_mode_p and aarch64_advsimd_partial_struct_mode_p to only consider vector types as struct modes. Otherwise types such as OImode and friends would qualify leading to incorrect results. This patch fixes up the issues and we now generate correct code. Bootstrapped Regtested on aarch64-none-linux-gnu and no issues. Ok for master? Thanks, Tamar gcc/ChangeLog: PR target/103094 * config/aarch64/aarch64.c (aarch64_function_value, aarch64_layout_arg): Fix unreachable code for partial vectors and re-order switch to perform the simplest test first. (aarch64_short_vector_p): Mark as not short vectors. (aarch64_composite_type_p): Mark as composite types. (aarch64_advsimd_partial_struct_mode_p, aarch64_advsimd_full_struct_mode_p): Restrict to actual SIMD types. gcc/testsuite/ChangeLog: PR target/103094 * gcc.target/aarch64/pr103094.c: New test. --- inline copy of patch -- diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index fdf05505846721b02059df494d6395ae9423a8ef..d9104ddac3cdd44f7c2290b8725d05be4fd6468f 100644 diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index fdf05505846721b02059df494d6395ae9423a8ef..d9104ddac3cdd44f7c2290b8725d05be4fd6468f 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -3055,15 +3055,17 @@ aarch64_advsimd_struct_mode_p (machine_mode mode) static bool aarch64_advsimd_partial_struct_mode_p (machine_mode mode) { - return (aarch64_classify_vector_mode (mode) - == (VEC_ADVSIMD | VEC_STRUCT | VEC_PARTIAL)); + return VECTOR_MODE_P (mode) + && (aarch64_classify_vector_mode (mode) + == (VEC_ADVSIMD | VEC_STRUCT | VEC_PARTIAL)); } /* Return true if MODE is an Advanced SIMD Q-register structure mode. */ static bool aarch64_advsimd_full_struct_mode_p (machine_mode mode) { - return (aarch64_classify_vector_mode (mode) == (VEC_ADVSIMD | VEC_STRUCT)); + return VECTOR_MODE_P (mode) + && (aarch64_classify_vector_mode (mode) == (VEC_ADVSIMD | VEC_STRUCT)); } /* Return true if MODE is any of the data vector modes, including @@ -6468,17 +6470,21 @@ aarch64_function_value (const_tree type, const_tree func, NULL, false)) { gcc_assert (!sve_p); - if (!aarch64_composite_type_p (type, mode)) + if (aarch64_advsimd_full_struct_mode_p (mode)) + { + gcc_assert (known_eq (exact_div (GET_MODE_SIZE (mode), 16), count)); + return gen_rtx_REG (mode, V0_REGNUM); + } + else if (aarch64_advsimd_partial_struct_mode_p (mode)) + { + gcc_assert (known_eq (exact_div (GET_MODE_SIZE (mode), 8), count)); + return gen_rtx_REG (mode, V0_REGNUM); + } + else if (!aarch64_composite_type_p (type, mode)) { gcc_assert (count == 1 && mode == ag_mode); return gen_rtx_REG (mode, V0_REGNUM); } - else if (aarch64_advsimd_full_struct_mode_p (mode) - && known_eq (GET_MODE_SIZE (ag_mode), 16)) - return gen_rtx_REG (mode, V0_REGNUM); - else if (aarch64_advsimd_partial_struct_mode_p (mode) - && known_eq (GET_MODE_SIZE (ag_mode), 8)) - return gen_rtx_REG (mode, V0_REGNUM); else { int i; @@ -6745,6 +6751,7 @@ aarch64_layout_arg (cumulative_args_t pcum_v, const function_arg_info &arg) /* No frontends can create types with variable-sized modes, so we shouldn't be asked to pass or return them. */ size = GET_MODE_SIZE (mode).to_constant (); + size = ROUND_UP (size, UNITS_PER_WORD); allocate_ncrn = (type) ? !(FLOAT_TYPE_P (type)) : !FLOAT_MODE_P (mode); @@ -6769,17 +6776,21 @@ aarch64_layout_arg (cumulative_args_t pcum_v, const function_arg_info &arg) if (nvrn + nregs <= NUM_FP_ARG_REGS) { pcum->aapcs_nextnvrn = nvrn + nregs; - if (!aarch64_composite_type_p (type, mode)) + if (aarch64_advsimd_full_struct_mode_p (mode)) + { + gcc_assert (nregs == size / 16); + pcum->aapcs_reg = gen_rtx_REG (mode, V0_REGNUM + nvrn); + } + else if (aarch64_advsimd_partial_struct_mode_p (mode)) + { + gcc_assert (nregs == size / 8); + pcum->aapcs_reg = gen_rtx_REG (mode, V0_REGNUM + nvrn); + } + else if (!aarch64_composite_type_p (type, mode)) { gcc_assert (nregs == 1); pcum->aapcs_reg = gen_rtx_REG (mode, V0_REGNUM + nvrn); } - else if (aarch64_advsimd_full_struct_mode_p (mode) - && known_eq (GET_MODE_SIZE (pcum->aapcs_vfp_rmode), 16)) - pcum->aapcs_reg = gen_rtx_REG (mode, V0_REGNUM + nvrn); - else if (aarch64_advsimd_partial_struct_mode_p (mode) - && known_eq (GET_MODE_SIZE (pcum->aapcs_vfp_rmode), 8)) - pcum->aapcs_reg = gen_rtx_REG (mode, V0_REGNUM + nvrn); else { rtx par; @@ -19285,6 +19296,13 @@ aarch64_short_vector_p (const_tree type, else size = GET_MODE_SIZE (mode); } + + /* If a Advanced SIMD partial or full aggregate vector type we aren't a short + type. */ + if (aarch64_advsimd_partial_struct_mode_p (mode) + || aarch64_advsimd_full_struct_mode_p (mode)) + return false; + if (known_eq (size, 8) || known_eq (size, 16)) { /* 64-bit and 128-bit vectors should only acquire an SVE mode if @@ -19316,6 +19334,12 @@ static bool aarch64_composite_type_p (const_tree type, machine_mode mode) { + /* If a Advanced SIMD partial or full aggregate vector type we are a + composite type. */ + if (aarch64_advsimd_partial_struct_mode_p (mode) + || aarch64_advsimd_full_struct_mode_p (mode)) + return true; + if (aarch64_short_vector_p (type, mode)) return false; diff --git a/gcc/testsuite/gcc.target/aarch64/pr103094.c b/gcc/testsuite/gcc.target/aarch64/pr103094.c new file mode 100644 index 0000000000000000000000000000000000000000..441e602928ce8ac4e9890a1376acbc25671e284d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/pr103094.c @@ -0,0 +1,21 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-fdump-rtl-expand -w" } */ + +#include + +void foo (uint8x8x2_t cols_01_23, uint8x8x2_t cols_45_67, uint16_t* outptr0) +{ + uint16x4x4_t cols_01_23_45_67 = { { + vreinterpret_u16_u8(cols_01_23.val[0]), + vreinterpret_u16_u8(cols_01_23.val[1]), + vreinterpret_u16_u8(cols_45_67.val[0]), + vreinterpret_u16_u8(cols_45_67.val[1]) + } }; + + vst4_lane_u16(outptr0, cols_01_23_45_67, 0); +} + +/* Check that we expand to v0 and v2 from the function arguments. */ +/* { dg-final { scan-rtl-dump {\(reg:V2x8QI \d+ v0 \[ cols_01_23 \]\)} expand } } */ +/* { dg-final { scan-rtl-dump {\(reg:V2x8QI \d+ v2 \[ cols_45_67 \]\)} expand } } */ +