aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-i386.c
diff options
context:
space:
mode:
authorCui, Lili <lili.cui@intel.com>2024-05-06 14:16:13 +0800
committerCui, Lili <lili.cui@intel.com>2024-05-06 18:21:28 +0800
commit0820c9f5fc13047b4b25361d6d3bb0ceb2a611d8 (patch)
treee162ae8ce3c2e1820cb7a3f1d3edde9a9d8bd546 /gas/config/tc-i386.c
parentf2a3a8814da7c18144e517c11ac84ef6799b0534 (diff)
downloadbinutils-0820c9f5fc13047b4b25361d6d3bb0ceb2a611d8.zip
binutils-0820c9f5fc13047b4b25361d6d3bb0ceb2a611d8.tar.gz
binutils-0820c9f5fc13047b4b25361d6d3bb0ceb2a611d8.tar.bz2
x86: Drop SwapSources
gas/ChangeLog: * config/tc-i386.c (build_modrm_byte): Dropped the use of SWAP_SOURCES to encode the vvvv register. opcodes/ChangeLog: * i386-opc.h (SWAP_SOURCES): Dropped. (NO_DEFAULT_MASK): Adjusted the value. (ADDR_PREFIX_OP_REG): Ditto. (DISTINCT_DEST): Ditto. (IMPLICIT_STACK_OP): Ditto. (VexVVVV_SRC2): New. * i386-opc.tbl: Dropped SwapSources and replaced its VexVVVV with Src1VVVV. * i386-tbl.h: Regenerated.
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r--gas/config/tc-i386.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 3d9eaf0..9d50752 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -10439,6 +10439,17 @@ build_modrm_byte (void)
switch (i.tm.opcode_modifier.vexvvvv)
{
+ /* VEX.vvvv encodes the last source register operand. */
+ case VexVVVV_SRC2:
+ if (source != op)
+ {
+ v = source++;
+ break;
+ }
+ /* For vprot*, vpshl*, and vpsha*, XOP.W controls the swapping of src1
+ and src2, and it requires fall through when the operands are swapped.
+ */
+ /* Fall through. */
/* VEX.vvvv encodes the first source register operand. */
case VexVVVV_SRC1:
v = dest - 1;
@@ -10459,14 +10470,6 @@ build_modrm_byte (void)
dest = ~0;
}
gas_assert (source < dest);
- if (i.tm.opcode_modifier.operandconstraint == SWAP_SOURCES
- && source != op)
- {
- unsigned int tmp = source;
-
- source = v;
- v = tmp;
- }
if (v < MAX_OPERANDS)
{