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: border1.nntp.dca.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!aioe.org!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Clubley Newsgroups: comp.lang.ada Subject: Re: Forcing GNAT to use 32-bit load/store instructions on ARM? Date: Mon, 7 Jul 2014 00:25:56 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <0e0b9ac2-e793-4cc5-8d8d-d3441ca28a58@googlegroups.com> <1j7b0m3yptffy$.1cztnkty8elrv$.dlg@40tude.net> Injection-Date: Mon, 7 Jul 2014 00:25:56 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="e458ff8b81bc0c159989eb0e36c6e372"; logging-data="5874"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18K5jUErOsoRAiUkclEGJdlq52rFdQwGGE=" User-Agent: slrn/0.9.8.1 (VMS/Multinet) Cancel-Lock: sha1:E9oAIAwXZaPEop5dTZnXUqKDb6E= Xref: number.nntp.dca.giganews.com comp.lang.ada:187409 Date: 2014-07-07T00:25:56+00:00 List-Id: On 2014-07-06, MatthiasR wrote: > They recommend to use a temporary variable to ensure an access to the record > variable as a whole. > > That is not really elegant, because records with representation clauses, > directly mapped onto hardware registers, look like the most natural way to > access these registers. Reading Ada books, one even could get the impression > that record represenation clauses are made primarily for this purpose. > Unfortunately there seem to be no way to force a specific access width, so > this feature is not really useable (without the mentioned workaround with > the temporary variable) on architectures where the allowed access width is > not uniform over the whole address range. > Totally agree. In addition, Ada needs syntax/semantics to update multiple bitfields within a record as one write operation without having to use a temporary. The size of the write (assuming the record itself was marked as Atomic) would be the size of the record. In that way, you could (finally) get rid of temporary variables and C style bitmasks when updating registers. Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world