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,90212413571e3e8b X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!news.banetele.no!uio.no!newsfeed1.fi.sn.net!fi.sn.net!newsfeed2.fi.sn.net!news.song.fi!not-for-mail Date: Sat, 15 Mar 2008 21:26:22 +0200 From: Niklas Holsti User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20060628 Debian/1.7.8-1sarge7.1 X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Endian-problem/bug with system.bit_ops (gnat3.15)... References: <47DB8194.62FE76B0@baigar.de> <47dbbacc$0$23854$4f793bc4@news.tdc.fi> <47DC1B0B.A4976DBB@baigar.de> In-Reply-To: <47DC1B0B.A4976DBB@baigar.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <47dc22a4$0$8166$4f793bc4@news.tdc.fi> Organization: TDC Internet Services NNTP-Posting-Host: laku61.adsl.netsonic.fi X-Trace: 1205609124 news.tdc.fi 8166 81.17.205.61:32978 X-Complaints-To: abuse@tdcnet.fi Xref: g2news1.google.com comp.lang.ada:20424 Date: 2008-03-15T21:26:22+02:00 List-Id: Erik Baigar wrote: > Niklas Holsti wrote: > >>Did you have a question to ask, or did you just want to report this >>problem and your solution? > > Since the problem is solved by including all 32bits the posting is > not really a question - maybe the posting will give someone else, > encountering the same problem, a hint what to look out for... Ok, good. (I meant no criticism, I just wondered if, or how, I could help.) >>I think that your program could be made more portable by avoiding >>'Address (and, of course, System.Bit_Ops) and using instead modular >>types (not available in Ada83) and their predefined bitwise "and" >>and "or" operations. > > Do you have an estimation on performance? The current code > is quite fast in emulating the vintage processor (more than > 3.5MIPS in the simulation) using the non portable System.Bit_Ops... As I understand it, and have observed in some programs and some targets, a bitwise operation (and, or, xor, not) on modular types with a power-of-two modulus translates directly into the corresponding machine instruction. I expect such modular types to be as fast as System.Bit_Ops, even if the operations in System.Bit_Ops are intrinsic or inlined. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .