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,e49db73f947323a6 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: GNAT for a PPC Mac OS X machine Date: Mon, 18 Apr 2011 18:28:40 +0300 Organization: Tidorum Ltd Message-ID: <9133l8FtmtU1@mid.individual.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net FGPU3MZE0XpQ5yI3k0OctQJ/AEHAHMMTy33G9IwhA3z71nKwFR Cancel-Lock: sha1:GghAhBE/vXo1AylxPMP11cltjfk= User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328) In-Reply-To: Xref: g2news1.google.com comp.lang.ada:18859 Date: 2011-04-18T18:28:40+03:00 List-Id: Bill Findlay wrote: >>>> Bill Findlay writes: >>>> >>>>> I've an enthusiastic would-be user of my KDF9 emulator who has a G5 Mac. >>>>> >>>>> What is the most up-to-date compiler he can use, and where can he get it? > The problem now is a portability issue. > > I have the declarations: > > type word is mod 2**48; > > ... > > type field_of_16_bits is mod 2**16; > > type Q_part is new field_of_16_bits; > > type Q_register is > record > C_part, I_part, M_part : Q_part; > end record; > for Q_register'Size use KDF9.word'Size; > > And this is fine in Intel. But on PPC, we get the error: > > 92. for Q_register'Size use word'Size; > | > >>> size for "Q_register" too small, minimum allowed is 64 > > It's puzzling that the compiler refuses to give Q_register the size that it > happily gave to word. (The aspect clause is there to support unchecked > conversions between the word and Q_register types.) Bill, even if you get the Size clause to work, I hope your code does not rely on the Q_register components C_part, I_part, M_part being Unchecked_Converted to or from some well-known bit positions within the "word" value, as that would unportable. If you only intend to use the "word" as an opaque container for a Q_register value, and never access the integer value of the whole "word" or particular bits of the "word", Unchecked_Conversion is ok. Otherwise it would be better to use shifting and masking operations to convert between the Q_register type and the word type; then you would know exactly which bits in the "word" contain which parts of the Q_register. If the goal is a bit-precise simulation of a KDF9, I would feel safer with a shift-and-mask conversion. Apologies if my comment is obvious to you. No offence meant. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .