From 4eb59a5243cbca011c58274a20235a163243f97f Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 6 Sep 2024 08:35:42 +0200 Subject: x86/APX: use D for 2-operand CFCMOVcc There's no need to have 30 redundant templates when we can easily take care of the operand swapping like we do for various other insns. --- gas/config/tc-i386.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gas') diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 50c6f03..6cd57d9 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -8878,7 +8878,10 @@ match_template (char mnem_suffix) found_reverse_match = Opcode_D; goto check_operands_345; } - else if (t->opcode_modifier.commutative) + else if (t->opcode_modifier.commutative + /* CFCMOVcc also wants its major opcode unaltered. */ + || (t->opcode_space == SPACE_EVEXMAP4 + && (t->base_opcode | 0xf) == 0x4f)) found_reverse_match = ~0; else if (t->opcode_space != SPACE_BASE && (t->opcode_space != SPACE_EVEXMAP4 @@ -9178,6 +9181,9 @@ match_template (char mnem_suffix) /* Fall through. */ case ~0: + if (i.tm.opcode_space == SPACE_EVEXMAP4 + && !t->opcode_modifier.commutative) + i.tm.opcode_modifier.operandconstraint = EVEX_NF; i.tm.operand_types[0] = operand_types[i.operands - 1]; i.tm.operand_types[i.operands - 1] = operand_types[0]; break; -- cgit v1.1