<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-07-01 16:17 GMT+08:00 Linaro Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="">On 1 July 2014 04:05, Kevin Qin <<a href="mailto:kevinqindev@gmail.com">kevinqindev@gmail.com</a>> wrote:<br>

> I only got it removed from AArch64 target. Gcc has deprecated this option<br>
> for a while, and I don't know any tools or build systems reply on this<br>
> option. If there's demand of this option, I can add it back and provide a<br>
> warning on it, just like "-mcpu".<br>
<br>
</div>Deprecated or removed? I'd be surprised if the latter.<br>
<br>
I'm not expecting new software to use deprecated options, but old<br>
build systems that can be made to build on AArch64 by just changing<br>
the triple will still use all the legacy options in hidden places<br>
which will extend the usage of -mcpu well beyond AArch64.<br>
<div class=""><br></div></blockquote><div>It's deprecated. Any use of "-mfpu" on AArch64 target will provide an warning "argument unused during compilation" and won't block compiling process. So most build systems can still work well except receiving a lot of warnings. </div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="">
> I didn't explain it clearly. Your point is totally what I did in this patch.<br>
> I emphasize " ONLY get micro-architecture level feature enabled" is want to<br>
> say ISA won't be changed by this option. This option is to select target CPU<br>
> to optimize for, including enabling micro-architecture level feature,<br>
> choosing MI scheduler and triggering any optimizations specific for target.<br>
<br>
</div>Oh, I see. My bad.<br>
<div class=""><br>
<br>
> In my patch, the difference between "-mcpu" and "-mtune" is that, "-mcpu"<br>
> will enable all ISAs which target CPU supports, while "-mtune" won't do<br>
> this.<br>
<br>
</div>This is correct.<br>
<div class=""><br>
<br>
> And "-mcpu" can accept extra feature modifiers to make a change, but<br>
> "-mtune" accepts CPU name only.<br>
<br>
</div>This is new, and since we're trying to discourage the usage of -mcpu,<br>
a little in the wrong direction. We shouldn't make it *more*<br>
convenient for people to use -mcpu...<br>
<div class=""></div></blockquote><div><br></div><div>It's to get compatible with gcc. And one day if there's multiple versions of a cpu with different architectural extensions, this kind of modifier can help to make a choice. </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""> <br></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="">
> So "-mcpu" is an shortcut of "-march" and "-tune".<br>
<br>
</div>Which seems to be the case in GCC, too.<br>
<div class=""><br>
<br>
> Keeping this option alive in clang is because it's still alive in<br>
> gcc, and may still be used in many projects.  An warning is added to<br>
> discourage use of this option.<br>
<br>
</div>I agree with this, but if GCC doesn't have the features in -mcpu, I<br>
don't think we should add it, since the only reason we do is for<br>
compatibility with legacy GCC options.<br></blockquote><div>Gcc can accept "-mcpu" with modifiers. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div class=""><br>
<br>
> They don't need to complain<br>
> typing too much as splitting "-mcpu" into "-march" and "-mtune" because they<br>
> can use "-mtune" only.<br>
<br>
</div>Maybe they do... :)<br>
<br>
The reason why you need -mcpu is (AFAIK) *only* because you haven't<br>
specified your arch correctly. So, if you specify "-march arm", you'll<br>
need to specify your CPU to generate anything other than ARMv4 code,<br>
since -mtune won't help. If you specify "armv7", you'll need "-mcpu<br>
cortex-m4" to get M-class, and so on. But if you choose "armv7a", you<br>
only need -mtune to make it faster on A9, or "armv7ave" to mean<br>
virt+hdiv, than it's obvious A15-class, which you'll need -mtune to<br>
make it faster on A15 and not A7.<br>
<br>
All in all, -mcpu is redundant if the arch is correct. I believe GCC<br>
understands quite well all the ARM arch strings, and Clang/LLVM should<br>
if it doesn't.<br>
<br>
And with the features in -march (armv7a+noneon), it'd be even less<br>
important to have a "-mcpu tegra3" option.<br>
<br>
Makes sense?<br></blockquote><div><br></div><div>Agreed. If there's more than one architecture available in AArch64 target,  "-march" will be more important than "-mtune", as it is specifying the base ISAs to generate. But it's still reasonable to provide a default architecture and default feature sets if "-march" isn't used. Using "-mtune" only can work well at moment, but I can't <span style="color:rgb(50,50,50);font-family:Arial,宋体,微软雅黑;font-size:14px;line-height:16px;white-space:nowrap">guarantee this when more </span>architecture introducing. So be used to type "-march" is a good <span style="color:rgb(50,50,50);font-family:Arial,宋体,微软雅黑;font-size:14px;line-height:16px;white-space:nowrap">habit. I leave this message here is to </span><span style="color:rgb(50,50,50);font-family:Arial,宋体,微软雅黑;font-size:14px;line-height:16px;white-space:nowrap">attract some lazy user(like me) and provide </span>convenience for some quick experiment<span style="color:rgb(50,50,50);font-family:Arial,宋体,微软雅黑;font-size:14px;line-height:16px;white-space:nowrap">:)</span></div>
<div><span style="color:rgb(50,50,50);font-family:Arial,宋体,微软雅黑;font-size:14px;line-height:16px;white-space:nowrap"><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
cheers,<br>
--renato<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Best Regards,<div><br></div><div>Kevin Qin</div></div>
</div></div>