From patchwork Tue Dec 5 15:09:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Do Nascimento X-Patchwork-Id: 174073 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3494931vqy; Tue, 5 Dec 2023 07:10:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2SxJ2n+9zSk/jLaw3x4+C5iYCs4RIFXruApxbrxSQO5wBCKex3H1m3He5cAYv7Rd0JOK2 X-Received: by 2002:a05:6122:993:b0:4b2:e534:b5d1 with SMTP id g19-20020a056122099300b004b2e534b5d1mr2430508vkd.33.1701789054775; Tue, 05 Dec 2023 07:10:54 -0800 (PST) ARC-Seal: i=4; a=rsa-sha256; t=1701789054; cv=pass; d=google.com; s=arc-20160816; b=0zq/E8ndPDa6Zn8NfI56udtiZx4n6BbFIvB0WBITSITsREtNQF4/+kM7jeYtEE0Po6 sxiNs92hWUX85oIJceKtYj5Id1O79nmQh18vMS8Z2SY6NobfuXYRSSvsFvuOnJXIx2iN 0gbC+MoY22dfLyWdjmWpzCOJcz14n464eiP3x/+p06HMpohG9xAKPahVZIXVrjMab6fy rp+436F9qGkoIpjuJDojwFwRXRMIDBWyclQtbYqOFyN6beUvA4/h3iJyAa9xjfeOEITA OOSvSoBrbUqZAAFHiXmc3WLO3lrvm5OPiNqgMzGqClx08qIN8h9UEjQwj5dH3Tf14xMl vTMA== 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:nodisclaimer :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature:dkim-signature:arc-filter:dmarc-filter :delivered-to; bh=EWunghWkNX0Uz8NJ9pm6UXbxPCT/qk3Sk2ZAyKAsemE=; fh=puYCM8FRHzins9HjEsl9lyIrPa8b21rR+m5ND3mNx7M=; b=Xac2ML+MJvhgh686XVuLOUNMneer58RumEq64EYcCz/ApT5i6rihlGPKsc/fBBaYMK X3qs5f2Xhgv7M5Oa0MKizLqRKwqkTZFlWqeJ8nffmGQIeMyxPltThw7MGPMABBp84Pf8 uDQ8GtZwZP+pDtvPxKaLG1KODmqB1C7Td0RUGMTNEbywej/mOX0zMO9i/mG2u/cWBRcN 894b/fKT/QDcnrZwLEA/bkz1xFAhOd5sc2Ff4gSOFGo4NxOyjgM4YnR7im63fautpqYC XH0RPZXgDUdQoJqzM8pzhqPShHY2jaUYRM8jLL664gg5p8KtpqKQ5+4WFqt7R+X5nZc7 r5xA== ARC-Authentication-Results: i=4; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=mB5VTewD; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=mB5VTewD; 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 k8-20020a05612212e800b004b27777bcb4si1130041vkp.33.2023.12.05.07.10.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 07:10:54 -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=mB5VTewD; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=mB5VTewD; 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 697ED3841919 for ; Tue, 5 Dec 2023 15:10:45 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2040.outbound.protection.outlook.com [40.107.20.40]) by sourceware.org (Postfix) with ESMTPS id 2E768385782F for ; Tue, 5 Dec 2023 15:10:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E768385782F 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 2E768385782F Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.20.40 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1701789015; cv=pass; b=AQs0EG4Eu56c3xpbSllgWA1HWK41obhQSr7PbwGA3Z2Lawfb8mbGVYhFdfZMsN4uyVqVxPsgPFJOTd0sa9s1NjYd32sFF8tE+CoMmtx65sAUWpGzYXCIAUv74KvVcZCniohzrVbnQ26m4Gtha1f+0qeIjSVqyaeDlSRpRHQpmIw= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1701789015; c=relaxed/simple; bh=/qN9PiQ03oW6rr/1dE+pfuRQRqSbRXvNyEL4u2lmH/U=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=YPHwfUAhi8SKVvwaAwMTDMfmM0Od0f4HIsgEd8z5ei5FaCJ3zL8JrH0IXOEGf+5u4ajE8Am53fiHYsrsHIcJHQi9eNLSaZ8Kmeje/U2z0gGF1/Kqrq8HHX4CGlALgVumTM8XtJIRM8OqA8QujYPM1bOk+axdbUVJKMvH5B7f/0A= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=IADcxd4Su5l5JuLaqR9RgSpP6Kow5AFDNtKYQ9G7d7RiR7L0mdj9vtYoUv9g4gaXCLYlq9ND57KZbDzo52hZ/9NovZENkV2Yot4nMYv3VIWTDRhs/S/zZ0r9vp5DxsjrwNP5kk5Go+lcJIXHKONfcw5ywkm9LkmGLqC5Z3z/jCr4n32tRyg1UVKde0PPgOALzU1VqpMjjxpxiaDg4+RhLq/3xVSfE60zyNsJa4q5u0ykTRsgYnRQsbRwTDon/BAeBH1PpwwKSJuY1daIZ/Q+HQe3uJS6/7Zg8AETEqhePnoBWzGyLV8PpqX7RCsWVkNXvShGoZCTHd9KfXtHhj/INQ== 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=EWunghWkNX0Uz8NJ9pm6UXbxPCT/qk3Sk2ZAyKAsemE=; b=B3PAVO+277JcV6+Av6RZsczgPQ71Yu1OSq6gev/MZqYtn13MdoZ2FDOLr4rStsGU5nXiQM08/69pPDz7ohZulihqD5VFsSGIXaVcgCeAIfq8sXlln+sHid0PLE95SdBVWzW7l6oSlNCK5awq42AmlVbGmDJ5nZ3mjYA4Dxpy1LHA9Bu2AU+d4a5CW83BoClkC/4Nnc+axyS1zDA3j7/qkyiJoZJ59/7Z+wgO1jOApD95Fh9LmrOiwJAjWA4nH9ud/vPj/FYivxh27lhJGhTH/X+iLaulnB1G/zmiHAsbGi1ayH7+N/rQvmY29YoO2E2qqAhfOjvxDGLmWbJBUvvqhw== 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] 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=EWunghWkNX0Uz8NJ9pm6UXbxPCT/qk3Sk2ZAyKAsemE=; b=mB5VTewD1JUDVmvjxLZttMbF18kl4cbAVdHLRGo1JrAms/xVtF1d8aSSlm4tqh4GxNnTs0sGGY6WjaeFF/Y1UdTDHthuHuSJRTGVkvvxdzdc5n+YxE1ScZuiytLoJcFOz5/TuZar1+oXd9er29GaCRw4zopGneQhABnEmQVGrLY= Received: from AM0PR04CA0001.eurprd04.prod.outlook.com (2603:10a6:208:122::14) by AS8PR08MB8062.eurprd08.prod.outlook.com (2603:10a6:20b:54b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34; Tue, 5 Dec 2023 15:10:00 +0000 Received: from AM4PEPF00025F96.EURPRD83.prod.outlook.com (2603:10a6:208:122:cafe::e4) by AM0PR04CA0001.outlook.office365.com (2603:10a6:208:122::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.33 via Frontend Transport; Tue, 5 Dec 2023 15:10:00 +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 AM4PEPF00025F96.mail.protection.outlook.com (10.167.16.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.2 via Frontend Transport; Tue, 5 Dec 2023 15:10:00 +0000 Received: ("Tessian outbound 26ee1d40577c:v228"); Tue, 05 Dec 2023 15:09:59 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f6942e34ad1de5d8 X-CR-MTA-TID: 64aa7808 Received: from 62fd82137113.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id ED5FBA03-74AC-49F8-B4BF-E6718B5CA9C3.1; Tue, 05 Dec 2023 15:09:52 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 62fd82137113.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 05 Dec 2023 15:09:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QbltsanNlZfPAPbAMCXx52Z6BP9ofQia3sRxk5SlUEOywwZ037Y0fJizPDHUrLPZ2fK2UHAq1sKQtFu1pSKAP6ILCdeJkHc2eoQvJs3akiCxohYM2CDBh29PzVJeA1kJGxk2ZaQiqx2i/i1rdykIB6bWMaXSzctR6SvEyZ2wuNnD2YYI94XY4ieMpxrot/q0c3F43L0f2ZssQ8A+e0jRV68gFhMl0ZeBRRsRA2Q7ZIBh6V+RpvPVexGX0j6bTL3tizBeg0TEmGkMZW4iNn7nT/Kc7iXLqgm08a8QbBn49c9XVayq/gejyQVlhGwq1gVkt2Mt/zxvTLBb+rErvKE3wA== 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=EWunghWkNX0Uz8NJ9pm6UXbxPCT/qk3Sk2ZAyKAsemE=; b=c5c173SqURfVU8VIve1rz1FU4Ymiyao2XbLVmW5n8at9AbtXj3az3vXZWbCBLdYX2tEp0A22BbNVHEb/rS0KXgTr6JGQTFFlBjQYnq4+OyVPC3Xtyf2zq/7uNOVp4iipCM9rX35Ja3OFodBZ3qu/oWAqJw2/Mo5eA6rcQkPkIf7niT6DUW2PsZ8U+8UFraaK2m4phYRwS0Xe3XcXKwtKyN7Uaggms16FmpwSBFj5XFacKwzNTPfDSPzA6xTc7vqFTO8AuupJU4s/YJ4V2Ed2QoImaENBvCjxHss7F/yvTma5Y4KSm4vYcn80OudTyIpbocAELw2UULXTJ9XZU03C2A== 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 (0) 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=EWunghWkNX0Uz8NJ9pm6UXbxPCT/qk3Sk2ZAyKAsemE=; b=mB5VTewD1JUDVmvjxLZttMbF18kl4cbAVdHLRGo1JrAms/xVtF1d8aSSlm4tqh4GxNnTs0sGGY6WjaeFF/Y1UdTDHthuHuSJRTGVkvvxdzdc5n+YxE1ScZuiytLoJcFOz5/TuZar1+oXd9er29GaCRw4zopGneQhABnEmQVGrLY= Received: from AM6P191CA0008.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8b::21) by GV2PR08MB7955.eurprd08.prod.outlook.com (2603:10a6:150:7f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.34; Tue, 5 Dec 2023 15:09:48 +0000 Received: from AMS0EPF0000019C.eurprd05.prod.outlook.com (2603:10a6:209:8b:cafe::c2) by AM6P191CA0008.outlook.office365.com (2603:10a6:209:8b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.32 via Frontend Transport; Tue, 5 Dec 2023 15:09:48 +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 AMS0EPF0000019C.mail.protection.outlook.com (10.167.16.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7068.20 via Frontend Transport; Tue, 5 Dec 2023 15:09:47 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Tue, 5 Dec 2023 15:09:46 +0000 Received: from e125768.cambridge.arm.com (10.2.78.50) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.32 via Frontend Transport; Tue, 5 Dec 2023 15:09:46 +0000 From: Victor Do Nascimento To: CC: , , , Victor Do Nascimento Subject: [PATCH v3] aarch64: Implement the ACLE instruction/data prefetch functions. Date: Tue, 5 Dec 2023 15:09:41 +0000 Message-ID: <20231205150946.3542939-1-victor.donascimento@arm.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AMS0EPF0000019C:EE_|GV2PR08MB7955:EE_|AM4PEPF00025F96:EE_|AS8PR08MB8062:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f87c0a1-da88-420d-f607-08dbf5a44010 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: +K1o6JiL1uJm9O+XqGsHxopO9Vw5MRvJmpNzEdXpjLg8Hs+QUADAA2Sb2WHmq5YRZ2T016/5y69jK5Gks4ta5jSAA2Ze/DPRS93+r940P2cRQHGRaJGoN215q79r4H/sw49oFKtKDDH7HskA2Xxs7rLrG7GDAK65R/I3aqY4r3Ja8fu3guYJfNvX9X9NqAK6yuZAh4LzbRisEtiTJJGO2FpyvbPpGYOEcZPPcO/SMHUsHvakSzPQYdVD8NXEhM1L0v2aYdDKC7oc7nkD3QPUKiRyZjnGL/0vMLg/fbTs18QTOb4wqXxYMcViH/fL7M/zlW0jzlYzVnBouNB94r2bH6KrwSCduPiHxvP8Ce5/nGRBwvpAwbvmn+3wxCDeLyGffZJgs6AlHZp+bb9VgVXnlDgHxOGyolhazFpVz7PD8tMkJaigBZM5WMKMg2P1z7O9Ihq2N8lWV+aAuO0zmKuMX0VkYoIG6NJTwddY+J9PMK/r0waoenD1xU32DMnqQUHUw3OU1aJtFW7nhgsJl2mOtzZ7J6vqvM4BWr+BTINlMUdX36F9/MQvvp5cFUIo1n3G/LLvnpQwbaC0dhpVXEDgl6nTZ2esSYrUYelfkH8rvZ0fE7IPinWKRWuuOpC9cpZ5j7gZjEDrtQHgkvgYZgeRc9Ndp0EMkqq+JKplywSOtHN+64/4+0Tg3CsvfbLXW+djpkvzSvNpcy3Q8vkrPppW7W+TzkrWUuAuFRa4buS5IOQ511icZpZ2Otuo/GEtEbDw8j8cAXFGQNsEPOWv5U5jVjRY8xqJ0Ywj/2x21wcoHEZSd3qwbVRsgE3b6vyPHJneNPLtrUA/s4OqRPgb/oUH/A== 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:(13230031)(4636009)(39860400002)(136003)(376002)(396003)(346002)(230173577357003)(230273577357003)(230922051799003)(186009)(64100799003)(82310400011)(1800799012)(451199024)(36840700001)(46966006)(40470700004)(30864003)(40480700001)(36860700001)(84970400001)(2906002)(316002)(6916009)(54906003)(86362001)(70206006)(8676002)(70586007)(41300700001)(36756003)(4326008)(8936002)(356005)(47076005)(5660300002)(82740400003)(81166007)(966005)(83380400001)(478600001)(40460700003)(426003)(26005)(1076003)(336012)(7696005)(6666004)(2616005)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB7955 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00025F96.EURPRD83.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 398afb12-ea16-40c2-efda-08dbf5a438c2 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w8ZdB8aIhBd9pAAtXFf8eEsbvav2HjpSqEDI3iYpM8j1UJIjAC8lu8wvxl0yGmqSBqdooYHNG6o1MXY0LBhSj8cgjA7KcyIadVxRwP1N3PecZPo4g5Du1IIDhwG/LEeA6o6b5tvmpISYl4Mt33AFUO40LHYt4ObAeTvOyexd9eHr7YNPby5ff2/CRf/9plrezLPXvsSrzFhsZX0oLR8DjTkNfJxJZNYv50NEaKuOada7jvEk1jZovsJJB2poorWN7wybAiOs0C6GCLRGLOprj+OtdNh/IpewyOnZXqKv3Bytrb3zqHTWouvxXlXpxi4cgsEeH+VVmgXEoLvN8fP1C7fgxc7/phrZJuNo6tz/0ysu/K7NfPsfWw3hquwc80VTlOWR85QI6tFIReyNV5XT1OIvHeHPExGfhJIjsfIxbO6bmljRl2Si9MvEdYvArGR9wvI07Di04jqx4ylwCWxTuCL0O8xn8yoal92/rx82XfELNlx1/UzjrNvjVSY7VcAmNSlvAPLluFM6ahbGEJ6YJ1/GwcZev8nw2bA7Ig0o9WHZZk1bhBE34m4Yf5/PEfCXyyXBz9AnDzPd9NFCM7Z23XeR4PbI40DrqmSJk4phu52t0/jxFISNJD+L1cUmeAuHXSfccGnI/L2ivxRcsAP1UoLpPWuR8rlH8hYhWR9GxGHLT8YE5ELqPJU9Ifa5yZwJ0SfRLiGZW2s/gDjWjWHc1AWt4MwAAVILjr8mqSVrgcAzWgbv/b9Kayw4jA9fpqxnrTnCHWUPMjcwSoaFpyQd4uk2Qw02tDIjn86gnKUl0AGWKUUgUJUsl/AEnGF3NQl6 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)(39860400002)(396003)(376002)(136003)(346002)(230922051799003)(230173577357003)(230273577357003)(82310400011)(186009)(1800799012)(64100799003)(451199024)(36840700001)(40470700004)(46966006)(2906002)(86362001)(84970400001)(5660300002)(30864003)(426003)(83380400001)(336012)(36860700001)(47076005)(81166007)(82740400003)(40480700001)(36756003)(966005)(7696005)(40460700003)(2616005)(6666004)(1076003)(26005)(8676002)(8936002)(4326008)(41300700001)(478600001)(316002)(54906003)(70206006)(6916009)(70586007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2023 15:10:00.0727 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f87c0a1-da88-420d-f607-08dbf5a44010 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: AM4PEPF00025F96.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8062 X-Spam-Status: No, score=-11.7 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, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY, URIBL_BLACK 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: 1784455159826923811 X-GMAIL-MSGID: 1784455159826923811 Key changes in v3: * Implement the `require_const_argument' function to ensure the nth argument in EXP represents a const-type argument in the valid range given by [minval, maxval), forgoing expansion altogether when an invalid argument is detected early on. * Whereas in the previous iteration, out-of-bound function parameters led to warnings and sensible defaults set, akin to the `__builtin_prefetch' implementation, parameters outside valid ranges now result in an error, more faithfully reflecting ACLE specifications. --- Implement the ACLE data and instruction prefetch functions[1] with the following signatures: 1. Data prefetch intrinsics: ---------------------------- void __pldx (/*constant*/ unsigned int /*access_kind*/, /*constant*/ unsigned int /*cache_level*/, /*constant*/ unsigned int /*retention_policy*/, void const volatile *addr); void __pld (void const volatile *addr); 2. Instruction prefetch intrinsics: ----------------------------------- void __plix (/*constant*/ unsigned int /*cache_level*/, /*constant*/ unsigned int /*retention_policy*/, void const volatile *addr); void __pli (void const volatile *addr); `__pldx' affords the programmer more fine-grained control over the data prefetch behavior than the analogous GCC builtin `__builtin_prefetch', and allows access to the "SLC" cache level. While `__builtin_prefetch' chooses both cache-level and retention policy automatically via the optional `locality' parameter, `__pldx' expects 2 (mandatory) arguments to explicitly define the desired cache-level and retention policies. `__plix' on the other hand, generates a code prefetch instruction and so extends functionality on aarch64 targets beyond that which is exposed by `builtin_prefetch'. `__pld' and `__pli' do prefetch of data and instructions, respectively, using default values for both cache-level and retention policies. Bootstrapped and tested on aarch64-none-linux-gnu. [1] https://arm-software.github.io/acle/main/acle.html#memory-prefetch-intrinsics gcc/ChangeLog: * config/aarch64/aarch64-builtins.cc: (AARCH64_PLD): New enum aarch64_builtins entry. (AARCH64_PLDX): Likewise. (AARCH64_PLI): Likewise. (AARCH64_PLIX): Likewise. (aarch64_init_prefetch_builtin): New. (aarch64_general_init_builtins): Call prefetch init function. (aarch64_expand_prefetch_builtin): New. (aarch64_general_expand_builtin): Add prefetch expansion. (require_const_argument): New. * config/aarch64/aarch64.md (UNSPEC_PLDX): New. (aarch64_pldx): New. gcc/testsuite/ChangeLog: * gcc.target/aarch64/builtin_pld_pli.c: New. * gcc.target/aarch64/builtin_pld_pli_illegal.c: New. --- gcc/config/aarch64/aarch64-builtins.cc | 136 ++++++++++++++++++ gcc/config/aarch64/aarch64.md | 12 ++ gcc/config/aarch64/arm_acle.h | 30 ++++ .../gcc.target/aarch64/builtin_pld_pli.c | 90 ++++++++++++ .../aarch64/builtin_pld_pli_illegal.c | 33 +++++ 5 files changed, 301 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/builtin_pld_pli.c create mode 100644 gcc/testsuite/gcc.target/aarch64/builtin_pld_pli_illegal.c diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc index 04f59fd9a54..d092654b6fb 100644 --- a/gcc/config/aarch64/aarch64-builtins.cc +++ b/gcc/config/aarch64/aarch64-builtins.cc @@ -808,6 +808,10 @@ enum aarch64_builtins AARCH64_RBIT, AARCH64_RBITL, AARCH64_RBITLL, + AARCH64_PLD, + AARCH64_PLDX, + AARCH64_PLI, + AARCH64_PLIX, AARCH64_BUILTIN_MAX }; @@ -1798,6 +1802,34 @@ aarch64_init_rng_builtins (void) AARCH64_BUILTIN_RNG_RNDRRS); } +/* Add builtins for data and instrution prefetch. */ +static void +aarch64_init_prefetch_builtin (void) +{ +#define AARCH64_INIT_PREFETCH_BUILTIN(INDEX, N) \ + aarch64_builtin_decls[INDEX] = \ + aarch64_general_add_builtin ("__builtin_aarch64_" N, ftype, INDEX) + + tree ftype; + tree cv_argtype; + cv_argtype = build_qualified_type (void_type_node, TYPE_QUAL_CONST + | TYPE_QUAL_VOLATILE); + cv_argtype = build_pointer_type (cv_argtype); + + ftype = build_function_type_list (void_type_node, cv_argtype, NULL); + AARCH64_INIT_PREFETCH_BUILTIN (AARCH64_PLD, "pld"); + AARCH64_INIT_PREFETCH_BUILTIN (AARCH64_PLI, "pli"); + + ftype = build_function_type_list (void_type_node, unsigned_type_node, + unsigned_type_node, unsigned_type_node, + cv_argtype, NULL); + AARCH64_INIT_PREFETCH_BUILTIN (AARCH64_PLDX, "pldx"); + + ftype = build_function_type_list (void_type_node, unsigned_type_node, + unsigned_type_node, cv_argtype, NULL); + AARCH64_INIT_PREFETCH_BUILTIN (AARCH64_PLIX, "plix"); +} + /* Initialize the memory tagging extension (MTE) builtins. */ struct { @@ -2019,6 +2051,8 @@ aarch64_general_init_builtins (void) aarch64_init_rng_builtins (); aarch64_init_data_intrinsics (); + aarch64_init_prefetch_builtin (); + tree ftype_jcvt = build_function_type_list (intSI_type_node, double_type_node, NULL); aarch64_builtin_decls[AARCH64_JSCVT] @@ -2599,6 +2633,102 @@ aarch64_expand_rng_builtin (tree exp, rtx target, int fcode, int ignore) return target; } +/* Ensure ARGNO argument in EXP represents a const-type argument in the range + [MINVAL, MAXVAL). */ +static HOST_WIDE_INT +require_const_argument (tree exp, unsigned int argno, HOST_WIDE_INT minval, + HOST_WIDE_INT maxval) +{ + maxval--; + tree arg = CALL_EXPR_ARG (exp, argno); + if (TREE_CODE (arg) != INTEGER_CST) + error_at (EXPR_LOCATION (exp), "Constant-type argument expected"); + + wi::tree_to_widest_ref argval = wi::to_widest (arg); + + if (argval < minval || argval > maxval) + error_at (EXPR_LOCATION (exp), + "argument %d must be a constant immediate " + "in range [%ld,%ld]", argno, minval, maxval); + + HOST_WIDE_INT retval = *argval.get_val (); + return retval; +} + + +/* Expand a prefetch builtin EXP. */ +void +aarch64_expand_prefetch_builtin (tree exp, int fcode) +{ + unsigned narg; + + tree args[4]; + int kind_id = -1; + int level_id = -1; + int rettn_id = -1; + char prfop[11]; + class expand_operand ops[2]; + + static const char *kind_s[] = {"PLD", "PST", "PLI"}; + static const char *level_s[] = {"L1", "L2", "L3", "SLC"}; + static const char *rettn_s[] = {"KEEP", "STRM"}; + + /* Each of the four prefetch builtins takes a different number of + arguments, but proceeds to call the PRFM insn which requires 4 + pieces of information to be fully defined. + + Specify the total number of arguments for each builtin and, where + one of these takes less than 4 arguments, set sensible defaults. */ + switch (fcode) + { + case AARCH64_PLDX: + narg = 4; + break; + case AARCH64_PLIX: + kind_id = 2; + narg = 3; + break; + case AARCH64_PLI: + case AARCH64_PLD: + kind_id = (fcode == AARCH64_PLD) ? 0 : 2; + level_id = 0; + rettn_id = 0; + narg = 1; + break; + default: + gcc_unreachable (); + } + + /* Any -1 id variable is to be user-supplied. Here we fill these in and + run bounds checks on them. + "PLI" is used only implicitly by AARCH64_PLI & AARCH64_PLIX, never + explicitly. */ + int argno = 0; + if (kind_id < 0) + kind_id = require_const_argument (exp, argno++, 0, ARRAY_SIZE (kind_s) - 1); + if (level_id < 0) + level_id = require_const_argument (exp, argno++, 0, ARRAY_SIZE (level_s)); + if (rettn_id < 0) + rettn_id = require_const_argument (exp, argno++, 0, ARRAY_SIZE (rettn_s)); + rtx address = expand_expr (CALL_EXPR_ARG (exp, argno), NULL_RTX, Pmode, + EXPAND_NORMAL); + + if (seen_error ()) + return; + + sprintf (prfop, "%s%s%s", kind_s[kind_id], + level_s[level_id], + rettn_s[rettn_id]); + + rtx const_str = rtx_alloc (CONST_STRING); + PUT_CODE (const_str, CONST_STRING); + XSTR (const_str, 0) = ggc_strdup (prfop); + + create_fixed_operand (&ops[0], const_str); + create_address_operand (&ops[1], address); + maybe_expand_insn (CODE_FOR_aarch64_pldx, 2, ops); +} + /* Expand an expression EXP that calls a MEMTAG built-in FCODE with result going to TARGET. */ static rtx @@ -2832,6 +2962,12 @@ aarch64_general_expand_builtin (unsigned int fcode, tree exp, rtx target, case AARCH64_BUILTIN_RNG_RNDR: case AARCH64_BUILTIN_RNG_RNDRRS: return aarch64_expand_rng_builtin (exp, target, fcode, ignore); + case AARCH64_PLD: + case AARCH64_PLDX: + case AARCH64_PLI: + case AARCH64_PLIX: + aarch64_expand_prefetch_builtin (exp, fcode); + return target; } if (fcode >= AARCH64_SIMD_BUILTIN_BASE && fcode <= AARCH64_SIMD_BUILTIN_MAX) diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index b8e12fc1d4b..68713c58f07 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -338,6 +338,7 @@ UNSPEC_UPDATE_FFRT UNSPEC_RDFFR UNSPEC_WRFFR + UNSPEC_PLDX ;; Represents an SVE-style lane index, in which the indexing applies ;; within the containing 128-bit block. UNSPEC_SVE_LANE_SELECT @@ -916,6 +917,17 @@ [(set_attr "type" "load_4")] ) +(define_insn "aarch64_pldx" + [(unspec [(match_operand 0 "" "") + (match_operand:DI 1 "aarch64_prefetch_operand" "Dp")] UNSPEC_PLDX)] + "" + { + operands[1] = gen_rtx_MEM (DImode, operands[1]); + return "prfm\\t%0, %1"; + } + [(set_attr "type" "load_4")] +) + (define_insn "trap" [(trap_if (const_int 1) (const_int 8))] "" diff --git a/gcc/config/aarch64/arm_acle.h b/gcc/config/aarch64/arm_acle.h index 7599a32301d..40e5aa61be2 100644 --- a/gcc/config/aarch64/arm_acle.h +++ b/gcc/config/aarch64/arm_acle.h @@ -78,6 +78,36 @@ _GCC_ARM_ACLE_DATA_FN (revll, bswap64, uint64_t, uint64_t) #undef _GCC_ARM_ACLE_DATA_FN +__extension__ extern __inline void +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +__pld (void const volatile *__addr) +{ + return __builtin_aarch64_pld (__addr); +} + +__extension__ extern __inline void +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +__pli (void const volatile *__addr) +{ + return __builtin_aarch64_pli (__addr); +} + +__extension__ extern __inline void +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +__plix (unsigned int __cache, unsigned int __rettn, + void const volatile *__addr) +{ + return __builtin_aarch64_plix (__cache, __rettn, __addr); +} + +__extension__ extern __inline void +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +__pldx (unsigned int __access, unsigned int __cache, unsigned int __rettn, + void const volatile *__addr) +{ + return __builtin_aarch64_pldx (__access, __cache, __rettn, __addr); +} + __extension__ extern __inline unsigned long __attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) __revl (unsigned long __value) diff --git a/gcc/testsuite/gcc.target/aarch64/builtin_pld_pli.c b/gcc/testsuite/gcc.target/aarch64/builtin_pld_pli.c new file mode 100644 index 00000000000..8cbaa97c00c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/builtin_pld_pli.c @@ -0,0 +1,90 @@ +/* { dg-do compile } */ +/* { dg-options "-march=armv8-a -O2" } */ + +#include + +/* Check that we can generate the immediate-offset addressing + mode for PRFM. */ + +/* Access kind specifiers. */ +#define PLD 0 +#define PST 1 +/* Cache levels. */ +#define L1 0 +#define L2 1 +#define L3 2 +#define SLC 3 +/* Retention policies. */ +#define KEEP 0 +#define STRM 1 + +void +prefetch_for_read_write (void *a) +{ + __pldx (PLD, L1, KEEP, a); + __pldx (PLD, L1, STRM, a); + __pldx (PLD, L2, KEEP, a); + __pldx (PLD, L2, STRM, a); + __pldx (PLD, L3, KEEP, a); + __pldx (PLD, L3, STRM, a); + __pldx (PLD, SLC, KEEP, a); + __pldx (PLD, SLC, STRM, a); + __pldx (PST, L1, KEEP, a); + __pldx (PST, L1, STRM, a); + __pldx (PST, L2, KEEP, a); + __pldx (PST, L2, STRM, a); + __pldx (PST, L3, KEEP, a); + __pldx (PST, L3, STRM, a); + __pldx (PST, SLC, KEEP, a); + __pldx (PST, SLC, STRM, a); +} + +/* { dg-final { scan-assembler "prfm\tPLDL1KEEP, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPLDL1STRM, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPLDL2KEEP, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPLDL2STRM, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPLDL3KEEP, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPLDL3STRM, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPLDSLCKEEP, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPLDSLCSTRM, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPSTL1KEEP, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPSTL1STRM, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPSTL2KEEP, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPSTL2STRM, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPSTL3KEEP, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPSTL3STRM, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPSTSLCKEEP, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPSTSLCSTRM, \\\[x\[0-9\]+\\\]" } } */ + +void +prefetch_simple (void *a) +{ + __pld (a); + __pli (a); +} + +/* { dg-final { scan-assembler "prfm\tPLDL1KEEP, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPLIL1KEEP, \\\[x\[0-9\]+\\\]" } } */ + +void +prefetch_instructions (void *a) +{ + __plix (L1, KEEP, a); + __plix (L1, STRM, a); + __plix (L2, KEEP, a); + __plix (L2, STRM, a); + __plix (L3, KEEP, a); + __plix (L3, STRM, a); + __plix (SLC, KEEP, a); + __plix (SLC, STRM, a); +} + +/* { dg-final { scan-assembler "prfm\tPLIL1KEEP, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPLIL1STRM, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPLIL2KEEP, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPLIL2STRM, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPLIL3KEEP, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPLIL3STRM, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPLISLCKEEP, \\\[x\[0-9\]+\\\]" } } */ +/* { dg-final { scan-assembler "prfm\tPLISLCSTRM, \\\[x\[0-9\]+\\\]" } } */ + diff --git a/gcc/testsuite/gcc.target/aarch64/builtin_pld_pli_illegal.c b/gcc/testsuite/gcc.target/aarch64/builtin_pld_pli_illegal.c new file mode 100644 index 00000000000..fa9faf71ad1 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/builtin_pld_pli_illegal.c @@ -0,0 +1,33 @@ +/* Check that PRFM-related bounds checks are applied correctly. */ +/* { dg-do compile } */ +#include + +/* Access kind specifiers. */ +#define KIND_LOW -1 +#define KIND_HIGH 2 +/* Cache levels. */ +#define LEVEL_LOW -1 +#define LEVEL_HIGH 4 +/* Retention policies. */ +#define POLICY_LOW -1 +#define POLICY_HIGH 2 + +void +data_rw_prefetch_bad_bounds (void *a) +{ + __builtin_aarch64_pldx (KIND_LOW, 0, 0, a); /* { dg-error {argument 0 must be a constant immediate in range \[0,1\]} } */ + __builtin_aarch64_pldx (KIND_HIGH, 0, 0, a); /* { dg-error {argument 0 must be a constant immediate in range \[0,1\]} } */ + __builtin_aarch64_pldx (0, LEVEL_LOW, 0, a); /* { dg-error {argument 1 must be a constant immediate in range \[0,3\]} } */ + __builtin_aarch64_pldx (0, LEVEL_HIGH, 0, a); /* { dg-error {argument 1 must be a constant immediate in range \[0,3\]} } */ + __builtin_aarch64_pldx (0, 0, POLICY_LOW, a); /* { dg-error {argument 2 must be a constant immediate in range \[0,1\]} } */ + __builtin_aarch64_pldx (0, 0, POLICY_HIGH, a); /* { dg-error {argument 2 must be a constant immediate in range \[0,1\]} } */ +} + +void +insn_prefetch_bad_bounds (void *a) +{ + __builtin_aarch64_plix (LEVEL_LOW, 0, a); /* { dg-error {argument 0 must be a constant immediate in range \[0,3\]} } */ + __builtin_aarch64_plix (LEVEL_HIGH, 0, a); /* { dg-error {argument 0 must be a constant immediate in range \[0,3\]} } */ + __builtin_aarch64_plix (0, POLICY_LOW, a); /* { dg-error {argument 1 must be a constant immediate in range \[0,1\]} } */ + __builtin_aarch64_plix (0, POLICY_HIGH, a); /* { dg-error {argument 1 must be a constant immediate in range \[0,1\]} } */ +}