This series also fixes a couple of minor bugs.
I've made all the changes Richard requested against v1, and will push this if
it passes testing.
Each commit has again been built and tested with:
RUNTESTFLAGS="aarch64.exp=feature-*\ spellcheck*\ mv*\ arch-diag*\ cpu-diag*\
target_attr_crypto_ice*\ aarch64-cpunative.exp=* dg.exp=march.c\ mtune.c"
and I'm currently rerunning bootstrap/regression checks on the whole series.
Changes in v2:
- Renamed structs *_info -> aarch64_*_info.
- Outline hint printing code into aarch64_print_hint_candidates.
- Renamed MARCH_REWRITE_SPEC* -> AARCH64_REWRITE_SPEC*.
- Combine the -march/-mcpu spec rules into a single rule.
On that last point:
> I suppose the way of handling both Tamar's change and yours would be
> something like:
>
> "%{march=*:-march=%:rewrite_march(%{march=*:%*})" \
> ";:%{mcpu=*:-march=%:rewrite_mcpu(%{mcpu=*:%*})}}"
>
> (untested).
I found it rather hard to parse this suggestion (more so than the existing
spec rules), mostly because I misread the bracketing. I was considering
sticking with my original patch (but with the order of the lines swapped),
until I realised that I could instead use the slightly simpler:
"%{march=*:-march=%:rewrite_march(%{march=*:%*});" \
"mcpu=*:-march=%:rewrite_mcpu(%{mcpu=*:%*})}}"
To clarify the differences for anyone not familiar with spec rule syntax, I've
listed approximately equivalent C code below:
My original patch (applied on top of Tamar's change):
if (!march)
if (mcpu)
rewrite_mcpu()
if (march)
rewrite_march()
Richard's suggestion:
if (march)
rewrite_march()
else if (true)
if (mcpu)
rewrite_mcpu()
My current patch:
if (march)
rewrite_march()
else if (mcpu)
rewrite_mcpu()