From patchwork Thu Nov 9 11:26:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 163351 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp366144vqs; Thu, 9 Nov 2023 03:27:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjnM6bVYE7xNxoKLBss49McXaC5NaVgY1+RQLfDfSvabZDZTcCWkurwUEgxuqC7Lq4SVO5 X-Received: by 2002:a05:620a:244b:b0:778:8ebc:129f with SMTP id h11-20020a05620a244b00b007788ebc129fmr12163551qkn.8.1699529265363; Thu, 09 Nov 2023 03:27:45 -0800 (PST) ARC-Seal: i=4; a=rsa-sha256; t=1699529265; cv=pass; d=google.com; s=arc-20160816; b=E1l8BLqMh91YHc2qMfWJBx8vkGqgKy8fTTu0tq9V000RD821fWy3o+o/ZtE42J2OLW qnmS8hiYiU0ZYGV1dP7SQnbWgto0CXQiEI333F9LkxDMWQfy0gczQx+QbJsnM0EKwMWo 25jiU5UMDGllP8F5Fm08IHPsk7lj+cFOZiXhmvHG+XVY2kFUiTNT5QkKolKGp4B//MAt 6yl5D9Vekjg+crL1I4rQgi5rUv7soniVk9Vtbn3HoRhxet1LyP7QVf2LF0qvKZg/2QfU ZDqKUu7w2P5gVNSu8jR7tEB9/4irvlxBXK/hy6bSikgmYbdUM5pgryUdvs6pBr0NTTPF 6OQA== 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=jp3MHkEwb0nkTsS9eYmi4gvNOBcJSH/SoK8Ltbu5QEw=; fh=/GJKMeN7l+vB6+nVvLDPpFJynZqxxTy6OVbQu2XANxg=; b=ytQq3c1iz8ciGg/21/kDwODburetsC4cpU/Q36zIIj3p/z5i926IeCozo1teGnFp2F sfnrTDoPMTqkXPy8mrjOXIOChKBMVuPp0Z9Q7QKi9VkRe4Rbq5tu+GM9urBO990kNraC 0Ao+2UrJ+Luw13GRv3ZYEnbYgG8uozO3iAWiwcldE3yNbSBThhywh30S60EdxiXQjuEH Nb4KlmQGYTavqfew8CaSLFSv/Vf/cD1O0+VuQ97DHGeozMl0KZdiB/Pjjt50IANtEmJ7 9+mpAbbPU/9yDVGj+OyxCYIpZ+n1i7GkCVJgMeLg96rqJzzTh6ijpCWEeEmFgn7etl/y f8ag== ARC-Authentication-Results: i=4; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=jX3NS8gG; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=jX3NS8gG; 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 f11-20020a05622a104b00b00403bf9d2091si2632556qte.363.2023.11.09.03.27.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 03:27:45 -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=jX3NS8gG; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=jX3NS8gG; 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 23968385C6C4 for ; Thu, 9 Nov 2023 11:27:45 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2080.outbound.protection.outlook.com [40.107.22.80]) by sourceware.org (Postfix) with ESMTPS id CC2873857728 for ; Thu, 9 Nov 2023 11:27:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CC2873857728 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 CC2873857728 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.22.80 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699529240; cv=pass; b=x4Sg46C4ch9DeoIQYMP3eGP3AFfy2M6vURne07YMbP23I/L9MVKxgxRleIyUgHhOTKWAeXVfTiFoD714U4qMloomiU7hmgSCf/LuxhZmFCYiEw9gHeUaucpm6Ulw68zcTZddwQKcqHibdUQkttXoiWv2m1ev4XSUX2tio3tHqM8= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1699529240; c=relaxed/simple; bh=oxQdhAHBeM4aJGrqSoIHi22Eob1MeAAFvWZaxh13VLc=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=NcZiEhO+GaFPFC7GpYtiR0/+YFwb0tqxm3aKE7KMHr1Uvu2lRZMZ+ey0Tv2OboYuvCp4S8vHrPTVOGdS1wPTwS0MQo9DsimPQ2s9z7R//BY79dG4U6B7TPrIOTPjJgL8Whxw72/4DSSmF0PuLgz1zC8Aki89IcwFnoi+EbP4tNQ= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=JQ65Oqda25IbVATksm2X1RGJnoZEletywBiuleSfEvelrUqFdKZLvO+7T0B8DsiExsArpqmKKpuBhVwEp2DEZN42mTTSS9+C7rQyHKeIct0T3uPdPFQ+PB53k6FWDK36ayionZtiWzIPnQWbtnSCs1+/7Z040wKOTahHyYr1etx93NxZ38P3TGxds0Mb5oKk6/57GwdrCLS2QrNiIvSCV9ve1pZLQ9UckcbjeN5FYdue1aZbAb1kXfBm66P80K1/9rUmvZUl2g7ZZ0oSzknZjh8yvKgvIsx8C2imrkahzyPX6CrOXupiJ9+IaQHSROiB/OcUMmpALqGBOBScAYqjYg== 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=jp3MHkEwb0nkTsS9eYmi4gvNOBcJSH/SoK8Ltbu5QEw=; b=NJSY9mFkhAQK2xkhcNl+ktgdRi6sNX5B3eDFt+PSE1F+H2V1RiRSYeoVFL3k3lbiW+WUYPkoGqccoofsgzRpur+X07y49bMI82871963QlQlYGExm8+4TTpesmO4wYPj22io0oYMjfs8x1s7r/nykXUWR2mUK0yQIR8952FOsyuzdrUp/PrwkuskkaA+yfrWKJoE+7n+4c4+mhvymv+LxWvztqyFZZvPGLHHYvaaVqa9W64lQ2LPFcQapO0AwDrHHVLMzeGZ7rfDHBLkX968R087otjBhFHYncwPTztB+2VX/gXSmTckWnjmhnOhuG6TswupUIEWSo+232WoFQ9w6Q== 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=jp3MHkEwb0nkTsS9eYmi4gvNOBcJSH/SoK8Ltbu5QEw=; b=jX3NS8gGZsptoGnUYpeKSQWSb8DW0rtJVESSI3q23pPjXmr1D5GqiGoqPm7yrDhhXgIfNK6BtaWFiOWAqWYl2YQUy6Z/lXfS4fOCxmpzJc1scNDlFRbqR/6B7KRhKuGihveye3jSYtDZzxwLF9Y0E+E+34knp9sAvL+DnLvL4fk= Received: from AS9PR06CA0737.eurprd06.prod.outlook.com (2603:10a6:20b:487::13) by AM9PR08MB6241.eurprd08.prod.outlook.com (2603:10a6:20b:281::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.29; Thu, 9 Nov 2023 11:27:12 +0000 Received: from AM3PEPF00009B9D.eurprd04.prod.outlook.com (2603:10a6:20b:487:cafe::cb) by AS9PR06CA0737.outlook.office365.com (2603:10a6:20b:487::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.18 via Frontend Transport; Thu, 9 Nov 2023 11:27:12 +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 AM3PEPF00009B9D.mail.protection.outlook.com (10.167.16.22) 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:27:12 +0000 Received: ("Tessian outbound 7671e7ddc218:v228"); Thu, 09 Nov 2023 11:27:12 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 21a0e3fe60dbe260 X-CR-MTA-TID: 64aa7808 Received: from a40c340d84f0.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B88FFADB-331E-46D9-9B54-921FD30D5A44.1; Thu, 09 Nov 2023 11:27:01 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a40c340d84f0.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Nov 2023 11:27:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Iu+9MQcusgrUHW9smt0311MmavC9QUaWPYM7PqhvOXOH7R0MqLotCtmDlf23QbFs/ZhXOvQtPUEMaMEzpd+zurh9PMhv2cG6DkBetHYEVcf7EOEAWaGok8Q6ztSPGYAJ/yQRooAPlE+FaVmGQVnFz3NmChMnR5db7jHqK4PmskDX1q2P2rvC43LrGJmOqk3XUS41w2As4ir2GctdDcg7xhLDajHdNmykXsl+xhWffn2ugRJAyFbuOuT1cO5fm/bhKwrilniG2Ly+2kNkg/m0i1YFMFXJoSd0TY54sjeK85/kHxjeCxUqFM82cV9T6UfFIlaaOJu8eUTmIawiG3YzFA== 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=jp3MHkEwb0nkTsS9eYmi4gvNOBcJSH/SoK8Ltbu5QEw=; b=bCLzVrCcWNqjn3vSYVFefWGpyUX/tlj0P/KFo37Edq1Up02s6+pVXsIKs+nb/LVXzJaJQ0GmV/CGB5kMW8pVMZNDWfwwotsD2qashR6UhxlWyeYmPIHN/mo8MRIqzfzBLXWc6y732m8bJ5mV1oKpC7qLX/MwgGYNsGqb/+J9EOpsAb7odyKvdDhp4/FkXxqXNlH6/9ERdmlUFjvS7azKTgY0gX+kg2kODuBv9T4YNQzmP4inuRNP+0r/jf3E3yTWCedohHofnRMY3gPWEYVeKqK7qjM49EAcke4cxUlxZcAy1kplLF9NXKuB8tNa4+MdS+gXf0kZ8eRI0aNKaaVUDw== 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=jp3MHkEwb0nkTsS9eYmi4gvNOBcJSH/SoK8Ltbu5QEw=; b=jX3NS8gGZsptoGnUYpeKSQWSb8DW0rtJVESSI3q23pPjXmr1D5GqiGoqPm7yrDhhXgIfNK6BtaWFiOWAqWYl2YQUy6Z/lXfS4fOCxmpzJc1scNDlFRbqR/6B7KRhKuGihveye3jSYtDZzxwLF9Y0E+E+34knp9sAvL+DnLvL4fk= 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 AM7PR08MB5479.eurprd08.prod.outlook.com (2603:10a6:20b:104::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.29; Thu, 9 Nov 2023 11:26:58 +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:58 +0000 Date: Thu, 9 Nov 2023 11:26:55 +0000 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: richard.earnshaw@arm.com, richard.sandiford@arm.com, kyrylo.tkachov@arm.com Subject: [3/4] aarch64: Fix memtag intrinsic availability Message-ID: <9e6ff577-22b0-a3fe-6dc0-384d8b426ef0@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: LO4P265CA0048.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ac::8) To AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6678:EE_|AM7PR08MB5479:EE_|AM3PEPF00009B9D:EE_|AM9PR08MB6241:EE_ X-MS-Office365-Filtering-Correlation-Id: 0d6a2400-03bb-42e0-8aaa-08dbe116d1a2 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: Gt3lFAEMxbiH05vdv7zvYVth3RANhPeBWo6JG2e6XaDVpbBbZXWqD8683Q9KCsaCvRFPyw6+cUNET7/Qte4vd6oUh5rqX93QhUxwv40fMH78hX9zoGNBwW7zAGL2FnVHSeDi7A4FbABQSPShdAs4Cz/w/JEj6f1a6bgjgwcIUVU1OyCxaYkihXkr0swVxOvtFH3SXOWnxn4GY1+Y6JIIQ+B42LGP6c6SRzG4BBAN+7OlLcdaKYr3pDKMtF7Evr5B0fveZQzV6n2XN94xREXNbWt113/nQxovwfz5KigeoXF1UQoUpFKJDrlxy4US0Tjd5hXg1CqDMs1wH00XSDuZlZTlSyXdHZo/JsiYmJuSGjR7ahANpMHkDz1Ec8Qk2NokDEFRHQVHEvVOdvJn4IsST7ZOrJyoviiG3BYJW1OHnrlwi8ahMl1rakMmhCMZtmn0O2EH1hNsFPpHjsKlblGYM4sU2VK4VMaaFe2LGAyMNVJsN/aR7Dr+VFTxcZaf/ag6a6PPYCy2KxXNkaQtskyh00cklMV5s6xTX63C0K4BSWi3iIAWhZPX1vDqpBWF4wNtMYUl+UOUqbVZDDRWsRQ/Kw== 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)(366004)(39850400004)(396003)(136003)(376002)(346002)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(84970400001)(31686004)(6486002)(31696002)(86362001)(38100700002)(66556008)(6666004)(6506007)(41300700001)(26005)(6512007)(66476007)(66946007)(6916009)(478600001)(4326008)(5660300002)(44832011)(2906002)(8936002)(316002)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5479 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: AM3PEPF00009B9D.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: a64a0efe-2122-49af-41d6-08dbe116c8fc X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4X9wji/f0OpSNHL5r1efJKOV7qK3FRaQWwdKWbpcY+4IErKXTVrK2AwajflvaxLOug7G+x6AoC+UlN7TJ4DZDXAVA/UxvB955vzTVSBz0GDCeHtVu293Jeh/o3u5Gm2wWGnzvTXwM5zA2V//EgZDiaBjjhE/Ifd2Qv4Tmm2cIjJqKc6fRT2wJ8/rwSZXbM9LpK8577bB8bi4C10p0a9NvoolA/JslKV651lDCNrX9WzSfzws4mUsEAG2DAWMVKjQnR9fz3VyfBiCnqQ6L6nDUzVy1LIWkVFiUGfgDWlOQDTBe9YUGLq3d+8Al6ytgslc6aRtsOoj5XI5VZnzGd/XnOVzWqXdVeKUAcQlwlXZB3huqSCE0PfNEdltitAaWquwJtTPTZsWNA9VybQeTEHr4tdHr23ZJfUXAis75pyT/5v8qS5YAQepZ2jlKCD6up9IASdPfijMpGT7jVMhdGqV+1T1GICGPL1mdUAPMOBvCWyVZwfV9PoeZz1AtNE32OVmJkcRu1FsuQFh2pk8/hZqhzjxlE7z+F2t8YCGk1mfkHtsKU+EwFojQ+nAbv7Yfc/Cu19o2sxxvjLkdOI9UJ0nfL57ylbwJFRENQPM4b8kf9dZTQw6O12Vbfbl0zsr9FHSL3lot0PCuPB4ahog+Cf8fmW+gL+sNnGKVdOycCatOYmCxaUl4tlZ+O0fH/7OZBLLK8nH7vH3gLzg+SObROqiEy4gjmksw4JezgXviQ51kqDCtkVZ419pxjpkm2McVipBgDTPdhPqB3EuGmKJT/1Caw== 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)(396003)(376002)(39860400002)(136003)(346002)(230922051799003)(1800799009)(64100799003)(186009)(451199024)(82310400011)(40470700004)(46966006)(36840700001)(31686004)(478600001)(36860700001)(6486002)(6512007)(70206006)(40480700001)(70586007)(6916009)(26005)(316002)(82740400003)(6506007)(6666004)(356005)(47076005)(336012)(84970400001)(81166007)(8936002)(31696002)(8676002)(4326008)(44832011)(40460700003)(41300700001)(2906002)(86362001)(5660300002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2023 11:27:12.5052 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d6a2400-03bb-42e0-8aaa-08dbe116d1a2 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: AM3PEPF00009B9D.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB6241 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: 1782085599019157495 X-GMAIL-MSGID: 1782085599019157495 The availability of memtag intrinsics and data types were determined solely by the globally specified architecture features, which did not reflect any changes specified in target pragmas or attributes. This patch removes the initialisation-time guards for the intrinsics, and replaces them with checks at use time. It also removes the macro indirection from the header file - this simplifies the header, and allows the missing extension error reporting to find the user-facing intrinsic names. gcc/ChangeLog: PR target/112108 * config/aarch64/aarch64-builtins.cc (aarch64_init_memtag_builtins): Replace internal builtin names with intrinsic names. (aarch64_general_init_builtins): Remove feature check. (aarch64_check_general_builtin_call): Check memtag intrinsics. (aarch64_expand_builtin_memtag): Add feature check. * config/aarch64/arm_acle.h (__arm_mte_create_random_tag) (__arm_mte_exclude_tag, __arm_mte_ptrdiff) (__arm_mte_increment_tag, __arm_mte_set_tag, __arm_mte_get_tag): Remove. gcc/testsuite/ChangeLog: PR target/112108 * gcc.target/aarch64/acle/memtag_guard-1.c: New test. * gcc.target/aarch64/acle/memtag_guard-2.c: New test. * gcc.target/aarch64/acle/memtag_guard-3.c: New test. * gcc.target/aarch64/acle/memtag_guard-4.c: New test. diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc index ac0259a892e16adb5b241032ac3df1e7ab5370ef..503d8ad98d7de959d8c7c78cef575d29e2132f78 100644 --- a/gcc/config/aarch64/aarch64-builtins.cc +++ b/gcc/config/aarch64/aarch64-builtins.cc @@ -1813,7 +1813,7 @@ aarch64_init_memtag_builtins (void) #define AARCH64_INIT_MEMTAG_BUILTINS_DECL(F, N, I, T) \ aarch64_builtin_decls[AARCH64_MEMTAG_BUILTIN_##F] \ - = aarch64_general_add_builtin ("__builtin_aarch64_memtag_"#N, \ + = aarch64_general_add_builtin ("__arm_mte_"#N, \ T, AARCH64_MEMTAG_BUILTIN_##F); \ aarch64_memtag_builtin_data[AARCH64_MEMTAG_BUILTIN_##F - \ AARCH64_MEMTAG_BUILTIN_START - 1] = \ @@ -1821,19 +1821,19 @@ aarch64_init_memtag_builtins (void) fntype = build_function_type_list (ptr_type_node, ptr_type_node, uint64_type_node, NULL); - AARCH64_INIT_MEMTAG_BUILTINS_DECL (IRG, irg, irg, fntype); + AARCH64_INIT_MEMTAG_BUILTINS_DECL (IRG, create_random_tag, irg, fntype); fntype = build_function_type_list (uint64_type_node, ptr_type_node, uint64_type_node, NULL); - AARCH64_INIT_MEMTAG_BUILTINS_DECL (GMI, gmi, gmi, fntype); + AARCH64_INIT_MEMTAG_BUILTINS_DECL (GMI, exclude_tag, gmi, fntype); fntype = build_function_type_list (ptrdiff_type_node, ptr_type_node, ptr_type_node, NULL); - AARCH64_INIT_MEMTAG_BUILTINS_DECL (SUBP, subp, subp, fntype); + AARCH64_INIT_MEMTAG_BUILTINS_DECL (SUBP, ptrdiff, subp, fntype); fntype = build_function_type_list (ptr_type_node, ptr_type_node, unsigned_type_node, NULL); - AARCH64_INIT_MEMTAG_BUILTINS_DECL (INC_TAG, inc_tag, addg, fntype); + AARCH64_INIT_MEMTAG_BUILTINS_DECL (INC_TAG, increment_tag, addg, fntype); fntype = build_function_type_list (void_type_node, ptr_type_node, NULL); AARCH64_INIT_MEMTAG_BUILTINS_DECL (SET_TAG, set_tag, stg, fntype); @@ -2036,8 +2036,7 @@ aarch64_general_init_builtins (void) aarch64_init_tme_builtins (); - if (TARGET_MEMTAG) - aarch64_init_memtag_builtins (); + aarch64_init_memtag_builtins (); if (in_lto_p) handle_arm_acle_h (); @@ -2152,6 +2151,12 @@ bool aarch64_check_general_builtin_call (location_t location, default: break; } + + if (fcode >= AARCH64_MEMTAG_BUILTIN_START + && fcode <= AARCH64_MEMTAG_BUILTIN_END) + return aarch64_check_required_extensions (location, fndecl, + AARCH64_FL_MEMTAG, false); + return true; } @@ -2716,6 +2721,11 @@ aarch64_expand_builtin_memtag (int fcode, tree exp, rtx target) return const0_rtx; } + tree fndecl = aarch64_builtin_decls[fcode]; + if (!aarch64_check_required_extensions (EXPR_LOCATION (exp), fndecl, + AARCH64_FL_MEMTAG, false)) + return target; + rtx pat = NULL; enum insn_code icode = aarch64_memtag_builtin_data[fcode - AARCH64_MEMTAG_BUILTIN_START - 1].icode; diff --git a/gcc/config/aarch64/arm_acle.h b/gcc/config/aarch64/arm_acle.h index f4e35d1e12ac9bbcc4f1b75d8e5baad62f8634a0..57f16603d22cec81002b00b94afe1201c83b4b94 100644 --- a/gcc/config/aarch64/arm_acle.h +++ b/gcc/config/aarch64/arm_acle.h @@ -257,29 +257,6 @@ __rndrrs (uint64_t *__res) #pragma GCC pop_options -#pragma GCC push_options -#pragma GCC target ("+nothing+memtag") - -#define __arm_mte_create_random_tag(__ptr, __u64_mask) \ - __builtin_aarch64_memtag_irg(__ptr, __u64_mask) - -#define __arm_mte_exclude_tag(__ptr, __u64_excluded) \ - __builtin_aarch64_memtag_gmi(__ptr, __u64_excluded) - -#define __arm_mte_ptrdiff(__ptr_a, __ptr_b) \ - __builtin_aarch64_memtag_subp(__ptr_a, __ptr_b) - -#define __arm_mte_increment_tag(__ptr, __u_offset) \ - __builtin_aarch64_memtag_inc_tag(__ptr, __u_offset) - -#define __arm_mte_set_tag(__tagged_address) \ - __builtin_aarch64_memtag_set_tag(__tagged_address) - -#define __arm_mte_get_tag(__address) \ - __builtin_aarch64_memtag_get_tag(__address) - -#pragma GCC pop_options - #ifdef __cplusplus } #endif diff --git a/gcc/testsuite/gcc.target/aarch64/acle/memtag_guard-1.c b/gcc/testsuite/gcc.target/aarch64/acle/memtag_guard-1.c new file mode 100644 index 0000000000000000000000000000000000000000..4a34c37f44fae590d2a3f947dd1bf404fe8261fa --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/acle/memtag_guard-1.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=armv8.5-a" } */ + +#include + +void foo (int * p) +{ + __arm_mte_set_tag (p); /* { dg-error {ACLE function '__arm_mte_set_tag' requires ISA extension 'memtag'} } */ +} diff --git a/gcc/testsuite/gcc.target/aarch64/acle/memtag_guard-2.c b/gcc/testsuite/gcc.target/aarch64/acle/memtag_guard-2.c new file mode 100644 index 0000000000000000000000000000000000000000..bf06b284dadd2082496cfc0a345f7cf5a783bd3b --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/acle/memtag_guard-2.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=armv8.5-a" } */ + +#include + +#pragma GCC target("arch=armv8.5-a+memtag") +void foo (int * p) +{ + __arm_mte_set_tag (p); +} diff --git a/gcc/testsuite/gcc.target/aarch64/acle/memtag_guard-3.c b/gcc/testsuite/gcc.target/aarch64/acle/memtag_guard-3.c new file mode 100644 index 0000000000000000000000000000000000000000..1f4ffa454a763e6b35bd84af6ef6c7d6474a518b --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/acle/memtag_guard-3.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=armv8.5-a+memtag -mgeneral-regs-only" } */ + +#include + +void foo (int * p) +{ + __arm_mte_set_tag (p); +} diff --git a/gcc/testsuite/gcc.target/aarch64/acle/memtag_guard-4.c b/gcc/testsuite/gcc.target/aarch64/acle/memtag_guard-4.c new file mode 100644 index 0000000000000000000000000000000000000000..a1cd45ec79d242dcf710abdc375c29063866eb5a --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/acle/memtag_guard-4.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ +/* { dg-additional-options "-march=armv8.5-a+memtag" } */ + +#include + +#pragma GCC target("arch=armv8.5-a") +void foo (int * p) +{ + __arm_mte_set_tag (p); /* { dg-error {ACLE function '__arm_mte_set_tag' requires ISA extension 'memtag'} } */ +}