AArch64: Fix options canonicalization for assembler
authorTamar Christina <tamar.christina@arm.com>
Fri, 3 Apr 2020 14:18:35 +0000 (15:18 +0100)
committerTamar Christina <tamar.christina@arm.com>
Fri, 3 Apr 2020 14:19:33 +0000 (15:19 +0100)
commit53161358180fdc2c2c21c8f46bbdd339a1fbb8ae
tree1e09e8907db29053e0707bca2dc10ba38baebeaa
parentef6631051d4bb9519f3f0dd5f3b3eadbd67bc10a
AArch64: Fix options canonicalization for assembler

It is currently impossible to use fp16 on any architecture higher than Armv8.3-a
due to a bug in options canonization.  This bug results in the fp16 flag not
being emitted in the assembly when it should have been.

This is caused by a complicated architectural requirement at Armv8.4-a.  On
Armv8.2-a and Armv8.3-a fp16fml is an optional extension and turning it on turns
on both fp and fp16.  However starting with Armv8.4-a fp16fml is mandatory if
fp16 is available, otherwise it's optional.

In short this means that to enable fp16fml the smallest option that needs to
passed to the assembler is Armv8.4-a+fp16.

The fix in this patch takes into account that an option may be on by default in
an architecture, but that not all the bits required to use it are on by default
in an architecture.  In such cases the difference between the two are still
emitted to the assembler.

gcc/ChangeLog:

PR target/94396
* common/config/aarch64/aarch64-common.c
(aarch64_get_extension_string_for_isa_flags): Handle default flags.

gcc/testsuite/ChangeLog:

PR target/94396
* gcc.target/aarch64/options_set_11.c: New test.
* gcc.target/aarch64/options_set_12.c: New test.
* gcc.target/aarch64/options_set_13.c: New test.
* gcc.target/aarch64/options_set_14.c: New test.
* gcc.target/aarch64/options_set_15.c: New test.
* gcc.target/aarch64/options_set_16.c: New test.
* gcc.target/aarch64/options_set_17.c: New test.
* gcc.target/aarch64/options_set_18.c: New test.
* gcc.target/aarch64/options_set_19.c: New test.
* gcc.target/aarch64/options_set_20.c: New test.
* gcc.target/aarch64/options_set_21.c: New test.
* gcc.target/aarch64/options_set_22.c: New test.
* gcc.target/aarch64/options_set_23.c: New test.
* gcc.target/aarch64/options_set_24.c: New test.
* gcc.target/aarch64/options_set_25.c: New test.
* gcc.target/aarch64/options_set_26.c: New test.
19 files changed:
gcc/ChangeLog
gcc/common/config/aarch64/aarch64-common.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/options_set_11.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/options_set_12.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/options_set_13.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/options_set_14.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/options_set_15.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/options_set_16.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/options_set_17.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/options_set_18.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/options_set_19.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/options_set_20.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/options_set_21.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/options_set_22.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/options_set_23.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/options_set_24.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/options_set_25.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/options_set_26.c [new file with mode: 0644]