arm: Implement Armv8.1-M low overhead loops
authorAndrea Corallo <andrea.corallo@arm.com>
Tue, 26 May 2020 16:47:13 +0000 (17:47 +0100)
committerAndrea Corallo <andrea.corallo@arm.com>
Fri, 10 Jul 2020 11:20:34 +0000 (13:20 +0200)
commitd2ed233cb940aa3eecc163d98b47979dd81dbc0a
treef24fa6e52fba1ed1cd9312fe5d569c5896b0eb67
parentc4fc6a3e0a209e01d0f223ca9987f93083f89882
arm: Implement Armv8.1-M low overhead loops

gcc/ChangeLog

2020-06-18  Andrea Corallo  <andrea.corallo@arm.com>
    Mihail-Calin Ionescu  <mihail.ionescu@arm.com>
    Iain Apreotesei  <iain.apreotesei@arm.com>

* config/arm/arm-protos.h (arm_target_insn_ok_for_lob): New
prototype.
* config/arm/arm.c (TARGET_INVALID_WITHIN_DOLOOP): Define.
(arm_invalid_within_doloop): Implement invalid_within_doloop hook.
(arm_target_insn_ok_for_lob): New function.
* config/arm/arm.h (TARGET_HAVE_LOB): Define macro.
* config/arm/thumb2.md (*doloop_end_internal, doloop_begin)
(dls_insn): Add new patterns.
(doloop_end): Modify to select LR when LOB is available.
* config/arm/unspecs.md: Add new unspec.
* doc/sourcebuild.texi (arm_v8_1_lob_ok)
(arm_thumb2_ok_no_arm_v8_1_lob): Document new target supports
options.

gcc/testsuite/ChangeLog

2020-06-18  Andrea Corallo  <andrea.corallo@arm.com>
    Mihail-Calin Ionescu  <mihail.ionescu@arm.com>
    Iain Apreotesei  <iain.apreotesei@arm.com>

* gcc.target/arm/lob.h: New header.
* gcc.target/arm/lob1.c: New testcase.
* gcc.target/arm/lob2.c: Likewise.
* gcc.target/arm/lob3.c: Likewise.
* gcc.target/arm/lob4.c: Likewise.
* gcc.target/arm/lob5.c: Likewise.
* gcc.target/arm/lob6.c: Likewise.
* gcc.target/arm/unsigned-extend-2.c: Do not run when generating
low loop overhead.
* gcc.target/arm/ivopts.c: Fix check for low loop overhead.
* lib/target-supports.exp (check_effective_target_arm_v8_1_lob)
(check_effective_target_arm_thumb2_ok_no_arm_v8_1_lob): New procs.
16 files changed:
gcc/config/arm/arm-protos.h
gcc/config/arm/arm.c
gcc/config/arm/arm.h
gcc/config/arm/thumb2.md
gcc/config/arm/unspecs.md
gcc/doc/sourcebuild.texi
gcc/testsuite/gcc.target/arm/ivopts.c
gcc/testsuite/gcc.target/arm/lob.h [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/lob1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/lob2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/lob3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/lob4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/lob5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/lob6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/arm/unsigned-extend-2.c
gcc/testsuite/lib/target-supports.exp