]> git.ipfire.org Git - thirdparty/gcc.git/commit
[arm] Implement negscc using SBC when appropriate.
authorrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Oct 2019 19:03:11 +0000 (19:03 +0000)
committerrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Oct 2019 19:03:11 +0000 (19:03 +0000)
commit01089cc74345278016eb2bc21ed8d5589f4aafac
treef7fb49934234207a982110dc635c074c39ae023e
parent7d9d197154362f5397ed5bc4b279255422fff6bc
[arm] Implement negscc using SBC when appropriate.

When the carry flag is appropriately set by a comprison, negscc
patterns can expand into a simple SBC of a register with itself.  This
means we can convert two conditional instructions into a single
non-conditional instruction.  Furthermore, in Thumb2 we can avoid the
need for an IT instruction as well.  This patch also fixes the remaining
testcase that we initially XFAILed in the first patch of this series.

gcc:
* config/arm/arm.md (negscc_borrow): New pattern.
(mov_negscc): Don't split if the insn would match negscc_borrow.
* config/arm/thumb2.md (thumb2_mov_negscc): Likewise.
(thumb2_mov_negscc_strict_it): Likewise.

testsuite:
* gcc.target/arm/negdi-3.c: Remove XFAIL markers.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@277175 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/arm/arm.md
gcc/config/arm/thumb2.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/negdi-3.c