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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Simon Clubley Newsgroups: comp.lang.ada Subject: Re: Representation clauses and side-efects on STM32F411 ravenscar runtime Date: Sat, 15 Aug 2015 15:33:04 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <55bddbe2$0$3384$426a74cc@news.free.fr> <55cf4b21$0$3013$426a74cc@news.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sat, 15 Aug 2015 15:33:04 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="7b39e8851f10d965ccd7f8de50485d56"; logging-data="9120"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/laR0OOG/XDZ4Fr9hW4lu2nBfkBN/1KJM=" User-Agent: slrn/0.9.9p1 (Linux) Cancel-Lock: sha1:J3qk32vzcPXjDOiCU1O+0t7r2OI= Xref: news.eternal-september.org comp.lang.ada:27470 Date: 2015-08-15T15:33:04+00:00 List-Id: 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. 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. > > 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. Simon. -- Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP Microsoft: Bringing you 1980s technology to a 21st century world