comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: 3-bit array ...
Date: 1999/12/06
Date: 1999-12-06T00:00:00+00:00	[thread overview]
Message-ID: <384BE868.DCBF6814@averstar.com> (raw)
In-Reply-To: wccg0xgm5n4.fsf@world.std.com

Robert A Duff wrote:
> 
> Nick Roberts <nickroberts@callnetuk.com> writes:
> 
> > Just out of curiosity ... what is a 3-bit array?
> 
> People are using that to refer to a packed array of 3-bit components.
> For example:
> 
>     type T1 is range 1..5;
>     type T2 is array(Integer range <>) of T1;
>     pragma Pack(T2);
> 
> In Ada 95, T1'Size = 3 -- a statement that will no doubt elicit the
> usual complaints from Robert Dewar about loose-cannon language design
> teams run amok.  ;-) ;-)
> 
> Also in Ada 95, T2'Component_Size will be either 3 or 4, depending on
> the whim of the compiler writer, which doesn't seem like a good language
> design decision.  I'm assuming a 32-bit machine, here.  GNAT has always
> supported packing to the 3-bit level.  AverStar's front end, and the
> Green Hills compiler that uses AverStar's FE, used to use 4, but now
> uses 3, due to customer demand for it. 

Oh dear, I hate to correct Bob on this one, but our front end
still uses 4 given a pragma Pack.  We only use "odd ball" sizes
if the user asks for them explicitly via specifying the 'Component_Size.
This is pretty important, because there is already code out there
with pragma Packs, and we don't want it to suddenly start packing
differently...

> ... That's what this whole
> discussion has been about.
> 
> There's also the issue of whether you can say:
> 
>     for T2'Component_Size use 3;
> 
> instead of the pragma Pack above.

That is the only way to get packing to 3-bits-per-element with
the AverStar front end (unless you happen to have a 24-bit word,
like the Raytheon Patriot Missile Ground Support computer, where
3-bits-per-element is a "natural" size ;-).
> 
> - Bob

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




  reply	other threads:[~1999-12-06  0:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-06  0:00 3-bit array porting problem from ADA83 to GreenHills ADA95 Darrell Higgins
1999-11-05  0:00 ` Jeff Creem
1999-11-06  0:00   ` Darrell Higgins
1999-11-06  0:00 ` Robert Dewar
1999-11-09  0:00 ` Steve Mossom
1999-11-09  0:00   ` Robert Dewar
1999-11-10  0:00 ` Gleason
1999-11-10  0:00   ` Ted Dennison
1999-11-10  0:00     ` David Botton
1999-11-12  0:00       ` Robert Dewar
1999-11-12  0:00         ` Preben Randhol
1999-11-14  0:00         ` David Botton
1999-11-13  0:00 ` Darrell Higgins
1999-12-03  0:00 ` Darrell Higgins
1999-12-02  0:00   ` Robert C. Leif, Ph.D.
1999-12-04  0:00     ` Robert Dewar
1999-12-03  0:00   ` 3-bit array Nick Roberts
1999-12-05  0:00     ` Gisle S�lensminde
1999-12-06  0:00     ` Robert A Duff
1999-12-06  0:00       ` Tucker Taft [this message]
1999-12-07  0:00       ` Robert Dewar
1999-12-07  0:00         ` Robert A Duff
1999-12-07  0:00         ` Tucker Taft
1999-12-08  0:00           ` Robert Dewar
1999-12-08  0:00           ` Robert C. Leif, Ph.D.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox