diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2021-04-30 10:15:26 +0200 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2021-04-30 10:16:30 +0200 |
commit | c111f6066043d3b7bc4141ca0411eae9294aa6c5 (patch) | |
tree | 939d67a66c9ca4f2fe200f34ee1168a88171c97a /gcc/expr.c | |
parent | 4cf3b10f27b1994cf4a9eb12079d85412ebc7cad (diff) | |
download | gcc-c111f6066043d3b7bc4141ca0411eae9294aa6c5.zip gcc-c111f6066043d3b7bc4141ca0411eae9294aa6c5.tar.gz gcc-c111f6066043d3b7bc4141ca0411eae9294aa6c5.tar.bz2 |
i386: Introduce reversed ADC and SBB patterns [PR98060]
The compiler is able to merge LTU comparisons with PLUS or MINUS pattern to
form addition with carry (ADC) and subtraction with borrow (SBB) instructions:
op = op + carry [ADC $0, op]
op = op - carry [SBB $0, op]
The patch introduces reversed ADC and SBB insn patterns:
op = op + !carry [SBB $-1, op]
op = op - !carry [ADC $-1, op]
allowing the compiler to also merge GEU comparisons.
2021-04-30 Uroš Bizjak <ubizjak@gmail.com>
gcc/
PR target/98060
* config/i386/i386.md (*add<mode>3_carry_0r): New insn pattern.
(*addsi3_carry_zext_0r): Ditto.
(*sub<mode>3_carry_0): Ditto.
(*subsi3_carry_zext_0r): Ditto.
* config/i386/predicates.md (ix86_carry_flag_unset_operator):
New predicate.
* config/i386/i386.c (ix86_rtx_costs) <case PLUS, case MINUS>:
Also consider ix86_carry_flag_unset_operator to calculate
the cost of adc/sbb insn.
gcc/testsuite/
PR target/98060
* gcc.target/i386/pr98060.c: New test.
Diffstat (limited to 'gcc/expr.c')
0 files changed, 0 insertions, 0 deletions