aarch64: Add SVE support for -mlow-precision-sqrt
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 19 Feb 2020 17:22:14 +0000 (17:22 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Fri, 21 Feb 2020 10:17:31 +0000 (10:17 +0000)
commita0ee8352df6f4cd98830c8dbaa969e1cda39cc40
tree4ca1ffbd94cbe5d750ce2f40609cdc8476d2ab82
parent04f307cbb9e0610b2e3c70029ee6bfdbd7b8b9de
aarch64: Add SVE support for -mlow-precision-sqrt

SVE was missing support for -mlow-precision-sqrt, which meant that
-march=armv8.2-a+sve -mlow-precision-sqrt could cause a performance
regression compared to -march=armv8.2-a -mlow-precision-sqrt.

2020-02-21  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* config/aarch64/aarch64.c (aarch64_emit_approx_sqrt): Add SVE
support.  Use aarch64_emit_mult instead of emitting multiplication
instructions directly.
* config/aarch64/aarch64-sve.md (sqrt<mode>2, rsqrt<mode>2)
(@aarch64_rsqrte<mode>, @aarch64_rsqrts<mode>): New expanders.

gcc/testsuite/
* gcc.target/aarch64/sve/rsqrt_1.c: New test.
* gcc.target/aarch64/sve/rsqrt_1_run.c: Likewise.
* gcc.target/aarch64/sve/sqrt_1.c: Likewise.
* gcc.target/aarch64/sve/sqrt_1_run.c: Likewise.
gcc/ChangeLog
gcc/config/aarch64/aarch64-sve.md
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/iterators.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/sve/rsqrt_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/rsqrt_1_run.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/sqrt_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/sqrt_1_run.c [new file with mode: 0644]