x86: optimize AND/OR with twice the same register
authorJan Beulich <jbeulich@suse.com>
Mon, 1 Jul 2019 06:35:08 +0000 (08:35 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 1 Jul 2019 06:35:08 +0000 (08:35 +0200)
commit5641ec015a191e0584fd4cae57bb3262f7a51735
tree4a0364a281bb459f742a431a19448ef0e76d2083
parent79dec6b7baa243a4ada018a082491990adb6aec1
x86: optimize AND/OR with twice the same register

It seems to be not uncommon for people to use AND or OR in this form for
just setting the status flags. TEST, which doesn't write to any
register other than EFLAGS, ought to be preferred. Make the change only
for -O2 and above though, at least for now.
13 files changed:
gas/ChangeLog
gas/config/tc-i386.c
gas/doc/c-i386.texi
gas/testsuite/gas/i386/i386.exp
gas/testsuite/gas/i386/optimize-2.d
gas/testsuite/gas/i386/optimize-2.s
gas/testsuite/gas/i386/optimize-2b.d [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-optimize-3.d
gas/testsuite/gas/i386/x86-64-optimize-3.s
gas/testsuite/gas/i386/x86-64-optimize-3b.d [new file with mode: 0644]
opcodes/ChangeLog
opcodes/i386-opc.tbl
opcodes/i386-tbl.h