comp.lang.ada
 help / color / mirror / Atom feed
* Help with Atomic_Components and whole array assignment
@ 2001-01-22 11:22 r_c_chapman
  2001-01-22 12:51 ` Stuart Palin
  2001-01-22 16:21 ` Robert Dewar
  0 siblings, 2 replies; 31+ messages in thread
From: r_c_chapman @ 2001-01-22 11:22 UTC (permalink / raw)


Having a slight confusion over the use of array aggregate assignments
with Atomic_Components.

We have a device which _has_ to be accessed use byte-wide load
and store instructions only (it's an autostore NOVRAM...), so we
have an array of bytes declared, thus:

  type Byte is range 0 .. 255;
  for Byte'Size use 8;
  for Byte'Alignment use 1;
  type Index is range 0 .. 4; -- for argument's sake!
  type Byte_Array is array (Index) of Byte;
  pragma Volatile (Byte_Array);
  pragma Atomic_Components (Byte_Array);

  A : Byte_Array;
  for A'Address use ...

all fine so far.  When we initialise this array, thus:

  A := Byte_Array'(others => 0);

compiler A generates 1 Word-sized store and 1 Byte-sized store.
(Target is PowerPC by the way.)
Compiler B (or should that be "G" :-) ) generates similar code on IA32.

Can anyone confirm this is indeed acceptable behaviour?

PS...Yes I know the Byte should probably be modular, but this is SPARK,
and we haven't got them implemented (yet... :-) )
 Thanks,
  Rod




Sent via Deja.com
http://www.deja.com/



^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2001-02-07 21:40 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-22 11:22 Help with Atomic_Components and whole array assignment r_c_chapman
2001-01-22 12:51 ` Stuart Palin
2001-01-22 14:16   ` mark_lundquist
2001-01-22 16:09     ` Pat Rogers
2001-01-22 16:29     ` Robert Dewar
2001-01-22 19:52       ` Mark Lundquist
2001-01-30 15:54       ` Tucker Taft
2001-01-30 18:20         ` Robert Dewar
2001-01-31  5:08           ` DuckE
2001-01-31  5:57             ` Robert Dewar
2001-02-01  3:31               ` DuckE
2001-02-02 21:38               ` Mark Lundquist
2001-02-02 23:08                 ` Robert Dewar
2001-02-03  1:39                 ` tmoran
2001-01-22 16:21 ` Robert Dewar
2001-01-22 16:39   ` r_c_chapman
2001-01-30 15:57     ` Tucker Taft
2001-01-30 18:26       ` Robert Dewar
2001-01-30 21:30         ` Simon Wright
2001-02-01  6:11           ` Robert Dewar
2001-02-06  0:32         ` Richard Kenner
2001-02-06  3:15           ` Robert Dewar
2001-01-31 10:09       ` Rod Chapman
2001-01-31 21:41         ` Tucker Taft
2001-02-01  5:33           ` Robert Dewar
2001-02-01  9:42           ` Rod Chapman
2001-02-01 18:10             ` Robert Dewar
2001-02-01 13:14           ` SPARK flow analysis (was Help with Atomic_Components and whole array assignment) Stuart Palin
2001-02-01 23:38           ` Help with Atomic_Components and whole array assignment Nick Roberts
2001-02-02  3:45             ` Robert Dewar
2001-02-07 21:40           ` Nick Williams

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