From patchwork Wed Jul 24 16:01: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: 1964355 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=bkr8ufCC; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=bkr8ufCC; 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 4WTf1x46Rwz1ybY for ; Thu, 25 Jul 2024 02:03:17 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AC3A9386181B for ; Wed, 24 Jul 2024 16:03:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on20601.outbound.protection.outlook.com [IPv6:2a01:111:f403:260e::601]) by sourceware.org (Postfix) with ESMTPS id 0C99B386100F for ; Wed, 24 Jul 2024 16:02:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0C99B386100F 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 0C99B386100F Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:260e::601 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1721836940; cv=pass; b=n8NL35e1JmTmq+QJX7F14dm+RlUZQtnnq1DoHLZDhiaHSdsoQsHtsOTdiymb20SUS+kGqdGZ9PbNIukO3z5d9hD2aumNo9o26cmsASRiVPqKIV+HUT1oa6ialHR/YWck4HETUhrWVOqY2f5D29Pt1yuIvctYDuFB745iuHLX1HE= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1721836940; c=relaxed/simple; bh=EZnw/RHQjeJKaM7oDYx/H/Ulo5utruwoZDmGdmTT01U=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=Xus6hwb5rt3f2pQAYV1MPvyoZlLQ5sN6IVpnVZxBwe0xhI7UaW6GzSihKB147gX//RE24VNmkQzYotSKfvRsN4+MqqO2/diyqv1XW9zjyfTnEytqZw2QzaRAQy32Jl9DRWfiWjApfgIPKf3GIXZrWB78BgcA3AVdz3PUOTFk7xg= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=kDdAERmxj37u5XYVm4YZ/bMSmkcJ56OhptkpQxw44IIVQmWzYTrUR2V8GVcHiR/RnO2lhdKHSw9G9TTJ5Jvxzu7aSH0M1UqrtQhmrUgBzICpqHRT8ijHfvx5gjh8tRdGNVMIpjaYaEMMY0cCEf7JTyNc8CkhRhShUqRrmRxsMt6Zj/wyLgzNeeRXDD39PCcbIW0e5r3S6vHPJgdqLLVDSPKACsx5LzWU6yE+OCAQ19g1eEOMG5ygo8AQe3KOOjqjPbGARVVFzTDxEit13L4zZsCHwNUmiCklNyCLjheu2Y4mxWo/vUXLSRX9sqdoJx1UDiEIW5kpiNXJz/yBSeJc+A== 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=PwLqbCfVfVNyunzAwYiw+CovKYSNVWng64xtVxrW7LM=; b=pD2wWnvMmF+yP2lveOyosTtcNucbZf1ElSPChI5CKEHEpUcwqYU1FTJ8QXZmUuCb0dbfeRc3JEHBTXPqeIQ3VIY1IIq7jhZqbEIq7IUKoq+cQQ7hQcAtwV++GmJyL2IjoMv+T3TxAWpAW7kX3LfRTn0IiGFpsFB2/K5nxyodNPIaym6zwDgM5z12KecehBUIPFv6F0ZpAvkMdUKJ2fM0DUXrQg0ZZDnQdzXeWSpw7X5I2d6KY+EO45SlHtCO90XiWzY0tWo4SkJ7f+8gCfrWANiuOArQyquMBmaZlK6L5xmp76KAvuAfMr5bnEjmZ0Xe7IWqf4vw4vbw8Kdm03ZbdA== 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=PwLqbCfVfVNyunzAwYiw+CovKYSNVWng64xtVxrW7LM=; b=bkr8ufCC7IjWadbOoCVVdWZhhzSzTq/Y7vQBP+xTRfoo0lyl0KL/KDKWhVz2oSHCQxcrWb77MPaxNkpuyP0B9iBOVpI34nTeSb2ZsqFTnlWWpvta4R455Vgkvr9tfvVAhvu8+5NdWiCeXGPzTgN9zk3MPXUJ1rS27Qbf03R5fAg= Received: from DUZPR01CA0180.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b3::14) by AS8PR08MB10246.eurprd08.prod.outlook.com (2603:10a6:20b:63c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29; Wed, 24 Jul 2024 16:02:10 +0000 Received: from DB5PEPF00014B90.eurprd02.prod.outlook.com (2603:10a6:10:4b3:cafe::52) by DUZPR01CA0180.outlook.office365.com (2603:10a6:10:4b3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.19 via Frontend Transport; Wed, 24 Jul 2024 16:02:09 +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 DB5PEPF00014B90.mail.protection.outlook.com (10.167.8.228) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7784.11 via Frontend Transport; Wed, 24 Jul 2024 16:02:09 +0000 Received: ("Tessian outbound 5cfbd73e165d:v365"); Wed, 24 Jul 2024 16:02:09 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: bdddab95383553bd X-CR-MTA-TID: 64aa7808 Received: from Lb6fe0dc3337e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3E349C77-57E5-4A2A-A4BB-CC18689BFBCF.1; Wed, 24 Jul 2024 16:02:03 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id Lb6fe0dc3337e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 24 Jul 2024 16:02:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jGxFDGq23ezw0xDUBTxU5E/DMp7sgmL+Os6UszGHpvbaZ5pdywcWeD7az+tLi1FdF4jijwGvF2cqDnSHPR1C/bT1KKLW/Yv+jd65iNZK58GdpqGT+umjVC7YmNYoo3bJWgTYeEYn3W1o1p48z5jaDIXoQNZ9C8yQacoBn7Lw1Ggxt4UWl6Aoco29WJYR7Ukncux4SNuJoiwywtj3CfTV2cHbReBIytv0Om9kKiTCdFw4wnYGtX8dDROj1ftApFoNBJCceJToAiei6iSVN4LVyAHqPCobMwyvvYFadFVFoio9htjsjCtIvnAAcIaAe6gYb6HyqCaoqghlxRYgjMANuw== 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=PwLqbCfVfVNyunzAwYiw+CovKYSNVWng64xtVxrW7LM=; b=T3dEhd5d00R/VpxTAPZr7efpyG1+QKK2DR2H+0fkTCLX85O36Tmj9y5nMbumuueJ6NQRhCmQVQJ9z+pzLTRj9mxWlcuGRVSxUH3f2Uj8z7BLTl6jRtjwzbGgM6sXCssNZFPbCWmaMqxSdjv3GuIyOCiFmKyodpenDw9YMRQwdBSI0SK4rulenNJOqFD2bimDyna2XhCG5VXSjfob6Lmtn2Goetfy9F3rEMcQP9rsQcCw0JAXtXryhsyIGNqr+psHNz/3UsyVpAXXET34TBbeDHqSMacsrJqOsJ7yULX0E0WfFQZvYKk1JPqQfn5TKVlbff456byP1Jk5ctk1R3tQrg== 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=PwLqbCfVfVNyunzAwYiw+CovKYSNVWng64xtVxrW7LM=; b=bkr8ufCC7IjWadbOoCVVdWZhhzSzTq/Y7vQBP+xTRfoo0lyl0KL/KDKWhVz2oSHCQxcrWb77MPaxNkpuyP0B9iBOVpI34nTeSb2ZsqFTnlWWpvta4R455Vgkvr9tfvVAhvu8+5NdWiCeXGPzTgN9zk3MPXUJ1rS27Qbf03R5fAg= 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 DB3PR08MB8937.eurprd08.prod.outlook.com (2603:10a6:10:43c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.16; Wed, 24 Jul 2024 16:02:00 +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.7784.017; Wed, 24 Jul 2024 16:02:00 +0000 Date: Wed, 24 Jul 2024 17:01:57 +0100 From: Andrew Carlotti To: gcc-patches@gcc.gnu.org Subject: [committed 10/11] Add new bbitmap class Message-ID: References: <262797c9-f27b-8dd0-02b2-ca15f8347d33@e124511.cambridge.arm.com> Content-Disposition: inline In-Reply-To: <262797c9-f27b-8dd0-02b2-ca15f8347d33@e124511.cambridge.arm.com> X-ClientProxiedBy: LO4P123CA0692.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:37b::15) To AS8PR08MB6678.eurprd08.prod.outlook.com (2603:10a6:20b:398::8) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6678:EE_|DB3PR08MB8937:EE_|DB5PEPF00014B90:EE_|AS8PR08MB10246:EE_ X-MS-Office365-Filtering-Correlation-Id: 1177d069-2ad3-42a0-2eca-08dcabf9f94d 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|366016|376014; X-Microsoft-Antispam-Message-Info-Original: Wu47zGSAoLGLQQrBb39w+xn3LCwHpAT6M85Y+FXTV1K0p0vKt8XUZLzHRNruK8VFVFzm5XgNTACfRP3edv0FdjZACH/4tDdlDzH918vI/LjXqHU81qRLSuIPqOfdpjEsVUwIQhIc/iLL3x3Xe6bRIku1cTOyq+Uy0FCGqRtd9e3U484woZSbTo/D2pGfC+4lMa6VZ5cYUho/rf556uAPDf1YDM4a3nPvAIBxRHvEw1NaEqlM+oTU+TqsfIqxqTr0XkcuurVDEdN2m7UCc0oHWg/9uIc83oHCqjS2rsW1sWSCrmBDKgzg99J7Hfemj3eWmwmLC++vmNxDCkxi6Dp1PFaeM+KZB8QzUm0CsEyoFykEaa7gNamZwsGlXzJzrYaKfTkiQQCMpMCj4GpEb0V03Hk6wFitPcheM712+E5yxyhdAPF9tunaqxxBtwC7XxErZ689rZFvypOaSeKkulKlmb627GgoA41hi86FfeVMyjERPkadr4tbx7p2uXwvtu8z5/wlOK2JouhQDl06RKKoxpVkXS1H1xEItfrFsd3qFnjjd++D1We33BG1y+STWAUAVMoeLv1dDJTzZCzx5RI8zNALyOhjmP4wdFMG2CqcMaWoH1gwKQD/56Sb6Jg44gan5/pOxGZMHmzdUmOaGxz3xAFTOB80IDP/pZCjTZuRVNUmwlw2tSAIyWquJDNxjn00BF4bgOyn7mBoH6g804qOgDNAgYxQlPjFH4tTnKPN4+4Xa3vHLo2WcMnjKZX8HQq5CfdLDZPDaMoRlD0O1OGuGPFSDDc/xM9M97XLJ0MqFbAsZBM0XY/mQNPrXueuknDJ4rFDrDMggR+3+oR8ae+9Y60BQ5NwgIiWDuN73qQWt5MWla63Nq76HXh9gVyvTSGupOLiXf6hHHYss9+L6mkexdFdap3QH5FHfMQGWfYmPQLb9MPSxFAdGPKXI9ougC2tQcscFlM3beMuhqc2elW1tj8Xv92SuRgv2hKM5aMofdh80PdOrivqk6uOgRm1dsfyHyGddF6NyOrBSulAKJRy7px8X6nua3FCsruZxBLZqbzfB3zu6FHK/0yEfvlCqEF6PLi2OtHzjJR2dgh2vAzcPFNMOXdLnZv3Qg43uny+ZuBAgsRZ2k4c7w4dWL5n9N1LtbOKBXGzOmQDHwzI8mVXwoULIKLGnLq5ZK229zXeqrIm7Mv9UaQC1RAAU0YpaOiS84zGCQsrntTV5j4JmBsnbu+f4aNqNUh9cS9W3ea0spZvJ7eBDrHXktTM+S0ywKMWOQlhWkGnsfOWjZ1eVQ2fAQ3ZuFaxY+bVABjiINazJpU= 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)(366016)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB8937 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-SkipListedInternetSender: ip=[2603:10a6:20b:398::8]; domain=AS8PR08MB6678.eurprd08.prod.outlook.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5PEPF00014B90.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 416e54a9-e15b-4d4c-8472-08dcabf9f376 X-Microsoft-Antispam: BCL:0; ARA:13230040|35042699022|82310400026|34020700016|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: fh29CsWGCvHMp1uhvxwDv1WGR6UdSzZMs3TlUpGBqXk58Kc7cvA6T+JWIlTjO8RpJLAzmiQrwwj9zd1On6fcdQ/79j/EeWqyu+ATesJ5wq9003nSP81Z+7JG4oaWMAez6o0vI1AtkInL4X5OfJMAuLAHVvJri+WCTJU7WOD8pEeDbpzscvlba5/E7AI7bo41W8F9hep1VHkzoW8eLwjp658etAk95GPLxadKXPgUKJR+aIDBLDalyLYP6Ut4dN8usagb8Fr5uRbCLBZUVkY9/KTur6UfNtH1SFxQKKTcVx/KjJX9U0HpO67FarMkl+uefop+1qJZTq2x/H/39RLoFwukxM33+2MMBwmFAfB+WGwO6LLnYWWaIupiIYXIA6YKOCG9rNT+HVtsbNU0Zr8AaWV6jy87SIa6dEu0QkdhO/3GCGAmgbsEG1OWfz+dSBQVBcQ4EsXdJ0pcei/cGGd2+j0J+43kpD2SBqJEOj47xvlr14V0QE3ivsZgMOeh0il5z9mTDdJ3HhNsfmc4Cu6yPNUU/dhSUZGcN/RZgeBb3YBbyRsSrObPDWgTxyvhN2YInHBwX1VXhOZod0QpfHmMknJYiyx8DhbGMrV9w2R3SICAW/S+lsypucZnKi5nJOdKuUGioFsKXDYfJIbeC8UPkJZs959VvfU104m/u8+/osJGtfuy1Q1DrJm0APJb3J1oNI7S9RwoujI3II/asRqdUu1YCvrZbo1G0zE/WPdWjoLZiY7HnPyg7nev1XCJ6AaGgVMoRE5udj+niODhOl7WiSQF0mOaSBNJMmiYRaqfRRY7u6H5tFs5jPuBj7h/1cAk5XFRHVTb/+BCkbLEWmq1XSRKKNzifJc9SpgaIYzqYAxBOBR69/lSVGVb859VtWtJaMM1Upvrl48Skx0NiIhvOx5csAqVLPYpoxJEyKakiQVK48MX8zOrNIwAUdmakIJhjFzbj9xVhglveYnvwKvvEkTYwPoowTGQm/bKf0k3PemZq0b0g7SBL3dV1bhi3dRhDjSLrBqR19NbHJe1SYO1HPojLef/Ae/Y9dVT9Ty/x+cO88doRuI4aiTFRFxfwekk4JxDoecCWm/26euT9M6q1taXf7D0DM2HYU57MAboHJGlkzlEMcVgWLSJfwGmdgOs760YiLYIt1O+uJWHMpogCT5h1P5ffaSTcXzrmd2QQW8bVL3HVod912N4iUeUP6z2k18OZ4Tw60cFhOBMrTSqDPzNQ49OkwGS5cSpKdoDNHFHZIlldSexDXB2GTMOyBb3EVQ/8z1swu7CJtXVLq0WGNOMuxExRCkEnOvTwsNJLg+Lc7oOWAGH043QDwKTP+aaYrFMosVWTb/LoQz1KwNw5zgDuspTX9VrQTa8XfoiZ/s825/A4GUJ8E25cbOQi0KtmWnRHOj/fvGisang3fNeyA== 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)(35042699022)(82310400026)(34020700016)(36860700013)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jul 2024 16:02:09.7090 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1177d069-2ad3-42a0-2eca-08dcabf9f94d 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: DB5PEPF00014B90.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10246 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, 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..716c013b1035e91d00226803755a44cb40ea5643 --- /dev/null +++ b/gcc/bbitmap.h @@ -0,0 +1,236 @@ +/* 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. */ + +/* Use recusive templated functions to define constexpr operations. */ +template +struct bbitmap_operators +{ + /* Return a result that maps binary operator OP to elements [0, M) of + X and Y, and takes the remaining elements from REST. */ + 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...); + } + + /* Return a result that contains the bitwise inverse of elements [0, M) of X, + and takes the remaining elements from REST. */ + template + static constexpr Result bit_not(const Arg &x, Rest ...rest) + { + return bbitmap_operators::template bit_not + (x, ~(x.val[M - 1]), rest...); + } + + /* Return true if any element [0, M) of X is nonzero. */ + template + static constexpr bool non_zero(const Arg &x) + { + return (bool) x.val[M - 1] + || bbitmap_operators::template non_zero (x); + } + + /* Return true if elements [0, M) of X are all equal to the corresponding + elements of Y. */ + 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); + } + + /* If bit index INDEX selects a bit in the first M elements, return a + Result with that bit set and the other bits of the leading M elements + clear. Clear the leading M elements otherwise. Take the remaining + elements of the Result from REST. */ + template + static constexpr Result from_index(int index, Rest ...rest) + { + return bbitmap_operators::template from_index + (index, + uint64_t ((index - (M - 1) * 64) == (index & 63)) << (index & 63), + rest...); + } +}; + +/* These functions form the base for the recursive functions above. They + return either bitmap containing the elements passed in REST, or a default + bool result. */ +template<> +struct bbitmap_operators<0> +{ + template + static constexpr Result binary(Operator, const Arg, const Arg, + Rest ...rest) + { + return Result { rest... }; + } + + 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) + { + for (int i = 0; i < N; i++) + val[i] |= other.val[i]; + + return this; + } + + constexpr bbitmap operator&(const bbitmap other) const + { + return bbitmap_operators::template binary> + (bbitmap_element_and, *this, other); + } + + bbitmap operator&=(const bbitmap other) + { + for (int i = 0; i < N; i++) + val[i] &= other.val[i]; + + return this; + } + + constexpr bbitmap operator^(const bbitmap other) const + { + return bbitmap_operators::template binary> + (bbitmap_element_xor, *this, other); + } + + bbitmap operator^=(const bbitmap other) + { + for (int i = 0; i < N; i++) + val[i] ^= other.val[i]; + + 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)); + } + + /* Return a bitmap with bit INDEX set and all other bits clear. */ + + 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