aboutsummaryrefslogtreecommitdiff
path: root/gas/doc
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2019-07-01 08:35:08 +0200
committerJan Beulich <jbeulich@suse.com>2019-07-01 08:35:08 +0200
commit5641ec015a191e0584fd4cae57bb3262f7a51735 (patch)
tree4a0364a281bb459f742a431a19448ef0e76d2083 /gas/doc
parent79dec6b7baa243a4ada018a082491990adb6aec1 (diff)
downloadgdb-5641ec015a191e0584fd4cae57bb3262f7a51735.zip
gdb-5641ec015a191e0584fd4cae57bb3262f7a51735.tar.gz
gdb-5641ec015a191e0584fd4cae57bb3262f7a51735.tar.bz2
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.
Diffstat (limited to 'gas/doc')
-rw-r--r--gas/doc/c-i386.texi3
1 files changed, 2 insertions, 1 deletions
diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi
index 2ceb594..e0d0bc9 100644
--- a/gas/doc/c-i386.texi
+++ b/gas/doc/c-i386.texi
@@ -477,7 +477,8 @@ instructions with 128-bit/256-bit VEX packed integer logical.
EVEX vector register clearing instructions. In 64-bit mode VEX encoded
instructions with commutative source operands will also have their
source operands swapped if this allows using the 2-byte VEX prefix form
-instead of the 3-byte one.
+instead of the 3-byte one. Certain forms of AND as well as OR with the
+same (register) operand specified twice will also be changed to TEST.
@samp{-Os} includes @samp{-O2} optimization plus encodes 16-bit, 32-bit
and 64-bit register tests with immediate as 8-bit register test with