<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Ahhh, typo in my previous mail: <br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">> <span>when I noticed that -Os gives me Thumb on Cortex-A{8,9,17}</span><br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I wanted to say:<br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><span>when I noticed that "GCC -Os" gives me Thumb on Cortex-A{8,9,17}</span><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Sjoerd Meijer<br>
<b>Sent:</b> 15 November 2018 14:15:26<br>
<b>To:</b> Peter Smith; Bruce Hoult<br>
<b>Cc:</b> llvm-dev; nd<br>
<b>Subject:</b> Re: [cfe-dev] [RFC][ARM] -Oz implies -mthumb</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p style="margin-top:0; margin-bottom:0"><br>
</p>
Yes, exactly this:</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<br>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
> <span>Sure, none of the cortex-m cores support ARM mode. Try cortex-a{5,7,8,9,15,53} etc and you'll see it works.</span><br>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<br>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
Sorry for being a bit vague and unclear here: yes, I should have said <span>cortex-a{5,7,8,9,15,53}</span>.<br>
</div>
I was just having a play with this native compiler:
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<pre id="x_x_hterm:copy-to-clipboard-source" style="">gcc-5 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609</pre>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
when I noticed that -Os gives me Thumb on Cortex-A{8,9,17}, which is what I would expect, but with Clang -Oz I get A32.<br>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<br>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
I haven't thought about the implementation yet, but I hope passing -mthumb in the driver is not that difficult when we i) target an A-core and AArch32 state, and ii) we optimise for minimum size. And if I have to update a lot of tests, then that's what it is
I am afraid, if we agree this is a sensible change that is.</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<br>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
Cheers,</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
Sjoerd.</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<br>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<br>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<br>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<br>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<br>
</div>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,"EmojiFont","Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<br>
<div style="color:rgb(0,0,0)">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> cfe-dev <cfe-dev-bounces@lists.llvm.org> on behalf of Bruce Hoult via cfe-dev <cfe-dev@lists.llvm.org><br>
<b>Sent:</b> 15 November 2018 13:31<br>
<b>To:</b> Peter Smith<br>
<b>Cc:</b> llvm-dev; Clang Dev<br>
<b>Subject:</b> Re: [cfe-dev] [RFC][ARM] -Oz implies -mthumb</font>
<div> </div>
</div>
<div>
<div dir="ltr">Sure, none of the cortex-m cores support ARM mode. Try cortex-a{5,7,8,9,15,53} etc and you'll see it works.</div>
<div class="x_x_gmail_extra"><br>
<div class="x_x_gmail_quote">On Thu, Nov 15, 2018 at 5:10 AM, Peter Smith <span dir="ltr">
<<a href="mailto:peter.smith@linaro.org" target="_blank">peter.smith@linaro.org</a>></span> wrote:<br>
<blockquote class="x_x_gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
My understanding is that whether a gcc toolchain defaults to ARM or<br>
Thumb is a configuration time decision by whomever builds the<br>
toolchain. The linaro arm-linux-gnueabihf toolchain I have defaults to<br>
-mthumb and that doesn't vary for -mcpu or any other command line<br>
option. I haven't got a gcc to hand that defaults to -marm so that I<br>
can test whether -mcpu=cortex-m3 will change that to Thumb. If I try<br>
-marm -mcpu=cortex-m3 I get "error: target CPU does not support ARM<br>
mode".<br>
<br>
Can you give us a more concrete example about where GCC is inconsistent?<br>
<br>
For clang I'm not particularly fond of -Oz implying a change of<br>
instruction set state. I think that it would be difficult to document<br>
properly, especially how to tell clang that I really did mean -Oz on<br>
ARM. As well as being a bit messy to implement.<br>
<br>
I think that most users of clang would prefer to use Thumb(2) than<br>
ARM, although how to make change globally and give people enough<br>
warning could be challenging and we'd need to get a consensus from the<br>
community. I'd also not want to be the person updating all the tests<br>
with -marm.<br>
<br>
The reset vectors on some old architectures did need to be ARM state,<br>
although I think they had to be written in assembly. It is possible<br>
though that someone is using clang as the assembler driver and we'd<br>
pass through -mthumb when they weren't expecting it.<br>
<span class="x_x_HOEnZb"><font color="#888888"><br>
Peter<br>
</font></span>
<div class="x_x_HOEnZb">
<div class="x_x_h5">On Thu, 15 Nov 2018 at 12:39, Tim Northover via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br>
><br>
> On Thu, 15 Nov 2018 at 12:25, Bruce Hoult <<a href="mailto:brucehoult@sifive.com">brucehoult@sifive.com</a>> wrote:<br>
> > OK, I just checked, and -mcpu=cortex-{m3,m4,m7,a7,a9,<wbr>a15,a53} gives Thumb at -O1, -O1, -Os on the following gcc:<br>
><br>
> If anything I'd be inclined to just default to Thumb always. I haven't<br>
> checked myself, but rumour has it the icache benefits make it faster<br>
> than ARM code as well as smaller in most cases. My one worry there is<br>
> with reset vectors, which I believe must be implemented in ARM in some<br>
> cases; but since GCC itself appears to be inconsistent here, hopefully<br>
> those people are already explicit about their needs.<br>
><br>
> Cheers.<br>
><br>
> Tim.<br>
</div>
</div>
<div class="x_x_HOEnZb">
<div class="x_x_h5">> ______________________________<wbr>_________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">
http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>