aboutsummaryrefslogtreecommitdiff
path: root/libcpp/directives.c
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2019-10-31 16:04:53 +0000
committerRichard Earnshaw <rearnsha@gcc.gnu.org>2019-10-31 16:04:53 +0000
commitd84b9ad53fed75590c3ebc6e38bd49db3b201128 (patch)
treece3b64c8ef2a81cef3e94d237f672cb1df5004d4 /libcpp/directives.c
parent946b4a68b3766ddbdb2290855c5167bd30c933a0 (diff)
downloadgcc-d84b9ad53fed75590c3ebc6e38bd49db3b201128.zip
gcc-d84b9ad53fed75590c3ebc6e38bd49db3b201128.tar.gz
gcc-d84b9ad53fed75590c3ebc6e38bd49db3b201128.tar.bz2
[arm] Pattern match insns for a + ~b + Carry
On ARM, the SBC instruction is defined as Ra - Rb - ~C where C is the carry flag. But -Rb = ~Rb + 1, so this is equivalent to Ra + ~Rb + 1 - ~C which then simplifies to Ra + ~Rb + C which is essentially an add-with-carry with one operand inverted. We can define RTL patterns to match this. In thumb2 we can only match when the operands are both registers, but in Arm state we can also use RSC to match when Rn is either a constant or a shifted operand. This overall simplifies some cases of 64-bit arithmetic, for example, int64_t f (int64_t a, int64_t b) { return a + ~b; } will now compile to MVN R2, R2 ADDS R0, R0, R2 SBC R1, R1, R3 * config/arm/arm.md (add_not_cin): New insn. (add_not_shift_cin): Likewise. From-SVN: r277676
Diffstat (limited to 'libcpp/directives.c')
0 files changed, 0 insertions, 0 deletions