comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Modified proposals for Ada-Comment
Date: Sat, 12 Jul 2014 22:00:36 +0100
Date: 2014-07-12T22:00:36+01:00	[thread overview]
Message-ID: <ly8unyxpfv.fsf@pushface.org> (raw)
In-Reply-To: lprvo8$mcl$1@dont-email.me

Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP> writes:

> was defined as Atomic. However, the generated code showed that when a
> bitfield, instead of the record as a whole, was referenced, GNAT used
> ldrb/strb (byte level access instructions) instead of ldr/str (32 bit
> access instructions) when the bitfield was within the first 8 bits
> of the record.

Likewise when the bitfield was in the MS 8 bits. I haven't tried with
bitfields of length greater than 1.

> C.6(15) states:
>
> 	For an atomic object (including an atomic component) all reads and
> 	updates of the object as a whole are indivisible.
>
> There are conflicting opinions about the above rule in comp.lang.ada.
> The words "as a whole" in C.6(15) were used to justify the position
> that access to this single bitfield is not required to be in units of
> the record size which on the surface seemed reasonable.

I think the problem is with the phrase "as a whole". If it means that
partial access need not be indivisible it probably needs to spell it out
better, because that is completely at odds with what I would expect of
"atomic".

> However, other opinions are that C.6(15) does apply when accessing
> this single bitfield.

I think that the "other opinions" are that "as a whole" is a mistake, so
that C.6(15) should say

   For an atomic object (including an atomic component) all reads and
   updates of the object are indivisible.


Aside from these niggles, a useful pair of proposals.


  reply	other threads:[~2014-07-12 21:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-12 18:45 Modified proposals for Ada-Comment Simon Clubley
2014-07-12 21:00 ` Simon Wright [this message]
2014-07-12 21:24   ` Simon Clubley
2014-07-12 21:50 ` Niklas Holsti
2014-07-12 22:19   ` Simon Clubley
2014-07-13  0:06     ` Simon Clubley
2014-07-17 21:15   ` Simon Clubley
replies disabled

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