From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5ff6e0c3de8331c0 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!postnews.google.com!q69g2000hsb.googlegroups.com!not-for-mail From: Alinabi Newsgroups: comp.lang.ada Subject: Re: sub-optimal code for packed boolean arrays -- bug or inherent limitation Date: Tue, 03 Jul 2007 18:17:42 -0000 Organization: http://groups.google.com Message-ID: <1183486662.806585.71680@q69g2000hsb.googlegroups.com> References: <1183404856.375083.160890@q69g2000hsb.googlegroups.com> <1183485842.725620.199490@w5g2000hsg.googlegroups.com> <1183486195.764567.297420@k29g2000hsd.googlegroups.com> NNTP-Posting-Host: 75.75.8.72 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1183486663 8360 127.0.0.1 (3 Jul 2007 18:17:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 3 Jul 2007 18:17:43 +0000 (UTC) In-Reply-To: <1183486195.764567.297420@k29g2000hsd.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.4) Gecko/20061201 Firefox/2.0.0.4 (Ubuntu-feisty),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: q69g2000hsb.googlegroups.com; posting-host=75.75.8.72; posting-account=gD74RA0AAABm9rsBG7oeOmJ-iO5c3KUQ Xref: g2news1.google.com comp.lang.ada:16399 Date: 2007-07-03T18:17:42+00:00 List-Id: One more thing: some inline assembly is unavoidable. There are two other bitboard operations that are required: First_One(Bitboard_T) returns Natural and Last_One(Bitboard_T) returns Natural; They return the position of the least significant and most significant set bit respectively. On x86 processors you can do this with one instruction BSF (bit scan forward) and BSR (bit scan reverse), and you cannot expect a compiler to generate them.