From patchwork Mon Jan 16 07:11:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejas Belagod X-Patchwork-Id: 43995 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1058261wrn; Sun, 15 Jan 2023 23:13:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXuH5OBgZ0DG4+NbUtXoCxzbQFROgThTGiRL8nXRsKIlnURhU+4zA6T5/0KNgjReaXAOyJLP X-Received: by 2002:a17:907:6d21:b0:805:1e6e:6777 with SMTP id sa33-20020a1709076d2100b008051e6e6777mr15568358ejc.23.1673853220803; Sun, 15 Jan 2023 23:13:40 -0800 (PST) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ww2-20020a170907084200b007c163a17f44si8239541ejb.995.2023.01.15.23.13.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Jan 2023 23:13:40 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=btUdy7wW; arc=fail (signature failed); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7D0BA3858408 for ; Mon, 16 Jan 2023 07:13:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D0BA3858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673853219; bh=8npB6n2iOEcIWWORVz+k9xNku/YLOh/PmtMd5Pvq2Cc=; h=To:CC:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=btUdy7wWhUyLxyJhpb668Dnmhk6hy1H94SwXKh1DE6gNvkggCfE9ABkfGToRzOSTL zxkziugC1zo/UcOrW3f/dsGKHbqn5z27MrtXCPXyvw8BW0hsNrwHaJSx6kQ8H60BTG Vl4SYK5MSyXHxQkr+uW+iHgDxyUzEW+geqWyU/E4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2082.outbound.protection.outlook.com [40.107.6.82]) by sourceware.org (Postfix) with ESMTPS id 30C873858D32 for ; Mon, 16 Jan 2023 07:12:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 30C873858D32 Received: from AS9PR0301CA0046.eurprd03.prod.outlook.com (2603:10a6:20b:469::6) by PR3PR08MB5755.eurprd08.prod.outlook.com (2603:10a6:102:86::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Mon, 16 Jan 2023 07:12:48 +0000 Received: from AM7EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:469:cafe::6) by AS9PR0301CA0046.outlook.office365.com (2603:10a6:20b:469::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.19 via Frontend Transport; Mon, 16 Jan 2023 07:12:48 +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 AM7EUR03FT039.mail.protection.outlook.com (100.127.140.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13 via Frontend Transport; Mon, 16 Jan 2023 07:12:47 +0000 Received: ("Tessian outbound b1d3ffe56e73:v132"); Mon, 16 Jan 2023 07:12:47 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 4246061b217e33a6 X-CR-MTA-TID: 64aa7808 Received: from ff8ba44b21a5.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 1857FB50-507E-4500-828A-0FFB469057C4.1; Mon, 16 Jan 2023 07:12:40 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ff8ba44b21a5.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 16 Jan 2023 07:12:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZmTjXu6kK1k64WnlOStJuCrY+yJN9brWIxkX9g0wvpWOxyXX9YSUHpp6+JDFxjawsyORmV5ZARuSXls3FotiZy20fiM7uH1YzebVSUdbAP+soBudBmHpFobvsJ1ddHfx1IRNgz2Q3ulmBQYxADwmL3cfXkqKP5qcfKZkpE4dSt/s5TVMERJZYyV0rbrrocFFro6m0RtzPiPAxLz2ezgoQgZ6e2T6QVoBqCbLNdWVDIHKOjKLHZDuNsKWfMM69gJpF1xMlHT+KMUn6GhRwKqui7lUj2nqflUayBdvai1JaleS9dVkvj5vxLZO6xEClK+Kqu6GVJBBSHhrwwsZzEwCrA== 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=8npB6n2iOEcIWWORVz+k9xNku/YLOh/PmtMd5Pvq2Cc=; b=KDpMdY0jH9rODWXzkIMxC/iWOHqJfTlzqgG8vunNjgO0ABruUc+ffdjXERW0bhkW6XStH6g/8fWpbuKK8Bm1XtcvA4FTjilF1yafAXjLHpOuyiR7DfuzVDQ2X5igWhopuTcOK4kWoRu2O/N7k+tkBCTCl0opvuElT+o525QXmpLzYSx8xSb7VMClFE0+VzhK+3EkApowDpatRs0JszTxIxpSCY0K2oS7t+TAK5+uLZAVPO6SwOJqAv2QvunGomeC/4qJPN9KtF8mF35MG9NksBBdddlRq61mEJpbqXOeZviU7LzooL8R7g2vKhYIEp2RF542uVg18LNBdyrFEc9kIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none Received: from AS9PR04CA0174.eurprd04.prod.outlook.com (2603:10a6:20b:530::15) by PAXPR08MB6416.eurprd08.prod.outlook.com (2603:10a6:102:152::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.22; Mon, 16 Jan 2023 07:12:38 +0000 Received: from AM7EUR03FT049.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:530:cafe::75) by AS9PR04CA0174.outlook.office365.com (2603:10a6:20b:530::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.19 via Frontend Transport; Mon, 16 Jan 2023 07:12:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT049.mail.protection.outlook.com (100.127.140.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.13 via Frontend Transport; Mon, 16 Jan 2023 07:12:38 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 16 Jan 2023 07:12:37 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 16 Jan 2023 07:12:37 +0000 Received: from e124570.cambridge.arm.com (10.2.79.30) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Mon, 16 Jan 2023 07:12:36 +0000 To: CC: Tejas Belagod , , Subject: [PATCH] AArch64: Gate various crypto intrinsics availability based on features Date: Mon, 16 Jan 2023 07:11:48 +0000 Message-ID: <20230116071148.427-1-tejas.belagod@arm.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT049:EE_|PAXPR08MB6416:EE_|AM7EUR03FT039:EE_|PR3PR08MB5755:EE_ X-MS-Office365-Filtering-Correlation-Id: 03ee10f0-5153-4d34-da47-08daf7911275 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: ynD0loO0GwRp9+L/xgZmhM7KVs7P2wfq0DSiYBi6WnvFmHE25iuVoeDyaiFcNBcU00CZlDcbzeUvUipGetyyL35ZwIMORJNEjAjNdx0ZBRYMFMsiw2WDmvu21u9Maak9YXwYYOTX9HhamkCKlkwUlfLSMBvx51DuJc+PJJ2uawohbvUW7ppTd0ecGqV7+4RJIxZN6B9GfZ1yeAtM7BmV4GMbEYlBW4dvbZvcvS1zd/ZcJ8P2jIy7ySLH4jk3CULiQnb9CiT7wHu6TXlBsmEn2tMXLaD2eVAd1pbBlUDe060+wxSzPnTrPS4or5QgNFE6ZbLk3liA/6hk/AbBiOtBlVpyfXv1fHIVTwKluQ8UsmETcPcjtPPVI9Tx/c+4fdvsAsrrXBLGCjIZK2JGggxnzOvwacLpQ9majb+P8S/eF/9GbXbsO2che3q7awcqnk7xd4v+dVP/qrTO6gWgTJMhsoRyyezA4GkgT9D/UsKHtCHa6S8hkBN19OV7WZ4mx9Gv6iUa4GJXSdRocclquu/UTZZip8xHNRnUBwe5eVBzHlw1gTBCttLax2j/G6k9F24vSgXaYOMH8Mgj433RPmW310j85wCwN33s3pBO6BQgmGnztO+UZkG/V84bbL0jirGKHNv0+oAn/STc+YBZ8hAgzWXu3B3MAs9wbXq1AN4mKU6HCh1dlLD0tUEU9CHKcDbT3F469dqcM9Dv5gjDsKdYHoxpOt5CEELnMubFSo9t9D+d7Pj94/9qG7ifdFfGtd4rv6MkrxXFCGPXK4a81qc3oQ== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(376002)(346002)(396003)(136003)(39860400002)(451199015)(36840700001)(46966006)(316002)(54906003)(6916009)(8936002)(5660300002)(8676002)(83380400001)(70206006)(70586007)(4326008)(426003)(41300700001)(36756003)(47076005)(356005)(81166007)(336012)(2616005)(1076003)(82740400003)(36860700001)(86362001)(186003)(26005)(82310400005)(40480700001)(7696005)(6666004)(478600001)(84970400001)(2906002)(44832011)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR08MB6416 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: db8e3c14-d9bf-4387-fa12-08daf7910cc4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g1axSi1926XGlo5v4atGeQN7fCI3f4mUm7uW1cMxijTgeIbHBAG1KQAW1im5zXE+swvEJ1XzW8t4jqfcP/yqfM9/9aMRzbHUxKCqbigFfIJ6/WYkOWlP9yTMzgtVTZRR/EdRc2SuHZIX7a4fgZADbJeXfhZD4UVwG/AT5W651b9aPcPuamLKkTJ7ZTRgMEJaUSvgGj/zboG1NbnjU8D0/te4/MN1bQSwtcYVuUYcOG8c1pauC4d7BYVTp6qbJpSpJLPMs8izTgoHWrLfLrhVv8R6lqDxDh3WV3s8PKxP8r8fFEMhWlR4YhtG2mr2HW4lAYZuYpfFRM5DyEnqyzFsaWuYQFacAEPB/NYhSj4ZqvsKALLW6FbVBfcffxKFV6lGBELQIOjv9mOuw/rlyCBjFvQn+ykUrcNSaXxcfKrBqvpJOlRyMGUL1bjQKXbOUngSZ3CCWYZPWajuz+yTodFImlerxqoGdqQn9VQ9VpXOZn+TVLWAMmuXeZ+AHDXwsu3u2KT1HxappEuDjfqxSL3aWUS8elGMAsNWjo8boREA9Jy4ggpVWE6k9fHTbMIGrWf2VKcEiqkNCiZ7B9ga+qgxHZjPaSXMlBe00VkOj46iqvWyvdsSrOnipT03Jh/DfB4nGtGahRoj8/TUxxDf2D3pe2epOcMZxovqjCqGSBpt171hJ12TuMPnADP7lyz1LFsEWEOsQpPvdUbrwJ29KMwiuCwhxaqt1bCAbfyBRDqQvTYxNyw9Vu4PDncc3TE2lyyGZDUJjB0q/K2caFepooa9WQ== 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:(13230022)(4636009)(376002)(136003)(39860400002)(396003)(346002)(451199015)(36840700001)(40470700004)(46966006)(7696005)(40460700003)(44832011)(186003)(4326008)(5660300002)(478600001)(41300700001)(2616005)(26005)(70586007)(8676002)(70206006)(6916009)(336012)(316002)(40480700001)(1076003)(83380400001)(82310400005)(54906003)(36756003)(8936002)(47076005)(426003)(36860700001)(82740400003)(84970400001)(6666004)(86362001)(2906002)(81166007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2023 07:12:47.7597 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 03ee10f0-5153-4d34-da47-08daf7911275 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: AM7EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5755 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_SHORT, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tejas Belagod via Gcc-patches From: Tejas Belagod Reply-To: Tejas Belagod Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755162314398928345?= X-GMAIL-MSGID: =?utf-8?q?1755162314398928345?= The 64-bit variant of PMULL{2} and AES instructions are available if FEAT_AES is implemented according to the Arm ARM [1]. Similarly FEAT_SHA1 and FEAT_SHA256 enable the use of SHA1 and SHA256 instruction variants. This patch fixes arm_neon.h to correctly reflect the feature availability based on '+aes' and '+sha2' as opposed to the ambiguous catch-all '+crypto'. [1] Section D17.2.61, C7.2.215 2022-01-11 Tejas Belagod gcc/ * config/aarch64/arm_neon.h: Gate AES and PMULL64 intrinsics under target feature +aes as opposed to +crypto. Gate SHA1 and SHA2 intrinsics under +sha2. testsuite/ * gcc.target/aarch64/acle/pmull64.c: New. * gcc/testsuite/gcc.target/aarch64/aes-fuse-1.c: Replace '+crypto' with corresponding feature flag based on the intrinsic. * gcc.target/aarch64/aes-fuse-2.c: Likewise. * gcc.target/aarch64/aes_1.c: Likewise. * gcc.target/aarch64/aes_2.c: Likewise. * gcc.target/aarch64/aes_xor_combine.c: Likewise. * gcc.target/aarch64/sha1_1.c: Likewise. * gcc.target/aarch64/sha256_1.c: Likewise. * gcc.target/aarch64/target_attr_crypto_ice_1.c: Likewise. --- gcc/config/aarch64/arm_neon.h | 35 ++++++++++--------- .../gcc.target/aarch64/acle/pmull64.c | 14 ++++++++ gcc/testsuite/gcc.target/aarch64/aes-fuse-1.c | 4 +-- gcc/testsuite/gcc.target/aarch64/aes-fuse-2.c | 4 +-- gcc/testsuite/gcc.target/aarch64/aes_1.c | 2 +- gcc/testsuite/gcc.target/aarch64/aes_2.c | 4 ++- .../gcc.target/aarch64/aes_xor_combine.c | 2 +- gcc/testsuite/gcc.target/aarch64/sha1_1.c | 2 +- gcc/testsuite/gcc.target/aarch64/sha256_1.c | 2 +- .../aarch64/target_attr_crypto_ice_1.c | 2 +- 10 files changed, 44 insertions(+), 27 deletions(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/acle/pmull64.c diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h index cf6af728ca9..a795a387b38 100644 --- a/gcc/config/aarch64/arm_neon.h +++ b/gcc/config/aarch64/arm_neon.h @@ -7496,7 +7496,7 @@ vqrdmlshs_laneq_s32 (int32_t __a, int32_t __b, int32x4_t __c, const int __d) #pragma GCC pop_options #pragma GCC push_options -#pragma GCC target ("+nothing+crypto") +#pragma GCC target ("+nothing+aes") /* vaes */ __extension__ extern __inline uint8x16_t @@ -7526,6 +7526,22 @@ vaesimcq_u8 (uint8x16_t data) { return __builtin_aarch64_crypto_aesimcv16qi_uu (data); } + +__extension__ extern __inline poly128_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmull_p64 (poly64_t __a, poly64_t __b) +{ + return + __builtin_aarch64_crypto_pmulldi_ppp (__a, __b); +} + +__extension__ extern __inline poly128_t +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +vmull_high_p64 (poly64x2_t __a, poly64x2_t __b) +{ + return __builtin_aarch64_crypto_pmullv2di_ppp (__a, __b); +} + #pragma GCC pop_options /* vcage */ @@ -20772,7 +20788,7 @@ vrsrad_n_u64 (uint64_t __a, uint64_t __b, const int __c) } #pragma GCC push_options -#pragma GCC target ("+nothing+crypto") +#pragma GCC target ("+nothing+sha2") /* vsha1 */ @@ -20849,21 +20865,6 @@ vsha256su1q_u32 (uint32x4_t __tw0_3, uint32x4_t __w8_11, uint32x4_t __w12_15) __w12_15); } -__extension__ extern __inline poly128_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -vmull_p64 (poly64_t __a, poly64_t __b) -{ - return - __builtin_aarch64_crypto_pmulldi_ppp (__a, __b); -} - -__extension__ extern __inline poly128_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -vmull_high_p64 (poly64x2_t __a, poly64x2_t __b) -{ - return __builtin_aarch64_crypto_pmullv2di_ppp (__a, __b); -} - #pragma GCC pop_options /* vshl */ diff --git a/gcc/testsuite/gcc.target/aarch64/acle/pmull64.c b/gcc/testsuite/gcc.target/aarch64/acle/pmull64.c new file mode 100644 index 00000000000..6a1e99e2d0d --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/acle/pmull64.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=armv8.2-a" } */ + +#pragma push_options +#pragma GCC target ("+aes") + +#include "arm_neon.h" + +int foo (poly64_t a, poly64_t b) +{ + return vgetq_lane_s32 (vreinterpretq_s32_p128 (vmull_p64 (a, b)), 0); +} + +/* { dg-final { scan-assembler "\tpmull\tv" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/aes-fuse-1.c b/gcc/testsuite/gcc.target/aarch64/aes-fuse-1.c index d7b4f89919d..1b4e10f78db 100644 --- a/gcc/testsuite/gcc.target/aarch64/aes-fuse-1.c +++ b/gcc/testsuite/gcc.target/aarch64/aes-fuse-1.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -mcpu=cortex-a72+crypto -dp" } */ -/* { dg-additional-options "-march=armv8-a+crypto" { target { aarch64*-*-* } } }*/ +/* { dg-options "-O3 -mcpu=cortex-a72+aes -dp" } */ +/* { dg-additional-options "-march=armv8-a+aes" { target { aarch64*-*-* } } }*/ #include diff --git a/gcc/testsuite/gcc.target/aarch64/aes-fuse-2.c b/gcc/testsuite/gcc.target/aarch64/aes-fuse-2.c index dfe01b03a36..4c028b39083 100644 --- a/gcc/testsuite/gcc.target/aarch64/aes-fuse-2.c +++ b/gcc/testsuite/gcc.target/aarch64/aes-fuse-2.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -mcpu=cortex-a72+crypto -dp" } */ -/* { dg-additional-options "-march=armv8-a+crypto" { target { aarch64*-*-* } } }*/ +/* { dg-options "-O3 -mcpu=cortex-a72+aes -dp" } */ +/* { dg-additional-options "-march=armv8-a+aes" { target { aarch64*-*-* } } }*/ #include diff --git a/gcc/testsuite/gcc.target/aarch64/aes_1.c b/gcc/testsuite/gcc.target/aarch64/aes_1.c index 5578e85dab7..754c4ab90e7 100644 --- a/gcc/testsuite/gcc.target/aarch64/aes_1.c +++ b/gcc/testsuite/gcc.target/aarch64/aes_1.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-march=armv8-a+crypto" } */ +/* { dg-options "-march=armv8-a+aes" } */ #include "arm_neon.h" diff --git a/gcc/testsuite/gcc.target/aarch64/aes_2.c b/gcc/testsuite/gcc.target/aarch64/aes_2.c index 70f113fb5ab..442c1006706 100644 --- a/gcc/testsuite/gcc.target/aarch64/aes_2.c +++ b/gcc/testsuite/gcc.target/aarch64/aes_2.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -march=armv8-a+crypto" } */ +/* { dg-options "-O3 -march=armv8-a+aes" } */ #include "arm_neon.h" @@ -76,4 +76,6 @@ test7 (uint8x16_t a, uint8x16_t b) return result; } /* { dg-final { scan-assembler-not "mov" } } */ +/* { dg-final { scan-assembler "aesd\tv" } } */ +/* { dg-final { scan-assembler "aese\tv" } } */ diff --git a/gcc/testsuite/gcc.target/aarch64/aes_xor_combine.c b/gcc/testsuite/gcc.target/aarch64/aes_xor_combine.c index 833e9b3073b..ee0f0e99856 100644 --- a/gcc/testsuite/gcc.target/aarch64/aes_xor_combine.c +++ b/gcc/testsuite/gcc.target/aarch64/aes_xor_combine.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -mcpu=cortex-a55+crypto" } */ +/* { dg-options "-O3 -mcpu=cortex-a55+aes" } */ #include #define AESE(r, v, key) (r = vaeseq_u8 ((v), (key))); diff --git a/gcc/testsuite/gcc.target/aarch64/sha1_1.c b/gcc/testsuite/gcc.target/aarch64/sha1_1.c index e208fe7d93f..ba56c04a118 100644 --- a/gcc/testsuite/gcc.target/aarch64/sha1_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sha1_1.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-march=armv8-a+crypto" } */ +/* { dg-options "-march=armv8-a+sha2" } */ #include "arm_neon.h" diff --git a/gcc/testsuite/gcc.target/aarch64/sha256_1.c b/gcc/testsuite/gcc.target/aarch64/sha256_1.c index 2102daf20a3..c3860c6b537 100644 --- a/gcc/testsuite/gcc.target/aarch64/sha256_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sha256_1.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-march=armv8-a+crypto" } */ +/* { dg-options "-march=armv8-a+sha2" } */ #include "arm_neon.h" diff --git a/gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_1.c b/gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_1.c index c74cc900f98..3b354c06110 100644 --- a/gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_1.c +++ b/gcc/testsuite/gcc.target/aarch64/target_attr_crypto_ice_1.c @@ -6,7 +6,7 @@ /* Unless we do something about re-laying out the SIMD builtin types this testcase ICEs during expansion of the crypto builtin. */ -__attribute__ ((target ("cpu=cortex-a57+crypto"))) +__attribute__ ((target ("cpu=cortex-a57+sha2"))) uint32x4_t test_vsha1cq_u32 (uint32x4_t hash_abcd, uint32_t hash_e, uint32x4_t wk) {