diff options
author | Richard Earnshaw <rearnsha@arm.com> | 2019-10-18 19:04:46 +0000 |
---|---|---|
committer | Richard Earnshaw <rearnsha@gcc.gnu.org> | 2019-10-18 19:04:46 +0000 |
commit | a79048f6250febc1acce09d790035276d534e754 (patch) | |
tree | f1e52a3111c47fb41bbec05a282a1f88a986cbd6 /gcc/tree.c | |
parent | fa62df0e600ef617bce549d64026c0e5cc817c31 (diff) | |
download | gcc-a79048f6250febc1acce09d790035276d534e754.zip gcc-a79048f6250febc1acce09d790035276d534e754.tar.gz gcc-a79048f6250febc1acce09d790035276d534e754.tar.bz2 |
[arm] Improve constant handling for usubvsi4.
This patch improves the expansion of usubvsi4 by allowing suitable
constants to be passed directly. Unlike normal subtraction, either
operand may be a constant (and indeed I have seen cases where both can
be with LTO enabled). One interesting testcase that improves as a
result of this is:
unsigned f6 (unsigned a)
{
unsigned x;
return __builtin_sub_overflow (5U, a, &x) ? 0 : x;
}
Which previously compiled to:
rsbs r3, r0, #5
cmp r0, #5
movls r0, r3
movhi r0, #0
but now generates the optimal sequence:
rsbs r0, r0, #5
movcc r0, #0
* config/arm/arm.md (usubv<mode>4): Delete expansion.
(usubvsi4): New pattern. Allow some immediate values for inputs.
(usubvdi4): New pattern.
From-SVN: r277187
Diffstat (limited to 'gcc/tree.c')
0 files changed, 0 insertions, 0 deletions