diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2019-12-16 17:29:09 -0800 |
---|---|---|
committer | Hongtao Liu <liuhongt@gcc.gnu.org> | 2019-12-17 01:29:09 +0000 |
commit | 62dd2904f05ee752bbeff43a196b90ecd7b94616 (patch) | |
tree | 6a5a2ca8520fd7b5c84211a45d663e981d1173fc /gcc/config/i386/x86-tune.def | |
parent | d187dab3873eb9737eb80ba02bb1ae11eae4e133 (diff) | |
download | gcc-62dd2904f05ee752bbeff43a196b90ecd7b94616.zip gcc-62dd2904f05ee752bbeff43a196b90ecd7b94616.tar.gz gcc-62dd2904f05ee752bbeff43a196b90ecd7b94616.tar.bz2 |
Use add for a = a + b and a = b + a when possible.
Since except for Bonnell,
01 fb add %edi,%ebx
is faster and shorter than
8d 1c 1f lea (%rdi,%rbx,1),%ebx
we should use add for a = a + b and a = b + a when possible if not
optimizing for Bonnell.
Tested on x86-64.
2019-12-17 H.J. Lu <hjl.tools@gmail.com>
gcc/
PR target/92807
* config/i386/i386.c (ix86_lea_outperforms): Check !TARGET_BONNELL.
(ix86_avoid_lea_for_addr): When not optimizing for Bonnell, use add
for a = a + b and a = b + a.
gcc/testsuite/
PR target/92807
* gcc.target/i386/pr92807-1.c: New test.
From-SVN: r279451
Diffstat (limited to 'gcc/config/i386/x86-tune.def')
0 files changed, 0 insertions, 0 deletions