aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2021-04-29 22:02:00 +0200
committerUros Bizjak <ubizjak@gmail.com>2021-04-29 22:03:06 +0200
commit86403f4e6e5f72169147aca7e0d0b63e303ad5cd (patch)
tree126a8a19c90472c45a96fb967146c23f7998d91b /libcpp
parentb24d8acbfffe30f40e280f11f23adac81b1e7f0c (diff)
downloadgcc-86403f4e6e5f72169147aca7e0d0b63e303ad5cd.zip
gcc-86403f4e6e5f72169147aca7e0d0b63e303ad5cd.tar.gz
gcc-86403f4e6e5f72169147aca7e0d0b63e303ad5cd.tar.bz2
i386: Optimize carry flag comparisons a bit
In ix86_int_compare, opportunistically swap operands of GTU and LEU comparisons to emit carry flag comparison, with the expectation that the comparison will combine to *add<mode>3_carry_0 or *sub<mode>3_carry_0 insn pattern. Do not use ix86_expand_carry_flag_compare because this function prefers carry flag comparisons too much - it forces the constants into registers and/or emits additional arithmetic instructions to convert simple comparisons into carry flag comparisons - but simply swap operands to convert GTU and LEU comparisons into GEU and LTU ones. Also, change the insn predicates of *add<mode>3_carry_0 and *sub<mode>3_carry_0 insn patterns to allow more combine opportunities with memory operands. 2021-04-29 Uroš Bizjak <ubizjak@gmail.com> gcc/ * config/i386/i386-expand.c (ix86_expand_int_compare): Swap operands of GTU and LEU comparison to emit carry flag comparison. * config/i386/i386.md (*add<mode>3_carry_0): Change insn predicate to allow more combine opportunities with memory operands. (*sub<mode>3_carry_0): Ditto.
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions