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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fe1de79a099115c5 X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: 16 bit integers in streams Date: 1997/09/25 Message-ID: <342AD4BA.283F@gsfc.nasa.gov>#1/1 X-Deja-AN: 275564960 References: <342A83A8.77AA@gsfc.nasa.gov> Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Reply-To: Stephen.Leake@gsfc.nasa.gov Newsgroups: comp.lang.ada Date: 1997-09-25T00:00:00+00:00 List-Id: Tucker Taft wrote: > > Stephen Leake (Stephen.Leake@gsfc.nasa.gov) wrote: > > : Ok, I understand the consistency issue. Apparently GNAT uses 16 bit > : base integers when I request them. I hearby request an option on > : ObjectAda (and therefore the AdaMagic front end?) to sacrifice > : efficient integer arithmetic, and give me 16 bit base integers (when > : appropriate), and therefore 16 bits in streams! Could pragma > : Optimize (Space) do this? > > Gulp. This would be a pretty big semantic effect for pragma Optimize. > > The problem is that the representation used on streams is in one > sense a very important "high-level" external effect, and in another > sense something almost analagous to internal representation. I assume size clauses control both the external and internal representation; see below. > I suspect the "right" solution is to consider the base range to be > a 16 bit range for types like this, even though 32-bit arithmetic is > used for them. We have already considered doing this, but haven't > done it yet. Of course, the longer we wait, the more people will > begin to rely on the current behavior... Or complain about it :). Surely the intent of 'Read is to put the _memory_ image of a type into the stream, not the _register_ image? > Perhaps we could use an explicit size clause as a way to control > the base range. We have frequently debated the meaning of > a "confirming" size clause. Perhaps this could be one "real" effect > of such a clause. It's an intriguing thought... This is definitely what I expect a size clause to mean; I'm telling the compiler I want exactly 16 bits, anyplace it matters (including streams). I assume that's what GNAT does now, although maybe GNAT is also doing 16 bit arithmetic. > -- > -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ > Intermetrics, Inc. Burlington, MA USA -- - Stephe