From patchwork Thu Jul 11 12:15:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Carlotti X-Patchwork-Id: 1959303 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=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=imr1pRog; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=imr1pRog; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4WKYfS05r2z1xpd for ; Thu, 11 Jul 2024 22:18:24 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4000B386C5A8 for ; Thu, 11 Jul 2024 12:18:22 +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-vi1eur02on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:2607::601]) by sourceware.org (Postfix) with ESMTPS id B0DFE383E514 for ; Thu, 11 Jul 2024 12:16:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B0DFE383E514 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 B0DFE383E514 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:2607::601 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1720700178; cv=pass; b=wAtlE1DRg+B6e5KM3OM4ZZy4z1AQXYdRHkuQjyx4L9WK5Zpd5At14TqhF8TAQkJhHiRpZsfrhHs5KDvKqvhCjZvQjo0mP3FYvNr+WKh8XQjGl3C9efpMHk5IgRVYOSMd16HiKijRYyMwbJ/258jAJmzAw4kkVvj3qUaAMv1+Sbk= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1720700178; c=relaxed/simple; bh=fuMcgXAZxoT5kT/w9OH4/7fDTqcPibGPsOTUAg07YWI=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=MHg4VREpPbw97If3wk5V5kU+5nknchkzURZPkdWDLk/2GBnpyYUNtI6lHDrkJ/zqNvHE9Me7eQ6egD9WWu9SKJf92djiE1TeCmQhXDmThxPNlpEO4Z5VzNBty1crY8uS/kSnYhwPUsO4AeInqCBaQsMRHP5ljZpM5v0OTyzZJ/I= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=Ey8e9+5ozgUIiXOKU0hO9fxqVip3rHQio3ZWDuITWCSLgHOexU/yqZcYBJeq2Acq1XOIUP7jOEpy6xjToy79xK5F6NhuccTTzdjg4T3rPzK4P7rUf+ot3F0//teWrrw5Ziea35I3csSXVs/Ki9o2SXaZXBK++IltghgWwhKbkqdl8ixJ/487DAclTq6isglhm0L8rLZg351Dvq2S9Dvrh/lopoFgRBNG9Auyjn8sTS+dAmvPCOd3fraD7VK1LZbXq2hogG/0Yp//4JwRiiBRfJYDjHwXxJK5Re+KqLR/KUiUSmxp7eeRoxBdXFOgudGG9f9VBeXiqy3T3boaRZlUlw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=CxZ6SZycRhIpApqkZ3b9S7jA0qAVz+S5YUeMDnT3wJs=; b=DrV14bncg7LcQQAgLscA2MhBMpjWUoEQ//GG0I7HoYQWIlnkULmIl0YvjlRPbIxDfm7EriJ3e3tCymoNH6q3HMxzP1Xzn2fzIsfI25HC0w0qJR8B3dMCEpnafvHKIg6j1Fy5+lWn+NWTgnWbJJQnS3T/P4Bx9humbsWyD02okEnpYzYZFJw1hRdnARO71tJ4soggY6ukJZ5MnTh61ocNyhgD7mKWrTxcdd96NRBfBSt/vt/+pEVBk8A/AxL8GJ15qZhYyZBuPhpsKF8nC4Yxb5LUHM5FGO0iWdwKCChs1IMdH2RSjkmOPyDJirboXbBcoFUhP6Jh3ey0qdDreHPI6A== 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=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CxZ6SZycRhIpApqkZ3b9S7jA0qAVz+S5YUeMDnT3wJs=; b=imr1pRogypFaCbgET6jMqyqrTvsMx8gKmWDUBPT93DWqZDeAuik2Ho3a5+BD4Bo4XOZPSB02v3I4HzPULkqamtLs3FHzMLUz4KuHFH4O/zV60zHNxWnkS3T+mGzRu1IPuh0t7JI5XZ7agWrFbOKj6f2Q82vtKIfZ1K0nO1JN8Bo= Received: from DB8PR03CA0012.eurprd03.prod.outlook.com (2603:10a6:10:be::25) by AM8PR08MB5746.eurprd08.prod.outlook.com (2603:10a6:20b:1d8::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.20; Thu, 11 Jul 2024 12:16:10 +0000 Received: from DU2PEPF00028D02.eurprd03.prod.outlook.com (2603:10a6:10:be:cafe::9e) by DB8PR03CA0012.outlook.office365.com (2603:10a6:10:be::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.22 via Frontend Transport; Thu, 11 Jul 2024 12:16:10 +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=arm.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 DU2PEPF00028D02.mail.protection.outlook.com (10.167.242.186) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Thu, 11 Jul 2024 12:16:10 +0000 Received: ("Tessian outbound 69dff5ccb08e:v359"); Thu, 11 Jul 2024 12:16:09 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: dd0dae25dbace7b3 X-CR-MTA-TID: 64aa7808 Received: from 08544a02dd80.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E18DFA5C-141E-4366-B1C6-8BC75F862A1E.1; Thu, 11 Jul 2024 12:16:03 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 08544a02dd80.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 11 Jul 2024 12:16:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vobIgiAalhlmbpeXRFTJr4IK4AauiOTcu5+oXlf5f3OwjEWIpOcaDh8UrVQ3zxDDLolsCCv2xqKJ1T25sCK5D3fv2QbaKsAj9OA2pbqu3fFlpJUBFP/yqe/Ag1o/UZ3P7kDq6iAJzxiF3xhqMzrnP5v4Qda/g49wOJGC23hmoKsbAi5345j/X8X/Es1litUY6vBxrqNcD/cY7ChAKvjg3u7omCG2C7ap1DUdtLZpuMWx1SV0DKOaFO599SthmnUXfPtGE7lxYqYo9vVlQbfaWS9Clo3I/sbxxG7mBcuWcNnbPvbpfA5oXsffJFCBeG6GbgqccJrQa6i3VV5xhdlxjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=CxZ6SZycRhIpApqkZ3b9S7jA0qAVz+S5YUeMDnT3wJs=; b=mAIi7zZ3nbbAbBckq6K7Ipvibsq0tTycaXHUF1D5nc9rvdMMzbyUsM+Z1j1y8uTICveg31RktDa6ApcattixYJI8RacDXoZZksMimKx1Ywd7JyppDzOGOwo6DLYQvl5mywLVxBJJF0FiaaMCfcgdmUC6zkMjtKXGTFw3i2fbKG5gKemnGCIdgY2xYVc5Ddw8Psa0+SGy5VMtf2Og3DVzogCRWgm1K95u+61L+I8op9+yHuCKHjTspmqKP3z2vrC/PIkEH7fxMV66JeeMscZmNsAWTQEIDl6mXqXUXh1nYR+hKNTFvl33TaL3ArU6NsrkGLBith8xmjenybOyHwfg3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CxZ6SZycRhIpApqkZ3b9S7jA0qAVz+S5YUeMDnT3wJs=; b=imr1pRogypFaCbgET6jMqyqrTvsMx8gKmWDUBPT93DWqZDeAuik2Ho3a5+BD4Bo4XOZPSB02v3I4HzPULkqamtLs3FHzMLUz4KuHFH4O/zV60zHNxWnkS3T+mGzRu1IPuh0t7JI5XZ7agWrFbOKj6f2Q82vtKIfZ1K0nO1JN8Bo= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) by AS2PR08MB10321.eurprd08.prod.outlook.com (2603:10a6:20b:5e4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.36; Thu, 11 Jul 2024 12:16:01 +0000 Received: from AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::3b48:ae45:5b79:cc29]) by AS8PR08MB6678.eurprd08.prod.outlook.com ([fe80::3b48:ae45:5b79:cc29%3]) with mapi id 15.20.7762.016; Thu, 11 Jul 2024 12:16:01 +0000 Date: Thu, 11 Jul 2024 13:15:57 +0100 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Cc: Richard Biener , Richard Sandiford , Jeff Law Subject: [PATCH v2 10/11] Add new bbitmap class Message-ID: References: Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO4P123CA0666.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:316::17) To AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6678:EE_|AS2PR08MB10321:EE_|DU2PEPF00028D02:EE_|AM8PR08MB5746:EE_ X-MS-Office365-Filtering-Correlation-Id: 3872b897-8ac3-47e6-ae62-08dca1a33fe6 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info-Original: OvZn/G2myy6JLpWuSF4cCtO4bqDDIlYzJY0T1c1u/WImWY+dZAkA4BcR+wzl4j6iBrws7co6TnUygzHTpH8WxiAF87CiUdQ6EkBFJhE+MfqLLKjjxZw0Y6izUHMk0/Idtxvgnuowvo3nR7V+PmQ9hIDtN9cnuh2tLvV+sH77AK6ea3+WeU+nQ6bwHQbAnyswqu5UXTg3uvhhiqxxHVviqkxC0pLfgOcoI9gPFvULrjLF2aS8yhUzYatnyYV+duCRjErNeDRIKvtvmY0twv7fWa7gHuR7JF6808mgyEeIAoh/34V38cPR6Ss4NuF6EauRahWH4f6PkOEEA0LmZTasZtmP1G/BA9h6b7Tl0hxdlJL5t07EqnSgv4pVuq4DFwxyhsdVu2AWHHxD4afaxFfozUwPW4EWMXenWM04vXEpU6mZRYBR4sOSQAK50KPCybHpysmkrQqGRpnhX74a0R7t0Slpi2eRD/dRsi6Mfw7SvYAlBIMPS4AY2XmUwFgbTKtXwB+lttj0DyYBv9qJy++98abQj5vpB9BhHH1ZSGgq/W7rm/xz3Cp3q9h7dQM7Izpc5VuLT6po6nGbjtSqyiomRQ6CubQNGuT09Q1S2OrL11uYGvPbbp+sAKqwi/hfIRi1YOlGX5B0mqTnpQhbtpBDQFMb8K/EZ5OlN94qK1NvuFcDidGFEOnboqKff/Ce2IJDtURk7Bj+0phRqCuAQVmjFPcEYTp4ZvKj6IIXMCvc9zMfJj8OqvZ9u/sSZzmiDKsae9ljggqi4PwOERIOuKUQ2mOEWsmRfUnchp6HPgxXF2heLFG6nW2/Ef1VRAUPB1YEWL1RnKB5+sntyqjyTDpI/+SH4BgbrtLs6Nok4ot++W/QOfyKICPQn7tFxYOB1lHIfs3JXSPI7CDH5pixtSiW5d2sz1wkVTZ+FCtb5E0YOhn4NPzD66KIl6CEdMzgH8zNhTwwzT3aLNrNAPSH30t64G354BEKRtE1M9apcoOiiVPcL0ZUdJpGuZapZ/GF7krgjIuwRsv6kSKUwc2hx2okFOdpKOt05wepKm48ohWN8FWkqWNS+fckVgTKG9kYXe/eUQNmMYAeKNJYC8uo2Occr12OGWNDTe8/anU9dHkB/DD9za/c59fuh4LL+ScQwxkzldq6BBaklzdwuW9nl8jiGls5m7RkQVYeOApA370s9MQBgHiq57BaqOMNkrQ9UlfA94keKdw5LBqbbsNXYYW1RS2M398cbp3paJr1dCSfYiuqpTStfXYrizfsNGj1fc7VohDjdPivo/zXDLMPhqJ7HmZpcQPhYJQZQ8GFYfMTJyQ= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB6678.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10321 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU2PEPF00028D02.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 432262fe-a728-4a9e-bb40-08dca1a33a50 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|1800799024|376014|35042699022; X-Microsoft-Antispam-Message-Info: br68LCepdGEMIdCznvK8hwM91j/1QVL/3ga9S7iR4GO/kNHSGO0rkFx3oU+JxtbCDAOdyRZjMa6eSGRmuF+YQ9KBvHmCKSK7vM+5bCEpe2vtB2TX3pDwiFZej0HeE1MqaRr8udYc+yt4GUi7MHnB6JwnvQ4zwvxVVT1e+T+N2Lzq0lCo6HFUECuntUG/2QfL5JWOLfcAxwCUOHYqZRBybMT/J3jsSY1uWxkjteHFEGY+gkA9rlkPh3p/1JCg8sLiB16hvyW9IsFWXXs041ssiA16keF8NSe8YGtIoGTwJIzzjCMyRerfbbtEW6PKi7yk2jedYsxRYufvbdXOk4+QoTqbby8n3VBlb5dL910o5dWTegETb1k5SSXvS773i2siosWDKM4s11T9JM+DUFWeTwfnpfcI+rWn3TK9xOpLgdmlyOnqXI5t6bw7sbof/q6aIl2KD7i/kwLSgS3tj1/3WbRdOKHndDTMUi+zHn+nNSGTrrQQfqmjGs8qfFjURO0OjapgJA0k9u4hJBoBXi2dkechp/ZEPmKr44sxgngtYdKxSx7hGOUXZj+c70I02aOeLddZ3kl2WLzgQk7FnTVqg49dNdsOLX/XmbhVp11KXhG16U6BzlY278po81N/RrEzJBb5MxIXQhFsFPcDF/9oqWNkCLk4BAyd+9yO2qix1MEhMZCUMssIipcNfkOqoA6lIpI0LcZvPa5821TXBdsFAar7o3M1KoztCZ6xvBmJr8FVvN4nwBGtHqngNYKXOn/gMDV1ZP0/48qVMQzJbtgLQzGKNsPT8Ue/frus6KQH4CFLnpMDldW/EswKag9Pm+GCty7vKLiYqzNdvIkCBB4dyRFaFSclSrygee+ytA+DRbfl2vTpWl8wJsPRbKPB5ZZBrbijuFGZuEN9jMTny9xyS1X/JBxGVekULM9/NvSwwbiY/e1bpUxCDPNdxJNJad7lm+R/w5ppM54tF5QWe52AiqUGtBddzPh/InEBQUFoc8sUM1vyvRQc2VedDevwLmzoGRZsQak4WoaCkV6R2co5V3DJhr9KbhKCXHgiYjYp7YkhEkW+YloBVsLLVv3ekMmaSiRdGgYqhumOeRMR769j7dCFd4RSgq80/1/nxs508ZVpjPt0gakga/+wIDeJ/3Osldnn9CW1yYQl3g2qBxPVYskpP2JHnOgkMqf4UfCOh8WnmGq6RazaO63Hl9zQz4OuO2VDKH8lG5mgEMi6aZPT3dLogGe+qjJaAJXsw9OiQG+oy+gzUleizQOptjShHQLFwESSCpxyCtdOFWjzQifkcuEDIImKEqi0OZWG5JUVQ2lLADEEVbt6fgoWbpB0dHpWnmJm/biCG9F+1GzusDQ/Qvw/mQB04mnI57WE4eR/fgrF10vkL42wPywnlCIMzxVpw21sIJzNxN0jaQtZwHR2lg== 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:(13230040)(82310400026)(36860700013)(1800799024)(376014)(35042699022); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2024 12:16:10.3435 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3872b897-8ac3-47e6-ae62-08dca1a33fe6 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: DU2PEPF00028D02.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5746 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, 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~incoming=patchwork.ozlabs.org@gcc.gnu.org This class provides a constant-size bitmap that can be used as almost a drop-in replacement for bitmaps stored in integer types. The implementation is entirely within the header file and uses recursive templated operations to support effective optimisation and usage in constexpr expressions. This initial implementation hardcodes the choice of uint64_t elements for storage and initialisation, but this could instead be specified via a second template parameter. gcc/ChangeLog: * bbitmap.h: New file. diff --git a/gcc/bbitmap.h b/gcc/bbitmap.h new file mode 100644 index 0000000000000000000000000000000000000000..108ac1bf9e6042f5ae16988bc1688fe0045a3293 --- /dev/null +++ b/gcc/bbitmap.h @@ -0,0 +1,238 @@ +/* Functions to support fixed-length bitmaps. + Copyright (C) 2024 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ + +#ifndef GCC_BBITMAP_H +#define GCC_BBITMAP_H + +/* Implementation of bounded (fixed length) bitmaps. + + This provides a drop-in replacement for bitmaps that have outgrown the + storage capacity of a single integer. + + Sets are stored as a fixed length array of uint64_t elements. The length of + this array is given as a template parameter. */ + +template +struct bbitmap_operators +{ + template + static constexpr Result binary(Operator op, const Arg &x, const Arg &y, + Rest ...rest) + { + return bbitmap_operators::template binary + (op, x, y, op (x.val[M - 1], y.val[M - 1]), rest...); + } + + template + static void compound(Operator op, Arg &x, const Arg &y) + { + bbitmap_operators::template compound (op, x, y); + x.val[M - 1] = op (x.val[M - 1], y.val[M - 1]); + } + + template + static constexpr Result bit_not(const Arg &x, Rest ...rest) + { + return bbitmap_operators::template bit_not + (x, ~(x.val[M - 1]), rest...); + } + + template + static constexpr bool non_zero(const Arg &x) + { + return (bool) x.val[M - 1] + || bbitmap_operators::template non_zero (x); + } + + template + static constexpr bool equal(const Arg &x, const Arg &y) + { + return x.val[M - 1] == y.val[M - 1] + && bbitmap_operators::template equal (x, y); + } + +#define SUB_INDEX(i) (i - (M - 1) * 64) +#define IN_SUB_RANGE(i) (SUB_INDEX (i) >= 0 && SUB_INDEX (i) < 64) + + template + static constexpr Result from_index(int index, Rest ...rest) + { + return bbitmap_operators::template from_index + (index, + (IN_SUB_RANGE (index) + ? (uint64_t (1) << (IN_SUB_RANGE (index) ? SUB_INDEX (index) : 0)) + : uint64_t (0)), + rest...); + } + +#undef IN_SUB_RANGE +#undef SUB_INDEX + +}; + +template<> +struct bbitmap_operators<0> +{ + template + static constexpr Result binary(Operator, const Arg, const Arg, + Rest ...rest) + { + return Result { rest... }; + } + + template + static void compound(Operator, Arg, const Arg) + { + return; + } + + template + static constexpr Result bit_not(const Arg, Rest ...rest) + { + return Result { rest... }; + } + + template + static constexpr bool non_zero(const Arg) + { + return false; + } + + template + static constexpr bool equal(const Arg, const Arg) + { + return true; + } + + template + static constexpr Result from_index(int, Rest ...rest) + { + return Result { rest... }; + } +}; + +template +constexpr T bbitmap_element_or(T x, T y) { return x | y;} + +template +constexpr T bbitmap_element_and(T x, T y) { return x & y;} + +template +constexpr T bbitmap_element_xor(T x, T y) { return x ^ y;} + + + +template +class GTY((user)) bbitmap +{ +public: + uint64_t val[N]; + + template + constexpr bbitmap(Rest ...rest) : val{(uint64_t) rest...} {} + + constexpr bbitmap operator|(const bbitmap other) const + { + return bbitmap_operators::template binary>(bbitmap_element_or, + *this, other); + } + + bbitmap operator|=(const bbitmap other) + { + bbitmap_operators::template compound (bbitmap_element_or, + *this, other); + return this; + } + + constexpr bbitmap operator&(const bbitmap other) const + { + return bbitmap_operators::template binary>(bbitmap_element_and, + *this, other); + } + + bbitmap operator&=(const bbitmap other) + { + bbitmap_operators::template compound (bbitmap_element_and, + *this, other); + return this; + } + + constexpr bbitmap operator^(const bbitmap other) const + { + return bbitmap_operators::template binary>(bbitmap_element_xor, + *this, other); + } + + bbitmap operator^=(const bbitmap other) + { + bbitmap_operators::template compound (bbitmap_element_xor, + *this, other); + return this; + } + + constexpr bbitmap operator~() const + { + return bbitmap_operators::template bit_not>(*this); + } + + constexpr bool operator!() const + { + return !(bbitmap_operators::template non_zero>(*this)); + } + + constexpr explicit operator bool() const + { + return bbitmap_operators::template non_zero>(*this); + } + + constexpr bool operator==(const bbitmap other) const + { + return bbitmap_operators::template equal>(*this, other); + } + + constexpr bool operator!=(const bbitmap other) const + { + return !(bbitmap_operators::template equal>(*this, other)); + } + + static constexpr bbitmap from_index (int index) + { + return bbitmap_operators::template from_index> (index); + } +}; + +template +void +gt_ggc_mx (bbitmap *) +{ +} + +template +void +gt_pch_nx (bbitmap *) +{ +} + +template +void +gt_pch_nx (bbitmap *, gt_pointer_operator, void *) +{ +} + +#endif