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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,aa67018f272e5dda X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-30 21:52:14 PST Path: supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!newsfeed.direct.ca!look.ca!newsfeed1.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail From: "Phaedrus" Newsgroups: comp.lang.ada References: <3AC264E3.742D050E@kg.hsanet.net> Subject: Re: Green Hills 64 Bit Float Problem on PowerPC 603 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: Date: Sat, 31 Mar 2001 05:50:43 GMT NNTP-Posting-Host: 209.178.103.28 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 986017843 209.178.103.28 (Fri, 30 Mar 2001 21:50:43 PST) NNTP-Posting-Date: Fri, 30 Mar 2001 21:50:43 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: supernews.google.com comp.lang.ada:6285 Date: 2001-03-31T05:50:43+00:00 List-Id: A couple of ideas for you: First, are you by chance using a variant record type, somewhere deep within your message? If so, you've got the answer, it will allocate a size to cover the size of the largest possible record, and the descriminant. Second, this is crude but it will work, allocate a bit array (make sure it's packed, please) at the same location as your float in the message. Then you'll be able to flip bits to your heart's content, and see exactly where they show up in the message, as well as being able to print the new values of the float. (I ~did~ say it was crude, didn't I?) Make sure you have an exception handler within the loop that allows you to set/check the bits, or else your first value check might be your last, and you'll have to load all over again. Sorry, sometimes you have to get "down and dirty" to get the job done on the target. And some of us actually enjoy it! Phaedrus "DPH" wrote in message news:3AC264E3.742D050E@kg.hsanet.net... > We are using the Green Hills 2000 compiler to generate code for a > powerPC MVME 2600 card. The whole thing is working fine, but inspection > of messages generated within the system, for which representation > specifications control the memory layout, appear to show that 64 bit > floating point numbers are laid into memory with the 4 least significant > bytes of the mantissa first, then the next 4 bytes contain the sign, > exponent, and the most significant 20 bits of the mantissa. At least > that's the way it appears. That is, the representation spec. says the > float should be at byte 40, and and byte 40 there is mostly zeroes, and > at byte 44 is the distinctive IEEE format 3FFh offset exponent followed > by 20 bits of mantissa. > > Complicating the analysis is the fact that the message is 4 bytes longer > than it should be. That is, representation specifications say it should > be 420 bytes long, but it is 424 bytes long. No, I haven't been able to > figure out where the extra 4 bytes are located. > > Of course, the presence of 4 more bytes than there should be gives rise > to the uncertainty that maybe the 64-bit floating point values are > indeed laid in memory as one would expect, with sign-exponent-most > significant bits of mantissa being followed by the 32 least significant > bits of mantissa. This _could_ be the case, since the next 4 bytes are > obviously not in IEEE 64 bit format for an exponent. > > So, after all that, the question is: Is anyone familiar enough with > PowerPC floating point format to tell me if they do indeed swap the two > words that make up a 64-bit floating point number in a PowerPC? > > This whole thing is greatly significant because I need to make a data > reduction tool read these values and write a report. I need to > eliminate the uncertainty with respect to where the data really is. > Both the choices for resolving this (word swapping by the Power PC, > representation spec. violation by the compiler) seem about equally > unlikely to be the cause of this uncertainty. > > Thanks in advance, > > Dave Head > >