aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-07-02 06:30:00 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-07-02 08:46:48 -0700
commitc2ecccb33c307faa21f4d2f47348e7346b032d94 (patch)
treebbf59bb652aa85aa0f254538e6054db5117c51d0 /gas/config
parentf436f38e7dff19b0d80bf62a58edd98697242108 (diff)
downloadfsf-binutils-gdb-c2ecccb33c307faa21f4d2f47348e7346b032d94.zip
fsf-binutils-gdb-c2ecccb33c307faa21f4d2f47348e7346b032d94.tar.gz
fsf-binutils-gdb-c2ecccb33c307faa21f4d2f47348e7346b032d94.tar.bz2
x86: Add SwapSources
We check register-only source operand to decide if two source operands of VEX encoded instructions should be swapped. But source operands in AMX instructions with two source operands swapped are all register-only operand. Add SwapSources to indicate two source operands should be swapped. gas/ * config/tc-i386.c (build_modrm_byte): Check vexswapsources to swap two source operands. opcodes/ * i386-gen.c (opcode_modifiers): Add VexSwapSources. * i386-opc.h (VexSwapSources): New. (i386_opcode_modifier): Add vexswapsources. * i386-opc.tbl: Add VexSwapSources to BMI2 and BMI instructions with two source operands swapped. * i386-tbl.h: Regenerated.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 46823e2..2e0eb24 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -7884,10 +7884,8 @@ build_modrm_byte (void)
i386_operand_type op;
unsigned int vvvv;
- /* Check register-only source operand when two source
- operands are swapped. */
- if (!i.tm.operand_types[source].bitfield.baseindex
- && i.tm.operand_types[dest].bitfield.baseindex)
+ /* Swap two source operands if needed. */
+ if (i.tm.opcode_modifier.swapsources)
{
vvvv = source;
source = dest;