diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-07-28 10:42:47 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-07-28 10:42:47 -0700 |
commit | fc141319027485a7cfcbae2451b048ddc6c33b48 (patch) | |
tree | 7dc2fd46fdb0412ceeba96151391899c3c08f10e /gas/config | |
parent | 7dc37e1e1209c80e0bab784df6b6bac335e836f2 (diff) | |
download | fsf-binutils-gdb-fc141319027485a7cfcbae2451b048ddc6c33b48.zip fsf-binutils-gdb-fc141319027485a7cfcbae2451b048ddc6c33b48.tar.gz fsf-binutils-gdb-fc141319027485a7cfcbae2451b048ddc6c33b48.tar.bz2 |
x86: Simplify check for distinct TMM register operands
If any pair of operands in AMX instructions with 3 TMM register operands
are the same, the instruction will UD. Don't call register_number to
check for distinct TMM register operands since all TMM register operands
have the same size.
* config/tc-i386.c (check_VecOperands): Remove register_number
call when checking for distinct TMM register operands.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-i386.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index d98c6c4..1235c3e 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -6076,21 +6076,16 @@ check_VecOperands (const insn_template *t) } } - /* For AMX instructions with three tmmword operands, all tmmword operand must be - distinct */ - if (t->operand_types[0].bitfield.tmmword - && i.reg_operands == 3) - { - if (register_number (i.op[0].regs) - == register_number (i.op[1].regs) - || register_number (i.op[0].regs) - == register_number (i.op[2].regs) - || register_number (i.op[1].regs) - == register_number (i.op[2].regs)) - { - i.error = invalid_tmm_register_set; - return 1; - } + /* For AMX instructions with 3 TMM register operands, all operands + must be distinct. */ + if (i.reg_operands == 3 + && t->operand_types[0].bitfield.tmmword + && (i.op[0].regs == i.op[1].regs + || i.op[0].regs == i.op[2].regs + || i.op[1].regs == i.op[2].regs)) + { + i.error = invalid_tmm_register_set; + return 1; } /* Check if broadcast is supported by the instruction and is applied |