aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-03-08 06:41:34 -0800
committerH.J. Lu <hjl.tools@gmail.com>2018-03-08 06:41:34 -0800
commitd3d50934a9101416c3106497d6ea9ce548760253 (patch)
tree1f8b1ad5d7b7052323ac1a0d51ef61e189a736f2 /gas/testsuite
parent347a87745eab23d8427349787bde4a938a1e8c3e (diff)
downloadgdb-d3d50934a9101416c3106497d6ea9ce548760253.zip
gdb-d3d50934a9101416c3106497d6ea9ce548760253.tar.gz
gdb-d3d50934a9101416c3106497d6ea9ce548760253.tar.bz2
x86-64: Also optimize "clr reg64"
"clr reg" is an alias of "xor reg, reg". We can encode "clr reg64" as "xor reg32, reg32". gas/ * config/tc-i386.c (optimize_encoding): Also encode "clr reg64" as "xor reg32, reg32". * testsuite/gas/i386/x86-64-optimize-1.s: Add "clr reg64" tests. * testsuite/gas/i386/x86-64-optimize-1.d: Updated. opcodes/ * i386-opc.tbl: Add Optimize to clr. * i386-tbl.h: Regenerated.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/i386/x86-64-optimize-1.d2
-rw-r--r--gas/testsuite/gas/i386/x86-64-optimize-1.s2
2 files changed, 4 insertions, 0 deletions
diff --git a/gas/testsuite/gas/i386/x86-64-optimize-1.d b/gas/testsuite/gas/i386/x86-64-optimize-1.d
index 506d586..f7fd1be 100644
--- a/gas/testsuite/gas/i386/x86-64-optimize-1.d
+++ b/gas/testsuite/gas/i386/x86-64-optimize-1.d
@@ -50,4 +50,6 @@ Disassembly of section .text:
+[a-f0-9]+: b8 ff 03 00 00 mov \$0x3ff,%eax
+[a-f0-9]+: 48 b8 00 00 00 00 01 00 00 00 movabs \$0x100000000,%rax
+[a-f0-9]+: 48 b8 00 00 00 00 01 00 00 00 movabs \$0x100000000,%rax
+ +[a-f0-9]+: 31 c0 xor %eax,%eax
+ +[a-f0-9]+: 45 31 f6 xor %r14d,%r14d
#pass
diff --git a/gas/testsuite/gas/i386/x86-64-optimize-1.s b/gas/testsuite/gas/i386/x86-64-optimize-1.s
index 2c6dc6d..15d8cb0 100644
--- a/gas/testsuite/gas/i386/x86-64-optimize-1.s
+++ b/gas/testsuite/gas/i386/x86-64-optimize-1.s
@@ -45,3 +45,5 @@ _start:
movq $1023,%rax
mov $0x100000000,%rax
movq $0x100000000,%rax
+ clrq %rax
+ clrq %r14