From patchwork Mon Oct 30 14:56:26 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: 1857155 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=bx+OZEb6; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.a=rsa-sha256 header.s=selector2-armh-onmicrosoft-com header.b=bx+OZEb6; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SJxFN6t0Kz1yQW for ; Tue, 31 Oct 2023 01:57:12 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D20A13856DC7 for ; Mon, 30 Oct 2023 14:57:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2068.outbound.protection.outlook.com [40.107.104.68]) by sourceware.org (Postfix) with ESMTPS id 69E563858C5F for ; Mon, 30 Oct 2023 14:56:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 69E563858C5F 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 69E563858C5F Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.104.68 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1698677818; cv=pass; b=ospXR3PoZJLDlOYXacswDy+DHSliNNegSwlMb2mCZoP98m6sPd57wSe0xNLH6igUgivVGnIeJHpVydbkZHsifLL1V3EL1KtdLlrEf56iMOuPuO3+1uwfl1XOwxEtbVmltr0rtSmR0dzFZpQmD33ep0aR4M6o5QbjIV8GvNNlSIY= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1698677818; c=relaxed/simple; bh=uVDgX0fqy0Lid9ONRGhWMrR9DOdmTN+61tSqRd4OLI0=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=mf6jEx0SQPwoAT/GbtvkPLGScoVjf1g08cOoc0CVur4fvwlnrrBAxSx9osJ9k/py/AJqCRprfT5f1jGpjhXWt7MbThjsdx7mXdIPs1wnvexPVqxzMeAYdPQnCp+VxAf7FobgwPeFUjodevNw6xjGKi5jrvmj+EOLuybn6SWpIQM= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Eqeu09AGnYydisEYfooCMWUP5tsNb0hPOahTSdfUc+1sBLP6i0b0NhMyrBOqHZ1Ef1t2FzYl0GUvHRfsSJdkvx6XFVi+N8F9Z4p1OPHvZhzer9luTyJb9mlaPEdRWrc3I5zR+CbWn/fkqxe5BLtMAChClSPm5JV/aex0WLor/qc5yAAen8yCn1GVGpStQjFTAITXT7kqsbGhOhS5pm1mfJwVSlBfOkIPNCQR7WupidXhwa1ZYRv5wAL/sTldWZs9dKWUd4RSw/50Y9O493dyg47ChY+lBKdhP3IbNLf7tl2TD1YuYkguOVfrKg9j2aC9c7YOY3AVCkAXEqgj4BtX+w== 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=06sIAuaRA79EartS8d2iuJWzCrEAHXigadSBTbnFkFI=; b=NCYD1CNHeQdigicQ9NUXxe7XppUJitA2UcqxpTFcw6pgAg8Ecbc67LmqHq0WTWF3uvIWxW80V8INhv3ISPVFNb+JJQjqoqZzTf//7kEKXKQ2fTXjsZ2T0bD9t6IqlfHQAWSYEeMoqtXF36r5tXe0zcKw5tksAKToR6jPRDtToJ52w5YNhuxz0CyoS5+Aap+vLYpsATn+OupJnELItIxcT68noNUXLwyYF4LDYPjxZlrr+zgsj3PiHufKUgbe9+YUP1BS/mmXDId2OGZl0Rcfq2hbvCaGkm9qyg8GYcdoTH9Ndj64W/dwFpi5nV8Ui8+carHVFjXcyaezvjMns3mKoQ== 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=06sIAuaRA79EartS8d2iuJWzCrEAHXigadSBTbnFkFI=; b=bx+OZEb6LxQNHT/qDN6fBdDiDvg55xLScvCOX5OvZcimHEsCg7iFLE0u9ccM3/090W8IJO/D7iBQdAAhoQN2iwQDYBUa7/E4ESs/eTQCQk3Bjcahzh8XLBp58Eqli5+JHkW6o9DDugl5eJBY3TaLROUZbG2gAQp2oWSHnyWNf8I= Received: from AS9PR04CA0150.eurprd04.prod.outlook.com (2603:10a6:20b:48a::23) by DB8PR08MB5451.eurprd08.prod.outlook.com (2603:10a6:10:113::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.24; Mon, 30 Oct 2023 14:56:50 +0000 Received: from AMS1EPF0000003F.eurprd04.prod.outlook.com (2603:10a6:20b:48a:cafe::11) by AS9PR04CA0150.outlook.office365.com (2603:10a6:20b:48a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.28 via Frontend Transport; Mon, 30 Oct 2023 14:56:50 +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 AMS1EPF0000003F.mail.protection.outlook.com (10.167.16.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.15 via Frontend Transport; Mon, 30 Oct 2023 14:56:49 +0000 Received: ("Tessian outbound 20615a7e7970:v228"); Mon, 30 Oct 2023 14:56:49 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: defc86f5f16cac71 X-CR-MTA-TID: 64aa7808 Received: from 7a8cca50f8b5.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8D9972DA-3A5F-4CFB-A8E0-C9445D963745.1; Mon, 30 Oct 2023 14:56:42 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 7a8cca50f8b5.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 30 Oct 2023 14:56:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EH7dbLvJie27ECKG4D22g5QR8y8g8RN7mNtG+62SCXFEEduooNT7NcFICq5IWY0oV4iiQ6oLLUPkiuZoeV8hqPnDmQl6fM5TZXQ3YZCV4/4vv8u+B7B26/qCFPXKn/148PLMknTL5tXFvQobe2LvGW8pk18BNmAjJDr/YENy8EOG24Q7rpWju3U9bGH0c4WkhT5+pawiTjyhDRBgFVEvqHxDGgzZrp4rDXn9ULo9Pg24/4FP1nnqjMqXoMcz2W7kFjJz9OCPJoGFu/NcLlnhVzpjEq5lMpQq+iUm7gn9U3pne8i1IxY+BqUFU7Y4hZ4YHQAKOB8PmdhvS8VNomec4g== 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=06sIAuaRA79EartS8d2iuJWzCrEAHXigadSBTbnFkFI=; b=SpfGHv1OOHlKrVUrbightOEDYxfp2V2yv4t2HgzGBbIYzSue/wFVC0q7nUT98kJwTnH2HUNAkcCKgesEn1AiQ8znh/KbuUW+f50+905zVKsFvBoPQ2Jy+LQQvUGZ9uUUdk1/qDwzodDQwIc1lBENX9Nc6z6BRXtwHA0e9BhFWzGj5nLHX6o2vH2QmE7+2fR7IfRbEa4taPJ3rgaMkRSSAK2ZunZF2mmBqYoW+mjXBxrqR6W6laSeWPQR+qIPJnDmEz+7KV22tsWQVi5fFCGLmvGT7qRND0gH5Y20M6W3vUByVkXlpskariKsRr7yGwQFXpXQJmD9bJBqZQJGjCEVBA== 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=06sIAuaRA79EartS8d2iuJWzCrEAHXigadSBTbnFkFI=; b=bx+OZEb6LxQNHT/qDN6fBdDiDvg55xLScvCOX5OvZcimHEsCg7iFLE0u9ccM3/090W8IJO/D7iBQdAAhoQN2iwQDYBUa7/E4ESs/eTQCQk3Bjcahzh8XLBp58Eqli5+JHkW6o9DDugl5eJBY3TaLROUZbG2gAQp2oWSHnyWNf8I= Received: from AM6P194CA0027.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:90::40) by GVXPR08MB7727.eurprd08.prod.outlook.com (2603:10a6:150:6b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.26; Mon, 30 Oct 2023 14:56:39 +0000 Received: from AM2PEPF0001C716.eurprd05.prod.outlook.com (2603:10a6:209:90:cafe::b9) by AM6P194CA0027.outlook.office365.com (2603:10a6:209:90::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.27 via Frontend Transport; Mon, 30 Oct 2023 14:56:39 +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 AM2PEPF0001C716.mail.protection.outlook.com (10.167.16.186) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6933.15 via Frontend Transport; Mon, 30 Oct 2023 14:56:39 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) 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.32; Mon, 30 Oct 2023 14:56:38 +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; Mon, 30 Oct 2023 14:56:37 +0000 From: Victor Do Nascimento To: CC: , , , Victor Do Nascimento Subject: [PATCH V2] aarch64: Implement the ACLE instruction/data prefetch functions. Date: Mon, 30 Oct 2023 14:56:26 +0000 Message-ID: <20231030145629.1022323-1-victor.donascimento@arm.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM2PEPF0001C716:EE_|GVXPR08MB7727:EE_|AMS1EPF0000003F:EE_|DB8PR08MB5451:EE_ X-MS-Office365-Filtering-Correlation-Id: c84940a6-6ccb-40a5-a5bd-08dbd9587205 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: mYOn88nSvWghbIbrKwSB+NCUzM1eeMjc3PXynjalFxwpdBN0EyXpy06hfzd8psMKjJ4kI5XpwFj61lJ0pgpcrYdX5kA/2O2EYjlLM/Yf0PhNaYkCbvEIJt2n35hv/KhPsxtnd2B7uarRYhvP5Yvw5NDdg/S1kbuiXbjW7X6BJ3SICKGJYKtWqTTIoQfbCQ37A2tCZmpSwCYd2oELPDzEXsNEhozFk+dBT2M7mwg20OdiaBWOOMhGKelcbzFebiP/YKELkbkCLT1k/tmXwj30VvZcatJwuuBfgcHn7Nx8djRWQo1I3wUBBe+drOLPxKtQP/dTLhBiJcMxZfvs5gwf1w7F1hA8f6fmE3jhTWMblL+alkq3McUk8w56d3+wHVkvQotXgswsL1bAMgpyL9bcDud+JCQoHknGd6nbeeazyy3mSz69sZyUdW2Lo77eO0UIQbgajvp23zNse2QAsICNVSVrR7dDbBOwGTcwXMUhBuhCurMyIQkcnZOuPSitX1kF5He0DQsc6moSBiCjtjaZ1vAC6J5GHb6n0DDy2xYLXwAqX9tyeX3kYKRqCsQxJuEDcT10jim/Z5JZ7HZQWAVYwoJuZBIAIPlpoSeLvcXAtzkScbLy0SgmRlR3Vf7CQePa/djYCnL21mvrjEofvV3+2yLgsaXu1gBbj2eSoY8gKWr7OX4yzLji3fnU2yd7OLawlfAkF8bx35psXHW6xvfD+BzIfEywrA1LqMlvEEZvOch0sdf29S0V4tv4B4y6fL2pofiZ0PhfKj9LihquyfzmzumQs/s6Kk18HLIGCQY2v57InKmMaPkk+fILb33J9KhKZWQ4HnSexrxkZzEKWGZEVQ== 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)(396003)(136003)(376002)(346002)(230173577357003)(230273577357003)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(82310400011)(36840700001)(40470700004)(46966006)(30864003)(2906002)(86362001)(41300700001)(4326008)(8676002)(8936002)(5660300002)(40460700003)(36756003)(478600001)(966005)(40480700001)(47076005)(7696005)(6666004)(1076003)(81166007)(84970400001)(6916009)(54906003)(316002)(26005)(70206006)(426003)(70586007)(336012)(36860700001)(83380400001)(82740400003)(2616005)(356005)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB7727 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AMS1EPF0000003F.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 3916d8f9-238e-4d05-b4d2-08dbd9586bed X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AmEx1xW3nlXQfPP/KlWaYlMHyT0UC4kQbzfw1JaaxPy0eStep6uyR1SGE7tujohVzJh6sRQKg1dtj+He6B5/3+RtohLtWPD1XLdXoY0BSGPB9ZRFz2ZHfH0QeuNGJM1kuYA6Kbs6oJmyyiz15IsebcF1Ov4CGFnZTLGaNyoQ1BfPERiHbeRK3IjpCt4Ol15cpfxJpyoTKbQuKbYWNuGSKCMnaf/Fa3htQ5RDB/6QEjD07FwrJimRK7cjRooPfRjMCKUDJRKxO1F3pIfPLia+VVeDnJBrVpkhuF28yQLjLh2IMo2NioogF7uPADJS9K5ne0xVg3jKtLgc7wNA2nR9/IFQIu5kfhhp+dnl5W2xA3UP0asREv39uegOMLr4oqy+LSfjSXJUH38N8uSofEciO+TXjK9yQqEQxJ84+jn1OM6Idet7nDKViwC3oN0toI4R62Z6qtOZ73AxqHS9+UzP8jcmAsHK9UGNUxn2VrRke/j3h3z27ek9YhRLi0Ojaawe+hXgFIUPiW81IuiVYKAQ14OP7bgTBCWUABxl71hO9wxtRdIRWalYPC7U+JDrZ4AJCqTLMnTK4Dh9T5gPTaewudycx8ND3qshEj87X+gU1e326/COZLDVW44WBe3H2KobC5QLQeSWESlCZLHQkOhPMgpICbXTiPnA5kVwVGY5wvF1M4Monb9om3Zm3P5xfAnHo3oubYWLxNmfbsnEAZspILfa+hkngtFqY+5vjiCZp7TmslvG35J2Xg7gSjZqjsSIiGJHgN6vHDjtU2icWGtTahdbpTUWO+FlD/1McgYFJZkJDvUdGQ+ovV/vla2fWqjc 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)(136003)(346002)(376002)(230173577357003)(230922051799003)(230273577357003)(1800799009)(82310400011)(64100799003)(186009)(451199024)(36840700001)(40470700004)(46966006)(426003)(336012)(966005)(1076003)(26005)(478600001)(6666004)(84970400001)(2616005)(83380400001)(7696005)(70206006)(70586007)(54906003)(6916009)(316002)(81166007)(36860700001)(82740400003)(47076005)(41300700001)(86362001)(30864003)(40480700001)(40460700003)(5660300002)(36756003)(2906002)(8676002)(8936002)(4326008); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2023 14:56:49.5598 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c84940a6-6ccb-40a5-a5bd-08dbd9587205 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: AMS1EPF0000003F.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5451 X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_DMARC_NONE, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Correct CV-qualification from being erroeously applied to the `addr' pointer, applying it instead to its pointer target, as specified by the ACLE standards. --- 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 behaviour 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. * config/aarch64/aarch64.md (UNSPEC_PLDX): New. (aarch64_pldx): New. gcc/testsuite/ChangeLog: * gcc.target/aarch64/builtin_pld_pli.c: New. --- gcc/config/aarch64/aarch64-builtins.cc | 161 ++++++++++++++++++ gcc/config/aarch64/aarch64.md | 12 ++ gcc/config/aarch64/arm_acle.h | 30 ++++ .../gcc.target/aarch64/builtin_pldx.c | 90 ++++++++++ 4 files changed, 293 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/builtin_pldx.c diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc index 04f59fd9a54..27a4c87b300 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,127 @@ aarch64_expand_rng_builtin (tree exp, rtx target, int fcode, int ignore) return target; } +/* Expand a prefetch builtin EXP. */ +void +aarch64_expand_prefetch_builtin (tree exp, int fcode) +{ + +#define EXPAND_CONST_INT(IN_IDX, OUT_IDX, ERRMSG) \ + if (TREE_CODE (args[IN_IDX]) != INTEGER_CST) \ + { \ + error_at (EXPR_LOCATION (exp), ERRMSG); \ + args[IN_IDX] = integer_zero_node; \ + } \ + ops[OUT_IDX] = expand_normal (args[IN_IDX]) + +#define WARN_INVALID(VAR, ERRMSG) \ + do { \ + warning_at (EXPR_LOCATION (exp), 0, ERRMSG); \ + VAR = 0; \ + } while (0) + + unsigned narg; + + tree args[4]; + rtx ops[4]; + int kind_id, level_id, rettn_id; + char prfop[11]; + + char kind_s[3][4] = {"PLD", "PST", "PLI"}; + char level_s[4][4] = {"L1", "L2", "L3", "SLC"}; + char rettn_s[2][5] = {"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: + kind_id = -1; + narg = 4; + break; + case AARCH64_PLIX: + kind_id = 2; + narg = 3; + break; + case AARCH64_PLI: + case AARCH64_PLD: + default: + kind_id = (fcode == AARCH64_PLD) ? 0 : 2; + level_id = 0; + rettn_id = 0; + narg = 1; + break; + } + + int addr_arg_index = narg - 1; + + /* Extract the correct number of arguments from our function call. */ + for (unsigned i = 0; i < narg; i++) + args[i] = CALL_EXPR_ARG (exp, i); + + /* Check address argument. */ + if (!(POINTER_TYPE_P (TREE_TYPE (args[addr_arg_index]))) + || (TREE_CODE (TREE_TYPE (TREE_TYPE (args[addr_arg_index]))) + != VOID_TYPE)) + error_at (EXPR_LOCATION (exp), "invalid address type specified;" + " void const volatile * required"); + + ops[3] = expand_expr (args[addr_arg_index], NULL_RTX, Pmode, EXPAND_NORMAL); + + /* Check arguments common to both pldx and plix. */ + if (fcode == AARCH64_PLDX || fcode == AARCH64_PLIX) + { + int cache_index = (fcode == AARCH64_PLIX) ? 0 : 1; + int policy_index = cache_index + 1; + + /* Cache level must be 0, 1, 2 or 3. */ + EXPAND_CONST_INT (cache_index, 1, + "Cache-level argument must be a constant"); + level_id = INTVAL (ops[1]); + if (level_id < 0 || level_id > 3) + WARN_INVALID (level_id, "invalid cache level selected; using zero"); + + /* Retention policy must be either zero or one. */ + EXPAND_CONST_INT (policy_index, 2, + "Retention policy argument must be a constant"); + rettn_id = INTVAL (ops[2]); + if (rettn_id != 0 && rettn_id != 1) + WARN_INVALID (rettn_id, "invalid retention policy selected; " + "using zero"); + } + + /* For PLDX, validate the access kind argument. */ + if (fcode == AARCH64_PLDX) + { + /* Argument 0 must be either zero or one. */ + EXPAND_CONST_INT (0, 0, "Access kind argument must be a constant"); + kind_id = INTVAL (ops[0]); + if (kind_id != 0 && kind_id != 1) + WARN_INVALID (kind_id, "invalid access kind argument; using zero"); + } + + 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) = xstrdup (prfop); + + class expand_operand exp_ops[2]; + + create_fixed_operand (&exp_ops[0], const_str); + create_address_operand (&exp_ops[1], ops[3]); + maybe_expand_insn (CODE_FOR_aarch64_pldx, 2, exp_ops); + + #undef EXPAND_CONST_INT + #undef WARN_INVALID +} + /* Expand an expression EXP that calls a MEMTAG built-in FCODE with result going to TARGET. */ static rtx @@ -2832,6 +2987,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 5bb8c772be8..7b1cc4c137b 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -281,6 +281,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 @@ -844,6 +845,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_pldx.c b/gcc/testsuite/gcc.target/aarch64/builtin_pldx.c new file mode 100644 index 00000000000..8cbaa97c00c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/builtin_pldx.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\]+\\\]" } } */ +