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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: buffer1.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!news.stack.nl!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Modified proposals for Ada-Comment Date: Sat, 12 Jul 2014 22:00:36 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="5cbec41b82bafb9ba55107f02585e18b"; logging-data="13070"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18KxlMaaZTfEc5Vz5VoN/YYoM8H2MvxZjs=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:g7uzShj6oeAmcr6w+MWbAZTfydA= sha1:VdlEB5NW4BJFvJhIkbxIJjlK/wo= Xref: number.nntp.dca.giganews.com comp.lang.ada:187542 Date: 2014-07-12T22:00:36+01:00 List-Id: Simon Clubley 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.