From patchwork Wed Jun 7 14:00:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Coplan X-Patchwork-Id: 70734 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 69B823856613 for ; Wed, 7 Jun 2023 14:01:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69B823856613 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686146502; bh=TkyNqMQatdFVUvy1zCvKD7eBo5E8tIkccgLqG4p6S0U=; h=Date:To:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=EPqrTCA/F9PHAg9x9N9+oqkcvwS7GwBvQDc+fpU+90xozlwWD/1HL3k3VYGDfwkKn mgPo4eYEqsrtAm/iIb+GKcfOEjfGa5ecDKv6GPG2gdQ9TeBlNZnAw3v3yALuDKmmpD 0Xi6U2UzMYC8X5if2kkZ4o9+tQ+1M8QHOmQAT4rQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2066.outbound.protection.outlook.com [40.107.104.66]) by sourceware.org (Postfix) with ESMTPS id EA1EC385734A for ; Wed, 7 Jun 2023 14:01:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EA1EC385734A Received: from AS9P250CA0003.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:532::9) by AS2PR08MB9917.eurprd08.prod.outlook.com (2603:10a6:20b:55f::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Wed, 7 Jun 2023 14:01:01 +0000 Received: from AM7EUR03FT064.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:532:cafe::1d) by AS9P250CA0003.outlook.office365.com (2603:10a6:20b:532::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.19 via Frontend Transport; Wed, 7 Jun 2023 14:01:01 +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 AM7EUR03FT064.mail.protection.outlook.com (100.127.140.127) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.22 via Frontend Transport; Wed, 7 Jun 2023 14:01:01 +0000 Received: ("Tessian outbound 3570909035da:v136"); Wed, 07 Jun 2023 14:01:01 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a909882507ce6278 X-CR-MTA-TID: 64aa7808 Received: from 138283dd3013.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6523CCE4-F96B-4177-A4E2-14022329EA36.1; Wed, 07 Jun 2023 14:00:54 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 138283dd3013.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 07 Jun 2023 14:00:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U9gzO/dcVWluxp1qBzQzKaZ3/8udqujAtUJ6E2igKFZOOsPYnu05zwuigGA3+KAyHft6L0habJQStLtgz4jOEzRRT2UTBqy5v1gxCGrg6eQjUGLWlFgEIukZdWv/3guzD7C+vwS4MYVTbf/h+txqfWeHQV+Gz/19ETQACew1K89aNXGeycXui8qaa+0nReGHyXpsymJeNY24IUiODuJUolIGT2ipafX1SQg9kT7kVtwwQIfmgENhbVky1SPVJKOniU2pqKkAIdBkOmDHSMQbZcuPj2VGbkL6T7L3XX8cbnLmH3v2+A1toi87ryYswfKwmH3jbtz7eZH+qwBazw+L+A== 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=TkyNqMQatdFVUvy1zCvKD7eBo5E8tIkccgLqG4p6S0U=; b=cQKDI4Z3amc8sRWja2PBvtMxHo0t24IYr59UpT1I+GZxsZMvNztJB6QVMUmlX3L586nX9I8lc2FaK/VvsKCQZzlt0p5w5ioZ5pYmRApKT6qA/MwdV2N4mMudW+LkJHYE594ctmaqVNKU10W4ES1kSCC7FsNXqCXqo73RhwXoFlZ+P10GMIfANKpL3OuJt98W9d55wjUg3NL0Lh/8VvTd5Pv2WDkNVuJDzOUevLwhGQ3oMfH0wQh49rEnebRBrJmC30KE7jnnv5RHX2EZJYeKYigNmkUIjlXhCXPZ3mjUA7o0URBaXMAwrTpR/BFHTL+41PsRd4hj+WqUdsS3qrYrig== 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 PAXPR08MB7201.eurprd08.prod.outlook.com (2603:10a6:102:20b::17) by PA4PR08MB5933.eurprd08.prod.outlook.com (2603:10a6:102:f0::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Wed, 7 Jun 2023 14:00:52 +0000 Received: from PAXPR08MB7201.eurprd08.prod.outlook.com ([fe80::5b72:ef2:156a:296a]) by PAXPR08MB7201.eurprd08.prod.outlook.com ([fe80::5b72:ef2:156a:296a%6]) with mapi id 15.20.6455.030; Wed, 7 Jun 2023 14:00:52 +0000 Date: Wed, 7 Jun 2023 15:00:49 +0100 To: gcc-patches@gcc.gnu.org Cc: Richard Earnshaw , Richard Sandiford , Kyrylo Tkachov Subject: [PATCH 2/3] aarch64: Fix wrong code with st64b builtin [PR110100] Message-ID: Content-Disposition: inline X-ClientProxiedBy: LO4P123CA0159.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:188::20) To PAXPR08MB7201.eurprd08.prod.outlook.com (2603:10a6:102:20b::17) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: PAXPR08MB7201:EE_|PA4PR08MB5933:EE_|AM7EUR03FT064:EE_|AS2PR08MB9917:EE_ X-MS-Office365-Filtering-Correlation-Id: 4984834c-9b3f-460e-7b0b-08db675fa0b5 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: xG+NU70d3nPxi+pul19z/zMnBiilNSME65qcHHHdjHV8PyPvbbfwScIwoGeh3j6oAW0ALE+PXFqZmGVgknbuq+LVMuLdwTER51Ttzum0muh0o7RMcQiBczhZ0+FgTxSETf/yW2eaLlCAzP9i2MgsAQ/dQGrj13E+CpOkUPYCSneQWyz7/sM9x0C8NIO7YRFGcaJU/MgpVY6grnT31C0IP20OJQS0AJfD4q9MvK4FJi8zisTaqqs+6QvZPkrrISMkOjTjzabBepsmOIKJNdlsfUYmfzp5B8G7M4cOw2mYXsnX937kCOmEuB6Tt+c3NiMaNfgsP0OmW+76dsF/sGVPfUdLoGf0ANJ9zF2JL0R6rW2pPNyPmJLXxjKOa+1JWNo9kCtTpSWK5tuex7Xo2DL0HT4PtSrpfHX4qrprYnX670pAl4iIYgpgTuy/DgPGTTFRpyZfNuCizyha4xNZn8F+4cW03jpm0ZRCRlkeu8J/S7/vpt+mN181o6BpJFIeSFHJIHZ8R0f7CIZqvU9YsAYktXuoRVebP9E5tixTzoJzz4X9yB4qHHeq42Xo05P7Af4/g0ao3zwHOqZLIBVN4ZtHmkgig/mtIX3pL+ndyANYEsw= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR08MB7201.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(136003)(366004)(376002)(396003)(39860400002)(346002)(451199021)(478600001)(2906002)(6486002)(44144004)(33964004)(36756003)(6666004)(2616005)(83380400001)(86362001)(6512007)(6506007)(38100700002)(26005)(186003)(5660300002)(316002)(8676002)(66946007)(6916009)(8936002)(66556008)(4326008)(66476007)(235185007)(44832011)(54906003)(84970400001)(41300700001)(2700100001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5933 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: AM7EUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: d812287f-f61c-4c9f-df23-08db675f9b0d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ILn35OjJIPIEZd0PKjc1x/DBrbp76tbIEBwyOgmGvya1jI/hY89ySbrMr6BsBCefaXrnsmgWLtReph7ZADfEctlifev59VIqeutoZ/qHSXwd3XbPK5jyJ4llG0NBHtLS+kl8T6N9gqfVe43FXJ76PIzqvAoeONJ+TXLpMuLEy4n0cETy7iqyZ41xKP3cAe2JrnoHjeAu44fzEH9xG2UtN/zmnjipR7B658Y7qdjsu9Ta+Yv88KYegjNDvSerDTKRhorD4bMXXWx+pH9l2jA9lUgnv4ndDOqYveHMz49NTytPYcQnaM58dGkC4r+Jb/atUpsxFXQLAdPZLRfqpHl0/Scnn5H2lLna8cCv3WLFYOc4oc3S6TO3InPQOeymjiETMsdMiiz4HP4qrAzaXEJ9aHpfN1MLE50E/sAGkeEZBFKNZTRbDp496irJLo7irS6oETLu3YT0Xs5Y+sH8dR8f+e6hD7WyyU2cufQAh1n9NRQWGwl3T9RNOTP4mlnBN27VwxbCaEetueOzbxDLzdMmCPB/w0laaPoC+7DpxGmZqXkjn/97A3f6avs18t0KiWEdc3TRDLUmqJILsc6ViPvC6ww+msUfkTFVsTfh/26JIjxLbSRyixr3DQUfISemhRoqMpgN9Npr+/Jn06hMTmWKUBmzeeYXfQGBY4F6uU/rLxf8ngPwubzgcUaTol6XFXtacrMpsIQG88NG69ZdsORPtSyhWQNOcYqlXEYUHI32YTwBYYdNdKzvec27irm0CzN9hhOhGsLWccrfEyuvYTiCJQ== 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:(13230028)(4636009)(346002)(376002)(136003)(39860400002)(396003)(451199021)(40470700004)(46966006)(36840700001)(2906002)(41300700001)(316002)(44832011)(54906003)(82740400003)(81166007)(84970400001)(356005)(235185007)(5660300002)(70206006)(4326008)(6916009)(8676002)(8936002)(70586007)(478600001)(6666004)(6486002)(82310400005)(40460700003)(44144004)(33964004)(86362001)(186003)(2616005)(36756003)(26005)(336012)(47076005)(40480700001)(6512007)(36860700001)(6506007)(83380400001)(2700100001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2023 14:01:01.8234 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4984834c-9b3f-460e-7b0b-08db675fa0b5 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: AM7EUR03FT064.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9917 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_DMARC_NONE, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alex Coplan via Gcc-patches From: Alex Coplan Reply-To: Alex Coplan Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" The st64b pattern incorrectly had an output constraint on the register operand containing the destination address for the store, leading to wrong code. This patch fixes that. gcc/ChangeLog: PR target/110100 * config/aarch64/aarch64-builtins.cc (aarch64_expand_builtin_ls64): Use input operand for the destination address. * config/aarch64/aarch64.md: Fix constraint on address operand. gcc/testsuite/ChangeLog: PR target/110100 * gcc.target/aarch64/acle/pr110100.c: New test. --- gcc/config/aarch64/aarch64-builtins.cc | 2 +- gcc/config/aarch64/aarch64.md | 2 +- gcc/testsuite/gcc.target/aarch64/acle/pr110100.c | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/acle/pr110100.c diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc index a3ae1a8e99e..cb5828a70f4 100644 --- a/gcc/config/aarch64/aarch64-builtins.cc +++ b/gcc/config/aarch64/aarch64-builtins.cc @@ -2519,7 +2519,7 @@ aarch64_expand_builtin_ls64 (int fcode, tree exp, rtx target) { rtx op0 = expand_normal (CALL_EXPR_ARG (exp, 0)); rtx op1 = expand_normal (CALL_EXPR_ARG (exp, 1)); - create_output_operand (&ops[0], op0, DImode); + create_input_operand (&ops[0], op0, DImode); create_input_operand (&ops[1], op1, V8DImode); expand_insn (CODE_FOR_st64b, 2, ops); return const0_rtx; diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 11d0d9c8eb6..ac39a4d683e 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -7928,7 +7928,7 @@ (define_insn "ld64b" ) (define_insn "st64b" - [(set (mem:V8DI (match_operand:DI 0 "register_operand" "=r")) + [(set (mem:V8DI (match_operand:DI 0 "register_operand" "r")) (unspec_volatile:V8DI [(match_operand:V8DI 1 "register_operand" "r")] UNSPEC_ST64B) )] diff --git a/gcc/testsuite/gcc.target/aarch64/acle/pr110100.c b/gcc/testsuite/gcc.target/aarch64/acle/pr110100.c new file mode 100644 index 00000000000..f56d5e619e8 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/acle/pr110100.c @@ -0,0 +1,7 @@ +/* { dg-do compile } */ +/* { dg-options "-march=armv8.7-a -O2" } */ +#include +void do_st64b(data512_t data) { + __arm_st64b((void*)0x10000000, data); +} +/* { dg-final { scan-assembler {mov\tx([123])?[0-9], 268435456} } } */