From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.9 required=3.0 tests=BAYES_00,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Not good for Ada endorsement Date: Thu, 15 Jul 2021 23:08:40 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <5a1cegtfm5ibqej3ldebpc4g99ujniqt9u@4ax.com> <0e6ee3e9-baad-47b3-872b-90ec6c735920n@googlegroups.com> <59c3fb8e-6866-4ea9-a1a2-21fdff252095n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 15 Jul 2021 21:08:40 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="05d073167f8af91634ee01bea1feaa70"; logging-data="396"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18E7VKTKtubTF2jC5S6ZX7C2RRoGb2tPoM=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 Cancel-Lock: sha1:hk6GbcXQR+jw7LZK+ElHaoSXYFs= In-Reply-To: <59c3fb8e-6866-4ea9-a1a2-21fdff252095n@googlegroups.com> Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:62396 List-Id: On 7/15/21 6:29 PM, Lucretia wrote: > On Thursday, 15 July 2021 at 16:56:40 UTC+1, Jeffrey R. Carter wrote: > >> A packed array of Boolean requires all the operations above, plus shifting the >> bit to the LSB and treating the result as a Boolean, so it may not be that > > Don't need to shift to the LSB, only need to shift the 1 to the bit location you want to test, invert and then check against 0. You know that that is enough, and may be what you're doing manually, but the compiler may not know that. If A is a packed array of Boolean, then A (I) has type Boolean. Unless the compiler can optimize it (and maybe it can), it would normally need to shift the bit down so it can be treated as a value of type Boolean, and then apply whatever you do with the resulting Boolean value. -- Jeff Carter "How'd you like to hide the egg and gurgitate a few saucers of mocha java?" Never Give a Sucker an Even Break 101