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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed2-b.proxad.net!nnrp2-2.free.fr!not-for-mail From: =?iso-8859-1?b?RnLpZOlyaWM=?= Praca Subject: Re: Representation clauses and side-efects on STM32F411 ravenscar runtime Newsgroups: comp.lang.ada References: <55bddbe2$0$3384$426a74cc@news.free.fr> <55cf4b21$0$3013$426a74cc@news.free.fr> User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 15 Aug 2015 17:17:08 GMT Message-ID: <55cf7414$0$3344$426a74cc@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 15 Aug 2015 19:17:08 CEST NNTP-Posting-Host: 88.169.125.217 X-Trace: 1439659028 news-1.free.fr 3344 88.169.125.217:35982 X-Complaints-To: abuse@proxad.net Xref: news.eternal-september.org comp.lang.ada:27471 Date: 2015-08-15T19:17:08+02:00 List-Id: Le Sat, 15 Aug 2015 15:33:04 +0000, Simon Clubley a écrit : > On 2015-08-15, Frédéric Praca wrote: >> >> Hello Simon, >> assembly has never been my favourite language and I only studied 68000 >> assembly a long time ago :) >> I don't know what you really mean by "load and/or store by byte >> references". >> So, here's what I get by using objdump > > [snip] > >> USART2.BRR.DIV_Fraction := 16#c#; >> 8000418: f44f 4388 mov.w r3, #17408 ; 0x4400 800041c: f2c4 0300 movt >> r3, #16384 ; 0x4000 8000420: 7a1a ldrb r2, [r3, #8] > ^^^^ >> 8000422: f04f 010c mov.w r1, #12 8000426: f361 0203 bfi r2, r1, #0, >> #4 800042a: 721a strb r2, [r3, #8] > ^^^^ > > This violates the hardware level restrictions and it's not the first > time I've come across this. > > The same thing can happen with C as well when you try to use bitfields > instead of bitmasks; it's a general gcc code generation issue for ARM. Yes, that's what I thought because I was expecting the compiler to handle all the bitwise operations for me :) > There are a couple of AIs created as a result of submissions by myself > which you might find interesting: > > http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0127-1.txt?rev=1.1 > http://www.ada-auth.org/cgi-bin/cvsweb.cgi/ai12s/ai12-0128-1.txt?rev=1.1 > > They contain proposed ideas about how to tackle this problem in a future > version of Ada. As far as I understood by reading in diagonal, this is related to the use of the Volatile and Atomic aspects with a composite record. > >> From what I read in the ARM assembly manual, this seems to be ok from >> an assembly point of view so I think this can come from the hardware >> restrictions. Am I right ? >> >> > Yes you are. Ok, reading your AIs, I think I better understand the whole picture. Thanks Simon for answering so clearly. > Simon. Fred.