aarch64: Add SVE support for -mlow-precision-div
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 19 Feb 2020 18:28:48 +0000 (18:28 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Fri, 21 Feb 2020 10:17:30 +0000 (10:17 +0000)
commit04f307cbb9e0610b2e3c70029ee6bfdbd7b8b9de
treededb8e3ec29d23564e4cd873b789139102f439a0
parentd87778ed097f24a0bf394c0255019547008c3479
aarch64: Add SVE support for -mlow-precision-div

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

I ended up doing this much later than originally intended, sorry...

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

gcc/
* config/aarch64/aarch64.c (aarch64_emit_mult): New function.
(aarch64_emit_approx_div): Add SVE support.  Use aarch64_emit_mult
instead of emitting multiplication instructions directly.
* config/aarch64/iterators.md (SVE_COND_FP_BINARY_OPTAB): New iterator.
* config/aarch64/aarch64-sve.md (div<mode>3, @aarch64_frecpe<mode>)
(@aarch64_frecps<mode>): New expanders.

gcc/testsuite/
* gcc.target/aarch64/sve/recip_1.c: New test.
* gcc.target/aarch64/sve/recip_1_run.c: Likewise.
* gcc.target/aarch64/sve/recip_2.c: Likewise.
* gcc.target/aarch64/sve/recip_2_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/recip_1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/recip_1_run.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/recip_2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/sve/recip_2_run.c [new file with mode: 0644]