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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,553a6b79b2471571 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!atl-c08.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: How do you bitwise operations in Ada '83 and '95 References: <9315684D-C216-4EDA-8852-0A6BD4C275B0@amado-alves.info> From: Stephen Leake Date: Fri, 21 Jul 2006 05:53:26 -0400 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:GFdAkwXiUff/qZA8AlIP5r9WlJQ= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 9b0d144c0a418e73ae4a403865 Xref: g2news2.google.com comp.lang.ada:5856 Date: 2006-07-21T05:53:26-04:00 List-Id: Marius Amado-Alves writes: >>> Note that I don't do bit shifting. Instead I multiply or divide by a >>> magnitude. I don't think bit shifting is portable. >> >> See LRM B.2, Interfaces.Shift_Left, Shift_Right, Rotate_Left, >> Rotate_Right. > > Ok, two voices by now, so it is probably portable. As Colin has pointed out, Interfaces.Unsigned_n is not required on all machines; a machine with a 36 bit word won't have Interfaces.Unsigned_32. So you need to be precise about what you mean by "portable". We usually take that to mean "code works without change on a reasonable set of CPUs and operating system", where "reasonable" means "the ones I care about" :). > But clearly the only advantage of Interfaces over core language > arithmetic would be speed. There's no reason to think one would be faster than the other. It depends on the CPU and compiler. -- -- Stephe