From patchwork Wed Oct 18 15:02:46 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: 154919 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4855762vqb; Wed, 18 Oct 2023 08:05:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVga8PUvnlltwalwgG7At6Avk9EcP3Jlw1bqB7Otj6AruNvi1FL77pD+cl2KGk/xA/TI3+ X-Received: by 2002:a05:6808:23cd:b0:3b2:f275:18a8 with SMTP id bq13-20020a05680823cd00b003b2f27518a8mr1028365oib.22.1697641525085; Wed, 18 Oct 2023 08:05:25 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1697641525; cv=pass; d=google.com; s=arc-20160816; b=BFynSJwMtqF8KofEcR8C1084D6VSUsvpMGc6gAXihgaOKHY0Zg7DPqIZ1WJ/csJdD8 2Xz39dgK6RFxlPW/RYgCAcYBGRuG5qRCQ5nSkXqRKIrY0Zgi4i785fXEEnMNXn99dTi/ XNWrIocEjscg8orAAkUC7Dt/e1NF/vgr6dIRHB0hNycjqGlywaBvJFLPuT8cFJU3RVz8 TfABjz14Sv6Z4n4ilvAZgAJkuHysCRKyYDiN7CFFhfD7R9At+ToHyy9l8WrmylT5Z1F/ bHiW1YcTMhh1q5XubiGI6iGvtLO9+I+cpDFWsvSFBSoA3M2EeJzr1UIk8m62e5v0+s7H 1KDg== ARC-Message-Signature: i=3; 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:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=m/a4gZv6YTdWiPMbh9Htf51jPLubGAwUM5fgy9JzgSk=; fh=puYCM8FRHzins9HjEsl9lyIrPa8b21rR+m5ND3mNx7M=; b=p1/dokpDT24q4vGxNsv18/U1tISwSj+uqHT6teGS25L/rF5nomOVlV1axjLXJ9m3MW ojPwvViNtd+vmMmyjfC3sghjYr5pAd+aRtj1D5nls4tNFb5K/w3PYHrBSKe1RYemVL/A Gq8Y2lIqcG8ODun6f3PxVNjfH6bAI6tylPz8rutlNYn3CNWp4ztlnDcfN457yqHilSeK P6xyIT0uUbNC0Yz01x5B7QuIA0o3puH9zOOpv33qN1XKxMk+Yhkk2wPZLxlMPxun1owD VwXiMqBR+dFspB8+mA6p3KIwgu6AtrK3DSB5+dSBdWRvxslgJ56hRFsPMknTpo5JcRZk Y/xQ== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=ds+1Qy2A; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=ds+1Qy2A; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id jx9-20020a0562142b0900b0066cf6a75891si32118qvb.601.2023.10.18.08.05.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 08:05:25 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=ds+1Qy2A; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=ds+1Qy2A; arc=pass (i=2); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=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 AE1423857347 for ; Wed, 18 Oct 2023 15:05:14 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2042.outbound.protection.outlook.com [40.107.241.42]) by sourceware.org (Postfix) with ESMTPS id D0C353858C53 for ; Wed, 18 Oct 2023 15:04:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D0C353858C53 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 D0C353858C53 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.241.42 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1697641483; cv=pass; b=tylzm6dM4uOeolNKRxryImy5jOi//OG1xJh1l7vR2z8OBLs6zSUrIKQ4BQKuJVdu4vjbJZ0G/xqqDz1SM3KK5SzT3Vo9xwvf7sp6l7EHb8z7bgwLgsttbtjJ/dvXgghWJL/8eGPMu4K3IVMgKRoeomRaU/VzIv9gATuzQQXdT7o= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1697641483; c=relaxed/simple; bh=BoJFnYm/TNvbQqZH1G88wN/0LZJiIzmanFg00p9lrQ8=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=LZjIWLivU7z0HPUtZYRiTL69KNJLQZgJbm3D9ASx9fusiGzx7Ye93i5N2y1x5OBVWAtkwgHB1nrrROdOIPEDGjznybskvnJcWO8dS25EmonOHe/vDr/s6mXhZ73oG7/lvJU5nPDhm1M1UYcekReRf9S35sUeMphY33DQeZG3VWA= ARC-Authentication-Results: i=2; server2.sourceware.org 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=m/a4gZv6YTdWiPMbh9Htf51jPLubGAwUM5fgy9JzgSk=; b=ds+1Qy2A/9LgsdOOz9s13MJTaEbVYOLDvnDBR193XuvDNwTtawFhXFldwLCzg6HeQW5XlZxzPVYlh8pUdNLJHjIMgJvzah0LMcr8UKGXWdvhEL7DLYD9eRzbU4CFe4epSfdYBMsemwRAY/J43SEXBFDd8JLzKjWQ6bHcHdAIR7s= Received: from DU2PR04CA0049.eurprd04.prod.outlook.com (2603:10a6:10:234::24) by DBBPR08MB10436.eurprd08.prod.outlook.com (2603:10a6:10:534::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Wed, 18 Oct 2023 15:04:28 +0000 Received: from DBAEUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:234:cafe::7e) by DU2PR04CA0049.outlook.office365.com (2603:10a6:10:234::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.21 via Frontend Transport; Wed, 18 Oct 2023 15:04:28 +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 DBAEUR03FT055.mail.protection.outlook.com (100.127.142.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.23 via Frontend Transport; Wed, 18 Oct 2023 15:04:28 +0000 Received: ("Tessian outbound 470906b1fe6c:v215"); Wed, 18 Oct 2023 15:04:28 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8e495f5bb0b7c631 X-CR-MTA-TID: 64aa7808 Received: from e5554ec5c1d2.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id AC06D13F-211A-45AC-952B-E72014616948.1; Wed, 18 Oct 2023 15:04:22 +0000 Received: from EUR02-AM0-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e5554ec5c1d2.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 18 Oct 2023 15:04:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RWslF2zjF98CYsuy9oKeuno99UhuO2nEi6wHdZTbPhDHkJ6pX6QnFQ9DGnaAHrXATiems45wdr3cc+Y4tR0NSpQ3EYDmkEDKgLwcQCRl801S7TIKzvsEpx+aB5wTJQOP0RIktKZaZxJs4WbUYr8h9RJMeNgGJ/NBBYyr0aoG/hgi7qfBgOFUWU42RrTLAj7bTtOj0ipfixq5t/cKRCd2wHXkeJNj4v3AM9bMb6AONUf/D7O4Pr86aKM9StTS+Nia7emJsJLJow9wuTlJsbVbGf7PlPWVx7cK8FOe/ZEHLN2jjbEdM1Wg98ETwqWdntaxai8cij866Kr36iIWUsBqNw== 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=m/a4gZv6YTdWiPMbh9Htf51jPLubGAwUM5fgy9JzgSk=; b=EtvGW95m3G83LTBpmMuTDuUj4anT7XJVum2kQt6yaBHhRHo5qrOOVwkEYU5IfVzCK/3N3tAG5fKLda8EvUdJQQ9O/08Hqc2H0yMBqRoi/razszbd/COQG2KQqNoCWtdt8GeaWKutbzzOiQkCauPvrNOaHd2eyjGKwoJicmuhZ7GmL+/WHWjBldApzrIiD5NveZxeeZ2b2SjF6Kq6XFKsX26h4OfhRYLLgE1CqdD7xmL9vIYGolyCAuoJh0otnwSRHkzdsmVTlalSye9SvCB0JzKFB4ZYlh93KYhPiZb378e2qq42RI9T1vEt4c3oG1/nk5ZD42vJj5K5xtUQdNUM4A== 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 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=m/a4gZv6YTdWiPMbh9Htf51jPLubGAwUM5fgy9JzgSk=; b=ds+1Qy2A/9LgsdOOz9s13MJTaEbVYOLDvnDBR193XuvDNwTtawFhXFldwLCzg6HeQW5XlZxzPVYlh8pUdNLJHjIMgJvzah0LMcr8UKGXWdvhEL7DLYD9eRzbU4CFe4epSfdYBMsemwRAY/J43SEXBFDd8JLzKjWQ6bHcHdAIR7s= Received: from DUZP191CA0034.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:4f8::11) by DB5PR08MB10138.eurprd08.prod.outlook.com (2603:10a6:10:4a3::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.23; Wed, 18 Oct 2023 15:04:20 +0000 Received: from DU6PEPF0000B61E.eurprd02.prod.outlook.com (2603:10a6:10:4f8:cafe::9d) by DUZP191CA0034.outlook.office365.com (2603:10a6:10:4f8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.23 via Frontend Transport; Wed, 18 Oct 2023 15:04:20 +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 DU6PEPF0000B61E.mail.protection.outlook.com (10.167.8.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6907.20 via Frontend Transport; Wed, 18 Oct 2023 15:04:20 +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; Wed, 18 Oct 2023 15:04:16 +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; Wed, 18 Oct 2023 15:04:16 +0000 From: Victor Do Nascimento To: CC: , , , Victor Do Nascimento Subject: [PATCH V2 5/7] aarch64: Implement system register r/w arm ACLE intrinsic functions Date: Wed, 18 Oct 2023 16:02:46 +0100 Message-ID: <20231018150310.253793-6-victor.donascimento@arm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231018150310.253793-1-victor.donascimento@arm.com> References: <20231018150310.253793-1-victor.donascimento@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: DU6PEPF0000B61E:EE_|DB5PR08MB10138:EE_|DBAEUR03FT055:EE_|DBBPR08MB10436:EE_ X-MS-Office365-Filtering-Correlation-Id: 664af4f1-895c-446e-9d45-08dbcfeb86a8 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: ZUI3MXl91ZhJh0regmCsJImNrm4v0+78u8NgWvKAuV/CbB+nfiQc9Oc1oRV3gBjQgpy6jsIeoL0PkkFqE+Ud+gRxJ+bUQLbncjxJEBsGWTLQ+sXalPFWQnVPiq4dZNpRcthnXZX3VoCpVi45E3o70MmwkF5UP7TbmM7dosQUCXFrzYqiSLye6RJ/3sLRk9UG8i1VVxHwqKtSLvahBCK/yp09InfiOjpeB+cGB6qAAo0mRHWxh+oLM58XLLQZq+BKOU/YZXgHVXJYCuNpg9iGBxjh7dLQteIdYOuG78dxYsGxnz8l8JdPyQnAiEXakNvflNX22jryqHj4Nq73Vx3egr46XOMS+UfQBydnGR3WSHKVpWRZCZf+q/3UCctKg5CI2IWZr5VLj8HnoipJ1YrRMNlFXaVdUzLdZJ9KtgPnsNi2UUdIN4rJvU9aeTZ2Vn42UY6Ho5vcA/g+7wxD4tCqFnRpWFtL/J65uZHnv/fe/2O2QWJhm3SNw54SsSx338ahDFnjt7MM4Qw9VKX/Ad1T+m5ccMljjM7MFaZWMHpaR7TTAfrpo86LnfoptMScxM6qzLB0CGFtU+8M442M00PlKwV1ldBJfC4OfUHRn5anwSNDAUqw5a6/+4JyRfybIBxNFXbinLMl6FFQM8xx3vKz/ILJb9fGfJdoDy6lzFkpKACE1y8Xu4tOEGQKgASMewdgXaq3+N/qdnRdajN455LDb1aBbhB3Vy/PG0Ta6JZHYXnscr4uYg/qymIQKX1T6eKT 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)(376002)(136003)(39850400004)(346002)(396003)(230922051799003)(64100799003)(186009)(1800799009)(451199024)(82310400011)(36840700001)(46966006)(356005)(82740400003)(36756003)(47076005)(26005)(426003)(336012)(83380400001)(2616005)(81166007)(1076003)(86362001)(36860700001)(30864003)(478600001)(2906002)(7696005)(40480700001)(41300700001)(316002)(54906003)(6916009)(5660300002)(70206006)(70586007)(6666004)(4326008)(8676002)(8936002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB10138 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 1dff27b0-b185-46af-e399-08dbcfeb81ef X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hGxiciXgOczL0TisK7bzxv6ovJvD5xHN28kVnKpvdDMBO7bh4vZpNQ/bMwCE2NnkVZJRZZcJchMIVyH+0U5yFY1ybLNCfDrg281IdAX/pSeA659AWVJf33OqE5hhLrNgc7z+pW5GjKsCr+BDtNckOyDZVYPJtaXPx9pbfrLl6ahn6sy/78AWOexYQd5+WBvx5uTE5x6kEEq14PHTyVfPUIShcUxY0feoW4B31b0tL7CjaYKYcH4lAT0f1AUs1ghkgCgjvB98bQbI0FThIsvBcjv7Uk9f0LELGNaVFIm5Wkb7V+T2F/7YLbsa/E9RTk/8vWrJlloFNuGwVMgTtNG3Btffrtj+sXE4xnwfYlkICShRtG+7Ja7kZfJD2r46Bf08zFy6vp0YRm5FjbqUzm5+NIZdsB0DblklhY9k8w/ZumaoPeKr9xKtTb61M45ZdC1xJER9ZndC8gldh/pECAXZFFxtNZE/N0UA0FJ6zBT8m6RKmlD4ymyjBVQQ6so0wZqH593DjJzRto+wux7eI1J8riP3iZsv5QEB/Nxo5P/HKXcaa/DnafnoZedYMQyL4JC6VCpyvfdnked9UBOK9Kdqc7iUooy96y8P1duf7LveAHU5SO9byHTEmy0eC3Z3CyyLJ1MorziCvxCyTwcY2fhQVGL8ZuVB4cR0uq0dg1zYrLqpVrhZBrSsf81n0wvZAdGrKvQnnnpcMs1gFhdWPWnsJFeHCWw1sEETxdE/Z0+Ma0HnMudRZRi8Sb6ucqAxi8+Y 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)(376002)(396003)(346002)(136003)(39860400002)(230922051799003)(451199024)(64100799003)(186009)(1800799009)(82310400011)(40470700004)(46966006)(36840700001)(316002)(40480700001)(40460700003)(6666004)(478600001)(70586007)(47076005)(70206006)(6916009)(54906003)(2616005)(36860700001)(83380400001)(86362001)(82740400003)(81166007)(7696005)(336012)(426003)(1076003)(26005)(41300700001)(30864003)(8936002)(4326008)(5660300002)(36756003)(8676002)(2906002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2023 15:04:28.6362 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 664af4f1-895c-446e-9d45-08dbcfeb86a8 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: DBAEUR03FT055.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB10436 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.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: 1780106159898796086 X-GMAIL-MSGID: 1780106159898796086 Implement the aarch64 intrinsics for reading and writing system registers with the following signatures: uint32_t __arm_rsr(const char *special_register); uint64_t __arm_rsr64(const char *special_register); void* __arm_rsrp(const char *special_register); float __arm_rsrf(const char *special_register); double __arm_rsrf64(const char *special_register); void __arm_wsr(const char *special_register, uint32_t value); void __arm_wsr64(const char *special_register, uint64_t value); void __arm_wsrp(const char *special_register, const void *value); void __arm_wsrf(const char *special_register, float value); void __arm_wsrf64(const char *special_register, double value); gcc/ChangeLog: * gcc/config/aarch64/aarch64-builtins.cc (enum aarch64_builtins): Add enums for new builtins. (aarch64_init_rwsr_builtins): New. (aarch64_general_init_builtins): Call aarch64_init_rwsr_builtins. (aarch64_expand_rwsr_builtin): New. (aarch64_general_expand_builtin): Call aarch64_general_expand_builtin. * gcc/config/aarch64/aarch64.md (read_sysregdi): New insn_and_split. (write_sysregdi): Likewise. * gcc/config/aarch64/arm_acle.h (__arm_rsr): New. (__arm_rsrp): Likewise. (__arm_rsr64): Likewise. (__arm_rsrf): Likewise. (__arm_rsrf64): Likewise. (__arm_wsr): Likewise. (__arm_wsrp): Likewise. (__arm_wsr64): Likewise. (__arm_wsrf): Likewise. (__arm_wsrf64): Likewise. gcc/testsuite/ChangeLog: * gcc/testsuite/gcc.target/aarch64/acle/rwsr.c: New. * gcc/testsuite/gcc.target/aarch64/acle/rwsr-1.c: Likewise. --- gcc/config/aarch64/aarch64-builtins.cc | 200 ++++++++++++++++++ gcc/config/aarch64/aarch64.md | 17 ++ gcc/config/aarch64/arm_acle.h | 30 +++ .../gcc.target/aarch64/acle/rwsr-1.c | 20 ++ gcc/testsuite/gcc.target/aarch64/acle/rwsr.c | 144 +++++++++++++ 5 files changed, 411 insertions(+) create mode 100644 gcc/testsuite/gcc.target/aarch64/acle/rwsr-1.c create mode 100644 gcc/testsuite/gcc.target/aarch64/acle/rwsr.c diff --git a/gcc/config/aarch64/aarch64-builtins.cc b/gcc/config/aarch64/aarch64-builtins.cc index 04f59fd9a54..d8bb2a989a5 100644 --- a/gcc/config/aarch64/aarch64-builtins.cc +++ b/gcc/config/aarch64/aarch64-builtins.cc @@ -808,6 +808,17 @@ enum aarch64_builtins AARCH64_RBIT, AARCH64_RBITL, AARCH64_RBITLL, + /* System register builtins. */ + AARCH64_RSR, + AARCH64_RSRP, + AARCH64_RSR64, + AARCH64_RSRF, + AARCH64_RSRF64, + AARCH64_WSR, + AARCH64_WSRP, + AARCH64_WSR64, + AARCH64_WSRF, + AARCH64_WSRF64, AARCH64_BUILTIN_MAX }; @@ -1798,6 +1809,65 @@ aarch64_init_rng_builtins (void) AARCH64_BUILTIN_RNG_RNDRRS); } +/* Add builtins for reading system register. */ +static void +aarch64_init_rwsr_builtins (void) +{ + tree fntype = NULL; + tree const_char_ptr_type + = build_pointer_type (build_type_variant (char_type_node, true, false)); + +#define AARCH64_INIT_RWSR_BUILTINS_DECL(F, N, T) \ + aarch64_builtin_decls[AARCH64_##F] \ + = aarch64_general_add_builtin ("__builtin_aarch64_"#N, T, AARCH64_##F); + + fntype + = build_function_type_list (uint32_type_node, const_char_ptr_type, NULL); + AARCH64_INIT_RWSR_BUILTINS_DECL (RSR, rsr, fntype); + + fntype + = build_function_type_list (ptr_type_node, const_char_ptr_type, NULL); + AARCH64_INIT_RWSR_BUILTINS_DECL (RSRP, rsrp, fntype); + + fntype + = build_function_type_list (uint64_type_node, const_char_ptr_type, NULL); + AARCH64_INIT_RWSR_BUILTINS_DECL (RSR64, rsr64, fntype); + + fntype + = build_function_type_list (float_type_node, const_char_ptr_type, NULL); + AARCH64_INIT_RWSR_BUILTINS_DECL (RSRF, rsrf, fntype); + + fntype + = build_function_type_list (double_type_node, const_char_ptr_type, NULL); + AARCH64_INIT_RWSR_BUILTINS_DECL (RSRF64, rsrf64, fntype); + + fntype + = build_function_type_list (void_type_node, const_char_ptr_type, + uint32_type_node, NULL); + + AARCH64_INIT_RWSR_BUILTINS_DECL (WSR, wsr, fntype); + + fntype + = build_function_type_list (void_type_node, const_char_ptr_type, + const_ptr_type_node, NULL); + AARCH64_INIT_RWSR_BUILTINS_DECL (WSRP, wsrp, fntype); + + fntype + = build_function_type_list (void_type_node, const_char_ptr_type, + uint64_type_node, NULL); + AARCH64_INIT_RWSR_BUILTINS_DECL (WSR64, wsr64, fntype); + + fntype + = build_function_type_list (void_type_node, const_char_ptr_type, + float_type_node, NULL); + AARCH64_INIT_RWSR_BUILTINS_DECL (WSRF, wsrf, fntype); + + fntype + = build_function_type_list (void_type_node, const_char_ptr_type, + double_type_node, NULL); + AARCH64_INIT_RWSR_BUILTINS_DECL (WSRF64, wsrf64, fntype); +} + /* Initialize the memory tagging extension (MTE) builtins. */ struct { @@ -2019,6 +2089,8 @@ aarch64_general_init_builtins (void) aarch64_init_rng_builtins (); aarch64_init_data_intrinsics (); + aarch64_init_rwsr_builtins (); + tree ftype_jcvt = build_function_type_list (intSI_type_node, double_type_node, NULL); aarch64_builtin_decls[AARCH64_JSCVT] @@ -2599,6 +2671,123 @@ aarch64_expand_rng_builtin (tree exp, rtx target, int fcode, int ignore) return target; } +/* Expand the read/write system register builtin EXPs. */ +rtx +aarch64_expand_rwsr_builtin (tree exp, rtx target, int fcode) +{ + tree arg0, arg1; + rtx const_str, input_val, subreg; + enum machine_mode mode; + class expand_operand ops[2]; + + arg0 = CALL_EXPR_ARG (exp, 0); + + bool write_op = (fcode == AARCH64_WSR + || fcode == AARCH64_WSRP + || fcode == AARCH64_WSR64 + || fcode == AARCH64_WSRF + || fcode == AARCH64_WSRF64); + bool read_op = (fcode == AARCH64_RSR + || fcode == AARCH64_RSRP + || fcode == AARCH64_RSR64 + || fcode == AARCH64_RSRF + || fcode == AARCH64_RSRF64); + + /* Argument 0 (system register name) must be a string literal. */ + gcc_assert (!SSA_VAR_P (arg0) + && TREE_CODE (TREE_TYPE (arg0)) == POINTER_TYPE + && TREE_CODE (TREE_OPERAND (arg0,0)) == STRING_CST); + + const char *name_input = TREE_STRING_POINTER (TREE_OPERAND (arg0, 0)); + size_t len = strlen (name_input); + + if (len == 0) + { + error_at (EXPR_LOCATION (exp), "invalid system register name provided"); + return const0_rtx; + } + + char *sysreg_name = (char *) alloca (len + 1); + strcpy (sysreg_name, name_input); + + for (unsigned pos = 0; pos <= len; pos++) + sysreg_name[pos] = TOLOWER (sysreg_name[pos]); + + const char* name_output = aarch64_retrieve_sysreg (sysreg_name, write_op); + if (name_output == NULL) + { + error_at (EXPR_LOCATION (exp), "invalid system register name provided"); + return const0_rtx; + } + + /* Assign the string corresponding to the system register name to an RTX. */ + const_str = rtx_alloc (CONST_STRING); + PUT_CODE (const_str, CONST_STRING); + XSTR (const_str, 0) = xstrdup (name_output); + + /* Set up expander operands and call instruction expansion. */ + if (read_op) + { + + /* Emit the initial read_sysregdi rtx. */ + create_output_operand (&ops[0], target, DImode); + create_fixed_operand (&ops[1], const_str); + expand_insn (CODE_FOR_aarch64_read_sysregdi, 2, ops); + target = ops[0].value; + + /* Do any necessary post-processing on the result. */ + switch (fcode) + { + case AARCH64_RSR: + return gen_lowpart_SUBREG (SImode, target); + case AARCH64_RSRP: + case AARCH64_RSR64: + return target; + case AARCH64_RSRF: + subreg = gen_reg_rtx (SImode); + subreg = gen_lowpart_SUBREG (SImode, target); + return gen_lowpart_SUBREG (SFmode, subreg); + case AARCH64_RSRF64: + return gen_lowpart_SUBREG (DFmode, target); + } + } + if (write_op) + { + + arg1 = CALL_EXPR_ARG (exp, 1); + mode = TYPE_MODE (TREE_TYPE (arg1)); + input_val = copy_to_mode_reg (mode, expand_normal (arg1)); + + switch (fcode) + { + case AARCH64_WSR: + subreg = gen_lowpart_SUBREG (DImode, input_val); + break; + case AARCH64_WSRP: + case AARCH64_WSR64: + subreg = input_val; + break; + case AARCH64_WSRF: + subreg = gen_lowpart_SUBREG (SImode, input_val); + subreg = gen_lowpart_SUBREG (DImode, subreg); + break; + case AARCH64_WSRF64: + subreg = gen_lowpart_SUBREG (DImode, input_val); + break; + } + + create_fixed_operand (&ops[0], const_str); + create_input_operand (&ops[1], subreg, DImode); + expand_insn (CODE_FOR_aarch64_write_sysregdi, 2, ops); + + return target; + } + + error_at (EXPR_LOCATION (exp), + "Malformed call to read/write system register builtin"); + return target; +} + /* Expand an expression EXP that calls a MEMTAG built-in FCODE with result going to TARGET. */ static rtx @@ -2832,6 +3021,17 @@ 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_RSR: + case AARCH64_RSRP: + case AARCH64_RSR64: + case AARCH64_RSRF: + case AARCH64_RSRF64: + case AARCH64_WSR: + case AARCH64_WSRP: + case AARCH64_WSR64: + case AARCH64_WSRF: + case AARCH64_WSRF64: + return aarch64_expand_rwsr_builtin (exp, target, fcode); } 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 32c7adc8928..80da30bc30c 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -281,6 +281,8 @@ UNSPEC_UPDATE_FFRT UNSPEC_RDFFR UNSPEC_WRFFR + UNSPEC_SYSREG_RDI + UNSPEC_SYSREG_WDI ;; Represents an SVE-style lane index, in which the indexing applies ;; within the containing 128-bit block. UNSPEC_SVE_LANE_SELECT @@ -476,6 +478,21 @@ ;; Jumps and other miscellaneous insns ;; ------------------------------------------------------------------- +(define_insn "aarch64_read_sysregdi" + [(set (match_operand:DI 0 "register_operand" "=r") + (unspec_volatile:DI [(match_operand 1 "aarch64_sysreg_string" "")] + UNSPEC_SYSREG_RDI))] + "" + "mrs\t%x0, %1" + ) + +(define_insn "aarch64_write_sysregdi" + [(unspec_volatile:DI [(match_operand 0 "aarch64_sysreg_string" "") + (match_operand:DI 1 "register_operand" "r")] UNSPEC_SYSREG_WDI)] + "" + "msr\t%0, %x1" + ) + (define_insn "indirect_jump" [(set (pc) (match_operand:DI 0 "register_operand" "r"))] "" diff --git a/gcc/config/aarch64/arm_acle.h b/gcc/config/aarch64/arm_acle.h index 7599a32301d..71ada878299 100644 --- a/gcc/config/aarch64/arm_acle.h +++ b/gcc/config/aarch64/arm_acle.h @@ -314,6 +314,36 @@ __rndrrs (uint64_t *__res) #pragma GCC pop_options +#define __arm_rsr(__regname) \ + __builtin_aarch64_rsr (__regname) + +#define __arm_rsrp(__regname) \ + __builtin_aarch64_rsrp (__regname) + +#define __arm_rsr64(__regname) \ + __builtin_aarch64_rsr64 (__regname) + +#define __arm_rsrf(__regname) \ + __builtin_aarch64_rsrf (__regname) + +#define __arm_rsrf64(__regname) \ + __builtin_aarch64_rsrf64 (__regname) + +#define __arm_wsr(__regname, __value) \ + __builtin_aarch64_wsr (__regname, __value) + +#define __arm_wsrp(__regname, __value) \ + __builtin_aarch64_wsrp (__regname, __value) + +#define __arm_wsr64(__regname, __value) \ + __builtin_aarch64_wsr64 (__regname, __value) + +#define __arm_wsrf(__regname, __value) \ + __builtin_aarch64_wsrf (__regname, __value) + +#define __arm_wsrf64(__regname, __value) \ + __builtin_aarch64_wsrf64 (__regname, __value) + #ifdef __cplusplus } #endif diff --git a/gcc/testsuite/gcc.target/aarch64/acle/rwsr-1.c b/gcc/testsuite/gcc.target/aarch64/acle/rwsr-1.c new file mode 100644 index 00000000000..bc9db098f16 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/acle/rwsr-1.c @@ -0,0 +1,20 @@ +/* Test the __arm_[r,w]sr ACLE intrinsics family. */ +/* Ensure that illegal behavior is rejected by the compiler. */ + +/* { dg-do compile } */ +/* { dg-options "-O3 -march=armv8.4-a" } */ + +#include + +/* Ensure that read/write-only register attributes are respected by the compiler. */ +void +test_rwsr_read_write_only () +{ + /* Attempt to write to read-only registers. */ + long long a = __arm_rsr64 ("aidr_el1"); /* Read ok. */ + __arm_wsr64 ("aidr_el1", a); /* { dg-error {invalid system register name provided} } */ + + /* Attempt to read from write-only registers. */ + __arm_wsr64("icc_asgi1r_el1", a); /* Write ok. */ + long long b = __arm_rsr64("icc_asgi1r_el1"); /* { dg-error {invalid system register name provided} } */ +} diff --git a/gcc/testsuite/gcc.target/aarch64/acle/rwsr.c b/gcc/testsuite/gcc.target/aarch64/acle/rwsr.c new file mode 100644 index 00000000000..3af4b960306 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/acle/rwsr.c @@ -0,0 +1,144 @@ +/* Test the __arm_[r,w]sr ACLE intrinsics family. */ +/* Check that function variants for different data types handle types correctly. */ +/* { dg-do compile } */ +/* { dg-options "-O1 -march=armv8.4-a" } */ +/* { dg-final { check-function-bodies "**" "" } } */ + +#include + +/* +** get_rsr: +** ... +** mrs x([0-9]+), s2_1_c0_c7_4 +** add w\1, w\1, 1 +** ... +*/ +int +get_rsr () +{ + int a = __arm_rsr("trcseqstr"); + return a+1; +} + +/* +** get_rsrf: +** mrs x([0-9]+), s2_1_c0_c7_4 +** fmov s[0-9]+, w\1 +** ... +*/ +float +get_rsrf () +{ + return __arm_rsrf("trcseqstr"); +} + +/* +** get_rsrp: +** mrs x0, s2_1_c0_c7_4 +** ret +*/ +void * +get_rsrp () +{ + return __arm_rsrp("trcseqstr"); +} + +/* +** get_rsr64: +** mrs x0, s2_1_c0_c7_4 +** ret +*/ +long long +get_rsr64 () +{ + return __arm_rsr64("trcseqstr"); +} + +/* +** get_rsrf64: +** mrs x([0-9]+), s2_1_c0_c7_4 +** fmov d[0-9]+, x\1 +** ... +*/ +double +get_rsrf64 () +{ + return __arm_rsrf64("trcseqstr"); +} + +/* +** set_wsr32: +** ... +** add w([0-9]+), w\1, 1 +** msr s2_1_c0_c7_4, x\1 +** ... +*/ +void +set_wsr32 (int a) +{ + __arm_wsr("trcseqstr", a+1); +} + +/* +** set_wsrp: +** ... +** msr s2_1_c0_c7_4, x[0-9]+ +** ... +*/ +void +set_wsrp (void *a) +{ + __arm_wsrp("trcseqstr", a); +} + +/* +** set_wsr64: +** ... +** msr s2_1_c0_c7_4, x[0-9]+ +** ... +*/ +void +set_wsr64 (long long a) +{ + __arm_wsr64("trcseqstr", a); +} + +/* +** set_wsrf32: +** ... +** fmov w([0-9]+), s[0-9]+ +** msr s2_1_c0_c7_4, x\1 +** ... +*/ +void +set_wsrf32 (float a) +{ + __arm_wsrf("trcseqstr", a); +} + +/* +** set_wsrf64: +** ... +** fmov x([0-9]+), d[0-9]+ +** msr s2_1_c0_c7_4, x\1 +** ... +*/ +void +set_wsrf64(double a) +{ + __arm_wsrf64("trcseqstr", a); +} + +/* +** set_custom: +** ... +** mrs x0, s1_2_c3_c4_5 +** ... +** msr s1_2_c3_c4_5, x0 +** ... +*/ +void set_custom() +{ + __uint64_t b = __arm_rsr64("S1_2_C3_C4_5"); + __arm_wsr64("S1_2_C3_C4_5", b); +}