aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2019-06-25 09:23:48 +0200
committerJan Beulich <jbeulich@suse.com>2019-06-25 09:35:17 +0200
commitb8364fa775112f036a80e799b70311f69baac131 (patch)
treed08fc20075de209c6f88d158e5d48cd13129a8b3 /gas/config
parent2a410bd1c373d377c221476ccda2156b595e6d6b (diff)
downloadgdb-b8364fa775112f036a80e799b70311f69baac131.zip
gdb-b8364fa775112f036a80e799b70311f69baac131.tar.gz
gdb-b8364fa775112f036a80e799b70311f69baac131.tar.bz2
x86-64: also optimize ANDQ with immediate fitting in 7 bits
The same reasoning applies here as did/does for immediates fitting in 31 bits.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 050c872..3985756 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -3948,7 +3948,10 @@ optimize_encoding (void)
&& i.tm.extension_opcode == 0x4)
|| ((i.tm.base_opcode == 0xf6
|| i.tm.base_opcode == 0xc6)
- && i.tm.extension_opcode == 0x0)))))
+ && i.tm.extension_opcode == 0x0)))
+ || (fits_in_imm7 (i.op[0].imms->X_add_number)
+ && i.tm.base_opcode == 0x83
+ && i.tm.extension_opcode == 0x4)))
|| (i.types[0].bitfield.qword
&& ((i.reg_operands == 2
&& i.op[0].regs == i.op[1].regs
@@ -3962,6 +3965,7 @@ optimize_encoding (void)
{
/* Optimize: -O:
andq $imm31, %r64 -> andl $imm31, %r32
+ andq $imm7, %r64 -> andl $imm7, %r32
testq $imm31, %r64 -> testl $imm31, %r32
xorq %r64, %r64 -> xorl %r32, %r32
subq %r64, %r64 -> subl %r32, %r32