comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Problem to dramatize packed-array/rep-clause difficulties
Date: 1996/03/28
Date: 1996-03-28T00:00:00+00:00	[thread overview]
Message-ID: <dewar.828029845@schonberg> (raw)
In-Reply-To: 4jdcf6$7gc@news2.delphi.com

tmoran says

"  Of course an array of n bit fields will always have the packing
pattern repeat after Least Common Multiple(n,8) bits, and thus
can be viewed as an array of LCM(n,8)/8 -byte records, each containing
LCM(n,8)/n fields.  If access to the J-th of a packed array of n-bit
items is most efficiently implemented on a particular machine by using
a case statement on the J/(LCM(n,8)/n)-th group, then by definition a
'smart' compiler for that machine does it that way."

I disagree. It is *extremely* unlikely that any Ada compiler that *did*
implement jamming of 9-bit packed arrays would to it this way. Certainly
the only Ada compilers that I have seen that do support such packed
arrays do not take this approach. Supporting 9-bit packed arrays is
hard work anyway, doing it in the manner that tmoran suggests would
add a LOT of work to a compiler implementation for a an extremely
marginal feature.

And that is really the point. You want to limit the requirements for
implementation of rep clause level features to those cases which the
compiler can do efficiently without remarkable optimization effort.
Most programers do not like to rely on "big" optimizations of this
type.

If you want to use the LCM method, then you can perfectly easily 
program it yourself, and it will be comparably efficient to what
the compiler could do. It's a bit like the RISC situation. In
choosing the primitives of the language, we choose those things
which you cannot easily and efficiently add on as packages, but
you don't build in things which can easily be added as packages,
because it's very hard to decide what this set shoud be, and
more to the point, why make the compiler more complex for no
real gain.





  reply	other threads:[~1996-03-28  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-03-28  0:00 Problem to dramatize packed-array/rep-clause difficulties tmoran
1996-03-28  0:00 ` Robert Dewar [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-03-28  0:00 tmoran
1996-03-27  0:00 tmoran
1996-03-27  0:00 ` Doug Rogers
1996-03-27  0:00   ` Robert Dewar
1996-03-27  0:00 ` Robert Dewar
replies disabled

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