<div dir="ltr">Hi Renato,<div><br></div><div>Thanks for your reply. Below is my comments.<br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-30 19:45 GMT+08:00 Renato 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">On 30 June 2014 11:34, Kevin Qin <<a href="mailto:kevinqindev@gmail.com" target="_blank">kevinqindev@gmail.com</a>> wrote:<br>


> 2. Get "-mfpu" deprecated.<br>
<br>
You can't just remove it. Other tools (and thus build systems) may<br>
have them and we should try to be reasonably compatible.<br>
<br>
Adding a warning would be a good first step, though.<br></blockquote><div>I only got it removed from AArch64 target. Gcc has deprecated this option for a while, and I don't know any tools or build systems reply on this option. If there's <span style="color:rgb(50,50,50);font-family:Arial,宋体,微软雅黑;font-size:14px;line-height:16px;white-space:nowrap">demand of this option, I can add it back and provide a warning on it, just like "-mcpu".</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">
<div><br>
<br>
> 3. Implement support of "-march". Usage is: "-march=armv8-a+[no]feature". For instance, "-march=armv8-a+neon+crc+nocrypto".  Here "armv8-a" is necessary, and CPU names are not acceptable.  Candidate features are fp, neon,  crc and crypto.<br>


<br>
</div>I like this.<br>
<div><br>
<br>
> 4. Implement support of "-mtune". Usage is: "-march=CPU_NAME". For instance, "-march=cortex-a57". This option will ONLY get micro-architecture level feature enabled specifying to target CPU, like "zcm" and "zcz" for cyclone. Any architecture features WON'T be modified.<br>


<br>
</div>That's not what -mtune is. According to GCC's manual: "Tune to<br>
cpu-type everything applicable about the generated code, except for<br>
the ABI and the set of available instructions."<br>
<br>
The difference between -mcup and -mtune is that the former selects ABI<br>
and ISAs supported by the CPU, while the former doesn't. This is<br>
particularly important if you want to run the code on a newer CPU but<br>
doesn't want to break older ones, so you can't use instructions that<br>
the old ones don't have, but you can optimise for the pipeline and<br>
branch decisions of the newer CPU, as long as it just slows down the<br>
older ones.<br></blockquote><div>I didn't explain it clearly. Your point is totally what I did in this patch. I emphasize " ONLY get micro-architecture level feature enabled" is want to say ISA won't be changed by this option. This option is to select target CPU to optimize for, including enabling micro-architecture level feature, choosing MI scheduler and triggering any optimizations specific for target.</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><br>
<br>
> 5. Change usage of "-mcpu" to "-mcpu=CPU_NAME+[no]feature", which is an alias to "-march={feature of CPU_NAME}+[no]feature" and "-mtune=CPU_NAME" together. An warning is added to discourage use of this option.<br>


<br>
</div>I find this one redundant with -march and don't think we should add<br>
deprecated features. -mcpu is the flag you want for the behaviour<br>
you've done -mtune above. AFAIK, we don't have the infrastructure to<br>
implement -mtune yet. Also, the driver is a bit bonkers when going<br>
from CPU to Arch from a different arch than the host without using<br>
-target (which is the point with -march, I guess).<br>
<br>
I don't think -mcpu should be used on its own, only in conjunction<br>
with -target or -march.</blockquote><div>In my patch, the difference between "-mcpu" and "-mtune" is that, "-mcpu" will enable all ISAs which target CPU supports, while "-mtune" won't do this. And "-mcpu" can accept extra feature modifiers to make a change, but "-mtune" accepts CPU name only. So "-mcpu" is an shortcut of "-march" and "-tune". Keeping this option alive in clang is because it's still alive in gcc, and may still be used in many projects.  An warning is added to discourage use of this option.</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"> </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>
<br>
> 1. Neon is enabled by default, and "generic" will be used if no CPU type is specified.<br>
<br>
</div>Makes sense to me.<br>
<div><br>
<br>
> 2. For most scenario, Using "-mtune=CPU" only is recommended as neon is enabled by default and all micro-architecture optimizations are selected, and it would provide great compatibility to run on most of AArch64 devices.<br>


<br>
</div>That'd be -mcpu, and we still need -march or -target.<br></blockquote><div>"-target" is still necessary at moment while "-march" can be omitted sometimes, because the settings of default feature can work well for most scenarios and provide good code migration. All I want to do is to get "-mcpu" supporter happy to use "-mtune" instead. They don't need to complain typing too much as splitting "-mcpu" into "-march" and "-mtune" because they can use "-mtune" only. For a standard sets of compiling flags, pair use of "-march" and "-mtune" is strongly recommended. </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><br>
<br>
> 3. "-march" is designed to be used only if user wants to use crc and crypto instructions, or disable fp/neon. So "-march" will not be frequently used and won't bring too much finger burden.<br>


<br>
</div>I thought the idea was to encourage -march... at least on new targets...<br></blockquote><div>Yes, we always encourage people to specifying architecture features via "-march". Letting "-march" and "-mtune" replace "-mcpu" and "-mfpu" is what we want to do.</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">
<span><font color="#888888"><br>
--renato<br>
</font></span></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></div>