]> git.ipfire.org Git - thirdparty/gcc.git/commit
[arm] Allow the summation result of signed add-with-overflow to be discarded.
authorrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Oct 2019 19:04:30 +0000 (19:04 +0000)
committerrearnsha <rearnsha@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Oct 2019 19:04:30 +0000 (19:04 +0000)
commit8aefed8a7d12c7f357f58bd94e5170aa0d3ddbae
treea05d2a014c9ad429bbdef51155c9ff57d92fab77
parentd302ef3a830e433eb2326e59078cd2adf31483bf
[arm] Allow the summation result of signed add-with-overflow to be discarded.

This patch matches the signed add-with-overflow patterns when the
summation itself is dropped.  In this case we can use CMN (or CMP with
some immediates).  There are a small number of constants in thumb2
where this can result in less dense code (as we lack 16-bit CMN with
immediate patterns).  To handle this we use peepholes to try these
alternatives when either a scratch is available (0 <= i <= 7) or the
original register is dead (0 <= i <= 255).  We don't use a scratch in
the pattern as if those conditions are not satisfied then the 32-bit
form is preferable to forcing a reload.

* config/arm/arm.md (addsi3_compareV_reg_nosum): New insn.
(addsi3_compareV_imm_nosum): New insn.  Also add peephole2 patterns
to transform this back into the summation version when that leads
to smaller code.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@277185 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/arm/arm.md