aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-09-13 06:12:31 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-09-13 06:12:31 -0700
commit79f0fa25b95fd82122ee76d61fded661cc3ece87 (patch)
tree6a00f3583a867b6f5e4a60ed2268801e03e8ead7 /gas/config
parent57f6375ec10415fc26bbfaf4fdc19effb313a06d (diff)
downloadgdb-79f0fa25b95fd82122ee76d61fded661cc3ece87.zip
gdb-79f0fa25b95fd82122ee76d61fded661cc3ece87.tar.gz
gdb-79f0fa25b95fd82122ee76d61fded661cc3ece87.tar.bz2
x86: Swap destination/source to encode VEX only if possible
When encoding VEX, we can swap destination and source only if there are more than 1 register operand. * config/tc-i386.c (build_vex_prefix): Swap destination and source only if there are more than 1 register operand.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 2bff48a..40b4583 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -3364,9 +3364,10 @@ build_vex_prefix (const insn_template *t)
else
register_specifier = 0xf;
- /* Use 2-byte VEX prefix by swapping destination and source
- operand. */
- if (i.vec_encoding != vex_encoding_vex3
+ /* Use 2-byte VEX prefix by swapping destination and source operand
+ if there are more than 1 register operand. */
+ if (i.reg_operands > 1
+ && i.vec_encoding != vex_encoding_vex3
&& i.dir_encoding == dir_encoding_default
&& i.operands == i.reg_operands
&& operand_type_equal (&i.types[0], &i.types[i.operands - 1])