From patchwork Thu Nov 9 11:26:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 163350 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp365865vqs; Thu, 9 Nov 2023 03:27:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEqq7Z5qk6IL8npqGe2cnOBSQyE53xcmyoMWr9Wx1erBgatPUknM7yTwjlHjGMAbaeCrvPv X-Received: by 2002:a05:622a:1303:b0:418:a0f:90e9 with SMTP id v3-20020a05622a130300b004180a0f90e9mr4334800qtk.1.1699529230998; Thu, 09 Nov 2023 03:27:10 -0800 (PST) ARC-Seal: i=4; a=rsa-sha256; t=1699529230; cv=pass; d=google.com; s=arc-20160816; b=Q6z1kJXdiJXBw3unqaqjtMjKJwvEkoxj62BDOL82wKuMJ8fC4nAfQarNT6bU6WS5FV xO2HAEjqQtWJrf2KE6+H2eU3eCotvpROraplF6GVMZyycOYhJh8vCMT+2Dj+rPfK0YQR Qg2q2TaWACWvNmeQwM1f9Onz3GeuXyrl8hWAST/TiJgdpS4FfMrvirNeINGEXWLLG+Yl 2S5LR/dNLM73FQ4aUhPnPl4+8dNkLnUFJCx0Uq0MTYLdNkEUOBPule2smZdtbJuyVSHR EPD6nsoVP97BQRt+6ww2HnTUKcTAcAKpvV+X1jiOl2Kx49CSfvom9XzWJDp4qryotH8H 6m0w== ARC-Message-Signature: i=4; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:original-authentication-results :nodisclaimer:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date :authentication-results-original:dkim-signature:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=z8mwBboVtork4Q3qQrAwufvK4WpXOxXXzce041pds8M=; fh=/GJKMeN7l+vB6+nVvLDPpFJynZqxxTy6OVbQu2XANxg=; b=TS7Ks+H5PbW3tBfhnchgpmt90ju+2UbnOi/+6edGgDfOolnJQFPBK3DQdglfDr6vkL vED6otCAcnjytPWS4r9hFZ3i+9GbRBLqKKqLhRiFAgl94SjCw1ENvmJmrJi5Nl/TOLuw mPXp4Rw7X4Js5nmwsag7tWxxi7gHYi/VU1DzI+9+zS4w5Sjk9tfAdnRF6ecSvGtslIv6 hVA4CQsfaWwwV8XHBzfBdRyWAdo0DLazNNI3fTE6+8t3NYGVPa1CNqSSykCMW9NkNaCZ fXqD0qUHQXR5AX+sLmPGypLLfYYemqrDNcIrO0OeoKF4Jv+zD67ELrY7EhoVhEZoIbZe cpRw== ARC-Authentication-Results: i=4; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=zj20R7Ur; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=zj20R7Ur; arc=pass (i=3); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d10-20020ac85d8a000000b004196b4b95e5si2780592qtx.690.2023.11.09.03.27.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 03:27:10 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=zj20R7Ur; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=zj20R7Ur; arc=pass (i=3); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BDBD63857713 for ; Thu, 9 Nov 2023 11:27:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2041.outbound.protection.outlook.com [40.107.21.41]) by sourceware.org (Postfix) with ESMTPS id 0C231385697D for ; Thu, 9 Nov 2023 11:26:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0C231385697D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0C231385697D Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.21.41 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699529206; cv=pass; b=uKNNM7cMbolfMejVDO9sjnIfTmuLOJGGMfuzpIDYxmrG6L+ZFOYYnWR5wKKIpyrhdfVCIvdy0V8yWIwzMx1OSXMvb0y24W4va0sPEYcd7cOXdy6OTqvwcXJQtNRVk24vRqYDNXsZqfAH0wAp8Dbo4P50EwGR7qpzUTzv11O3mKo= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699529206; c=relaxed/simple; bh=eoMps2LSRVUzLOmOtckpB1GRN2hAv3pURDPq+3WsvTs=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=r/kbNQJY8FmUI5UshEBBU7mriz4tz7GZcP+2ybYPLiuNmNgC7C2T4c1G+z1WL2umiFcIXVZ15QEGPjllIz1ViQLObeBcj5BcFZKtHic16O6ZjMisA+Kr3G9Zlceo8+5mb7CWo0ef5dflsR+ddkMyIdAaQIXkwaDJpZ0DY37kQu0= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=byupjsIg+yKBhX43UQHyYno9T060IVeecHI0WmitGeCKs+2t25znGFZ9zOVSQpZiQZ2vv5VwFmQ5fAhTwH1EhB4A61AqLjfnDQ8eCWSr1jkcVrRN9Tovja7/og/axjf09Oc2Xx4olfOTDkOWd9oRelyNNMSXT41EEhzxNsjFn+uckW51UsVNMU1kkYlSeaLWFQn19qFSPXc3ETBRP6molNuhdW12990RFwPJ/4HgNl+EW3rNFqnGCcTRTIS5gtAhLtzsjLOFZ3kb5KyYG6mp4PIbS2uQGCylhBbGB6/0vtlRc+aJLokA+iMQqi8KcHOnKlA+Vr6dDLanXqh8KVJQMw== ARC-Message-Signature: i=2; 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=z8mwBboVtork4Q3qQrAwufvK4WpXOxXXzce041pds8M=; b=CmyHHQLk++21C3FWQDg354WTtjfIox1t9nERvcMqf8nsITg2VnmEzjOaucAhniN8IfjDyCkQPQJZprRSmwPPZmIH8e0LMc/S4E2zGxX4Ne+tOEKVDACUXZa7cR5g0qwgAbp5S5uNzQzKB/qxKx3EFAZl02pVaNbyWafrX3VOvZ8ozu3PjTLerb6MsLpZn1ZsfOBs6a9spXzTkQb06lyPy5ZGL+jqnwf9vtrq6hmrjwSgXTofykGynovcpQ5M2tQLhfg7IVPs5ckXDXN1KwLTu9eZpBIgK0RHc9//Vn9q9FS2bqb4okwwHCOJVimKwM0OUVuM1ibe3bhHtCbRIsnTTQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=gcc.gnu.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=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=z8mwBboVtork4Q3qQrAwufvK4WpXOxXXzce041pds8M=; b=zj20R7UrntAGK3aMgZbd/o7lKFt02OXNT9jIPmd83gmOZ2YmD3OV4bKhicGcjdAWd+fe9bzS+OC/NVMOOrHhAOCq7fS4qqqWDnslkB5+4wX97aGIYLgMwkpXTvtAV1BkzcbWn4JOiIemkjvYrgiCNUKIGokKDGzmcVlp3JCRhkk= Received: from AS9PR04CA0156.eurprd04.prod.outlook.com (2603:10a6:20b:48a::28) by DU0PR08MB8138.eurprd08.prod.outlook.com (2603:10a6:10:3ed::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Thu, 9 Nov 2023 11:26:41 +0000 Received: from AMS1EPF00000041.eurprd04.prod.outlook.com (2603:10a6:20b:48a:cafe::fe) by AS9PR04CA0156.outlook.office365.com (2603:10a6:20b:48a::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.19 via Frontend Transport; Thu, 9 Nov 2023 11:26:40 +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 AMS1EPF00000041.mail.protection.outlook.com (10.167.16.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.16 via Frontend Transport; Thu, 9 Nov 2023 11:26:40 +0000 Received: ("Tessian outbound 8289ea11ec17:v228"); Thu, 09 Nov 2023 11:26:40 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: db4feb18f7f3abe4 X-CR-MTA-TID: 64aa7808 Received: from 5ca3fdc5605c.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8474EAC8-9424-4369-9216-5A200738719F.1; Thu, 09 Nov 2023 11:26:33 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5ca3fdc5605c.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Nov 2023 11:26:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VD9ctOl7/HaG2c9d3iwvrOKcL2QN9k7gu5cWyPSWirwQBscQDmtnx/Sez23gOybXfc1yT21nNy9oJsggS7tw24wXxEGMcPiHUYie+BRT5EEfASzMKtI7wmNyKIqtkdrSsIEF/X0hH0loxrc9B5B4cEZlWEHV1i8HCCuql7DiVEO0FT4PXiY5sKT/hhtElDMj6WzsyTmC49hxAViygnS2XgqWKR7Q6w0DUCkKtP7mbVZ+O/i57pKkZYWbL/wHtc5xHpyMeQrtHmRi1kiGg46TiyOHFqC3Uvtc2dM2mJCLCSYQSX1+zA6lkWTNpPgDgEOlqGpvEq4TppExTm/2AMxh9g== 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=z8mwBboVtork4Q3qQrAwufvK4WpXOxXXzce041pds8M=; b=KA+0rA57tuXfADAz83Z7UNvOF+hDdIZDXUaf+YJwJT/KaBfgd9F13G1QE6YQhYLCMitPmB+67KCiGMr4xAoacx+Fcm/STVIVdNENLmn/kojzgw48P6OETWBlShRotOTYmHLfp8/gX0eP2dAk26oZrWMBgb+rM+aO91pZrH+tvg3QAnHgNt0WMo5WKPnr+x2asmUk7oO7ecdhmNpbf1hFglm3jaVOvzsB02SUNFdDzI3bnLYcyMiVUZxihbvdCdgGi5ct2xgglSs9wtk1hlqIVjVmXmJBl3COanQAJL4REQ2USF3ll4hfM/ap29+R/MoCUcQBQ/UMM4e93l8Sczaphw== 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=z8mwBboVtork4Q3qQrAwufvK4WpXOxXXzce041pds8M=; b=zj20R7UrntAGK3aMgZbd/o7lKFt02OXNT9jIPmd83gmOZ2YmD3OV4bKhicGcjdAWd+fe9bzS+OC/NVMOOrHhAOCq7fS4qqqWDnslkB5+4wX97aGIYLgMwkpXTvtAV1BkzcbWn4JOiIemkjvYrgiCNUKIGokKDGzmcVlp3JCRhkk= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) by DBAPR08MB5863.eurprd08.prod.outlook.com (2603:10a6:10:1a1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.18; Thu, 9 Nov 2023 11:26:29 +0000 Received: from AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::af15:c9d7:cd8c:6da2]) by AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::af15:c9d7:cd8c:6da2%7]) with mapi id 15.20.6954.029; Thu, 9 Nov 2023 11:26:29 +0000 Date: Thu, 9 Nov 2023 11:26:27 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: richard.earnshaw@arm.com, richard.sandiford@arm.com, kyrylo.tkachov@arm.com Subject: [2/4] aarch64: Fix tme intrinsic availability Message-ID: <74c28cf9-9a02-c17b-fc97-09ff9abe9096@e124511.cambridge.arm.com> References: <6dccdd32-6c7b-5962-24e4-8acc7910a76d@e124511.cambridge.arm.com> Content-Disposition: inline In-Reply-To: <6dccdd32-6c7b-5962-24e4-8acc7910a76d@e124511.cambridge.arm.com> X-ClientProxiedBy: LO4P123CA0502.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1ab::21) To AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6678:EE_|DBAPR08MB5863:EE_|AMS1EPF00000041:EE_|DU0PR08MB8138:EE_ X-MS-Office365-Filtering-Correlation-Id: 31daf099-a947-4cfc-4e54-08dbe116bea0 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: YwU8mef3oxol2HPLh3Zoy5cMKaL8hRMboT2ADytF3MHnZobRZfAuCSUM8R6oTrL5S0E6Bd0PJp41bxFogYYw6lfYJFaUK30yCqOlsYSrKWUrZyrMLqgy03QnATS4gB+BsVPdmP7bAE6t40DMWQBATqhrITzVsSEIoNHVSlyVUT4XveU7EPuTdyQBjW9hlaSJyRLI/FvtftvLWQTVBxWWR7KaKwNI19AU4byoINPuiC/Jj1O4/iANSENNe10ANsK5kIJzSysKMnKTd6ZktWhLMlWMthK4FFTKZW8cm8dJ5+BvEdmmFNdXVlrGpkJj/Myq81IHcgnV1cX/sNaQ3JKlZ2gik2QC6UXaULOdcf495k1+Fmh8U2EJ4hSzsee9X3rY5U/ESYWzukB2ZdokC0NtFe2ZFS776PWTERAl2Dp5HKP9OzX0UBqCWGT2g3gjRcEdbeJ9z8XbDSwAq4sGmaqHCzYRXXOhtLf+fqUbKJzm670UvxL+vmztCZ19pkUgu3S3sHnlVQNYN+LXpiU7DfQ6SO8elgUaBYwQmwlacRJNNg9xcWhOp55LF63HRcssK8kswVmE/o1bxZOA/s5rRf72hQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB6678.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(346002)(366004)(39850400004)(396003)(376002)(136003)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(2906002)(478600001)(6506007)(6486002)(83380400001)(6512007)(26005)(41300700001)(8936002)(66556008)(6916009)(316002)(4326008)(5660300002)(8676002)(66476007)(66946007)(86362001)(44832011)(31696002)(38100700002)(31686004)(84970400001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5863 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: AMS1EPF00000041.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: e337f405-ee81-435c-959f-08dbe116b7e7 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XgCTVNaDhM/SXxsMcsThoi8cmmRNQbFG7nXdV1xN9oJG5QL29CmhWDGUOCdcb2QRCrpxkWbOPJrxC/3EgnrjSFoBsAdK7bPfE6nL7DaDmVcK4T78sBcfIcoStJlPjNIkqehsFTqKFU+2o1SrPbD0OirUV42ZI8jqARAHmBdjOPDX3qBhzuOY+lZiiVSfa1v2a6GB5S+emdt9S7PZTldLHfgf5+fpW6cFwoAghRkT4wsOpFUoe1QcoH2Gl9bUAlizO72hw727ujm0nqsJSck6RMx6uFz7Jpbcut0KFKlASr9f4FKXOYVkhyixrAIjmVARA6zSnDXGH/tTLPm31pWVdZB89chdVhyk3tkhsfmCizVc/qqSMMmrdQWnmsqOBvxSARJjE6G/gm1dHqQYrk5q0fyXzi42X3DGbTrE3SPEAEjL5JqfAqAR6j+2JXNqkVZ3k/F8nNhRNTyzDaPXyzdnzaOcNhw6ztinq7zJgX/199OeK5fqJyll3I8x1HAdV2Ia4dI1LO0atPPRzclC8IbOuw1E2x1N7kie3hW2CsSNoNSVM16qRS0uh5uYsji1vBKP3lInRHY1hYqY3JpGxWdCVljcCRpoGwl94FB+PXbLyHTgv01HLRrUv3pTvVWqXb5eml2oqabTlbiDZo98CYIZFDx5zgej8hwpbIEqoXkcG+Nuf6mQjlO783LT8q/pyvgQntMVpwxrANcPb0pnxKpX/PwF4fN6UjNXoaMDMq2UErILUu2r9sDC2WE+DyvRaWGl29i53ZWMKt0HdykSh7FoUA== 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)(346002)(376002)(136003)(396003)(39860400002)(230922051799003)(451199024)(186009)(82310400011)(1800799009)(64100799003)(36840700001)(46966006)(40470700004)(2906002)(36860700001)(84970400001)(41300700001)(70586007)(316002)(478600001)(6916009)(8676002)(4326008)(8936002)(70206006)(47076005)(40480700001)(31686004)(5660300002)(86362001)(44832011)(31696002)(356005)(6486002)(336012)(83380400001)(81166007)(40460700003)(82740400003)(6506007)(26005)(6512007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2023 11:26:40.6139 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 31daf099-a947-4cfc-4e54-08dbe116bea0 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: AMS1EPF00000041.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8138 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, KAM_LOTSOFHASH, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782085562949050137 X-GMAIL-MSGID: 1782085562949050137 The availability of tme intrinsics was previously gated at both initialisation time (using global target options) and usage time (accounting for function-specific target options). This patch removes the check at initialisation time, and also moves the intrinsics out of the header file to allow for better error messages (matching the existing error messages for SVE intrinsics). gcc/ChangeLog: PR target/112108 * config/aarch64/aarch64-builtins.cc (aarch64_init_tme_builtins): (aarch64_general_init_builtins): Remove feature check. (aarch64_check_general_builtin_call): New. (aarch64_expand_builtin_tme): Check feature availability. * config/aarch64/aarch64-c.cc (aarch64_check_builtin_call): Add check for non-SVE builtins. * config/aarch64/aarch64-protos.h (aarch64_check_general_builtin_call): New prototype. * config/aarch64/arm_acle.h (__tstart, __tcommit, __tcancel) (__ttest): Remove. (_TMFAILURE_*): Define unconditionally. gcc/testsuite/ChangeLog: PR target/112108 * gcc.target/aarch64/acle/tme_guard-1.c: New test. * gcc.target/aarch64/acle/tme_guard-2.c: New test. * gcc.target/aarch64/acle/tme_guard-3.c: New test. * gcc.target/aarch64/acle/tme_guard-4.c: New test. diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc index 11a9ba2256f105d8cb9cdc4d6decb5b2be3d69af..ac0259a892e16adb5b241032ac3df1e7ab5370ef 100644 --- a/gcc/config/aarch64/aarch64-builtins.cc +++ b/gcc/config/aarch64/aarch64-builtins.cc @@ -1765,19 +1765,19 @@ aarch64_init_tme_builtins (void) = build_function_type_list (void_type_node, uint64_type_node, NULL); aarch64_builtin_decls[AARCH64_TME_BUILTIN_TSTART] - = aarch64_general_add_builtin ("__builtin_aarch64_tstart", + = aarch64_general_add_builtin ("__tstart", ftype_uint64_void, AARCH64_TME_BUILTIN_TSTART); aarch64_builtin_decls[AARCH64_TME_BUILTIN_TTEST] - = aarch64_general_add_builtin ("__builtin_aarch64_ttest", + = aarch64_general_add_builtin ("__ttest", ftype_uint64_void, AARCH64_TME_BUILTIN_TTEST); aarch64_builtin_decls[AARCH64_TME_BUILTIN_TCOMMIT] - = aarch64_general_add_builtin ("__builtin_aarch64_tcommit", + = aarch64_general_add_builtin ("__tcommit", ftype_void_void, AARCH64_TME_BUILTIN_TCOMMIT); aarch64_builtin_decls[AARCH64_TME_BUILTIN_TCANCEL] - = aarch64_general_add_builtin ("__builtin_aarch64_tcancel", + = aarch64_general_add_builtin ("__tcancel", ftype_void_uint64, AARCH64_TME_BUILTIN_TCANCEL); } @@ -2034,8 +2034,7 @@ aarch64_general_init_builtins (void) if (!TARGET_ILP32) aarch64_init_pauth_hint_builtins (); - if (TARGET_TME) - aarch64_init_tme_builtins (); + aarch64_init_tme_builtins (); if (TARGET_MEMTAG) aarch64_init_memtag_builtins (); @@ -2137,6 +2136,24 @@ aarch64_check_required_extensions (location_t location, tree fndecl, gcc_unreachable (); } +bool aarch64_check_general_builtin_call (location_t location, + unsigned int fcode) +{ + tree fndecl = aarch64_builtin_decls[fcode]; + switch (fcode) + { + case AARCH64_TME_BUILTIN_TSTART: + case AARCH64_TME_BUILTIN_TCOMMIT: + case AARCH64_TME_BUILTIN_TTEST: + case AARCH64_TME_BUILTIN_TCANCEL: + return aarch64_check_required_extensions (location, fndecl, + AARCH64_FL_TME, false); + + default: + break; + } + return true; +} typedef enum { @@ -2559,6 +2576,11 @@ aarch64_expand_fcmla_builtin (tree exp, rtx target, int fcode) static rtx aarch64_expand_builtin_tme (int fcode, tree exp, rtx target) { + tree fndecl = aarch64_builtin_decls[fcode]; + if (!aarch64_check_required_extensions (EXPR_LOCATION (exp), fndecl, + AARCH64_FL_TME, false)) + return target; + switch (fcode) { case AARCH64_TME_BUILTIN_TSTART: diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc index ab8844f6049dc95b97648b651bfcd3a4ccd3ca0b..6b6bd77e9e66cd2d9a211387e07d3e20d935fb1a 100644 --- a/gcc/config/aarch64/aarch64-c.cc +++ b/gcc/config/aarch64/aarch64-c.cc @@ -339,7 +339,7 @@ aarch64_check_builtin_call (location_t loc, vec arg_loc, switch (code & AARCH64_BUILTIN_CLASS) { case AARCH64_BUILTIN_GENERAL: - return true; + return aarch64_check_general_builtin_call (loc, subcode); case AARCH64_BUILTIN_SVE: return aarch64_sve::check_builtin_call (loc, arg_loc, subcode, diff --git a/gcc/config/aarch64/aarch64-protos.h b/gcc/config/aarch64/aarch64-protos.h index 30726140a6945dcb86b787f8f47952810d99379f..94022f77d7e7bab2533d78965bec241b4070c729 100644 --- a/gcc/config/aarch64/aarch64-protos.h +++ b/gcc/config/aarch64/aarch64-protos.h @@ -991,6 +991,8 @@ void handle_arm_neon_h (void); bool aarch64_check_required_extensions (location_t, tree, aarch64_feature_flags, bool = true); +bool aarch64_check_general_builtin_call (location_t, unsigned int); + namespace aarch64_sve { void init_builtins (); void handle_arm_sve_h (); diff --git a/gcc/config/aarch64/arm_acle.h b/gcc/config/aarch64/arm_acle.h index 7599a32301dadf80760d3cb40a8685d2e6a476fb..f4e35d1e12ac9bbcc4f1b75d8e5baad62f8634a0 100644 --- a/gcc/config/aarch64/arm_acle.h +++ b/gcc/config/aarch64/arm_acle.h @@ -222,10 +222,7 @@ __crc32d (uint32_t __a, uint64_t __b) #pragma GCC pop_options -#ifdef __ARM_FEATURE_TME -#pragma GCC push_options -#pragma GCC target ("+nothing+tme") - +/* Constants for TME failure reason. */ #define _TMFAILURE_REASON 0x00007fffu #define _TMFAILURE_RTRY 0x00008000u #define _TMFAILURE_CNCL 0x00010000u @@ -238,37 +235,6 @@ __crc32d (uint32_t __a, uint64_t __b) #define _TMFAILURE_INT 0x00800000u #define _TMFAILURE_TRIVIAL 0x01000000u -__extension__ extern __inline uint64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__tstart (void) -{ - return __builtin_aarch64_tstart (); -} - -__extension__ extern __inline void -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__tcommit (void) -{ - __builtin_aarch64_tcommit (); -} - -__extension__ extern __inline void -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__tcancel (const uint64_t __reason) -{ - __builtin_aarch64_tcancel (__reason); -} - -__extension__ extern __inline uint64_t -__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) -__ttest (void) -{ - return __builtin_aarch64_ttest (); -} - -#pragma GCC pop_options -#endif - #ifdef __ARM_FEATURE_LS64 typedef __arm_data512_t data512_t; #endif diff --git a/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-1.c b/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-1.c new file mode 100644 index 0000000000000000000000000000000000000000..9894d3341f6bc352c22ad95d4d1e000207ca8d00 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-1.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=armv8-a" } */ + +#include + +void foo (void) +{ + __tcommit (); /* { dg-error {ACLE function '__tcommit' requires ISA extension 'tme'} } */ +} diff --git a/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-2.c b/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-2.c new file mode 100644 index 0000000000000000000000000000000000000000..4e3d69712b14a8123f45a2ead02b5048883614d9 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-2.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=armv8-a" } */ + +#include + +#pragma GCC target("arch=armv8-a+tme") +void foo (void) +{ + __tcommit (); +} diff --git a/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-3.c b/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-3.c new file mode 100644 index 0000000000000000000000000000000000000000..5f480ebb8209fdaeb4baa77dbdf5467d16936644 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-3.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=armv8-a+tme -mgeneral-regs-only" } */ + +#include + +void foo (void) +{ + __tcommit (); +} diff --git a/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-4.c b/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-4.c new file mode 100644 index 0000000000000000000000000000000000000000..bf4d368370c614ffe33035d9ec4f86988f3f1c30 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/acle/tme_guard-4.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=armv8-a+tme" } */ + +#include + +#pragma GCC target("arch=armv8-a") +void foo (void) +{ + __tcommit (); /* { dg-error {ACLE function '__tcommit' requires ISA extension 'tme'} } */ +}