diff options
author | Jan Beulich <jbeulich@novell.com> | 2018-07-31 10:57:09 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2018-07-31 10:57:09 +0200 |
commit | ae2387feae3f0798dd77c98a7107fdec38a99fe3 (patch) | |
tree | b9ef25903fb7b2c2bb8385c521c0d6faf2c7411f /gas | |
parent | fa77b93ab76cae42e9394592d7474c795bb28f7e (diff) | |
download | gdb-ae2387feae3f0798dd77c98a7107fdec38a99fe3.zip gdb-ae2387feae3f0798dd77c98a7107fdec38a99fe3.tar.gz gdb-ae2387feae3f0798dd77c98a7107fdec38a99fe3.tar.bz2 |
x86: fold various AVX512 templates with so far differing Masking attributes
There's no insn allowing ZEROING_MASKING alone. Re-purpose its value for
handling the not uncommon case of insns allowing either form of masking
with register operands, but only merging masking with a memory operand.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 38 |
2 files changed, 37 insertions, 6 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index ff34836..4472821 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,10 @@ 2018-07-31 Jan Beulich <jbeulich@suse.com> + * config/tc-i386.c (check_VecOperands): Convert masking handling + to switch(), to deal with DYNAMIC_MASKING. + +2018-07-31 Jan Beulich <jbeulich@suse.com> + * testsuite/gas/i386/inval-avx512f.s: Add invalid zeroing- masking tests. * testsuite/gas/i386/inval-avx512f.l: Adjust expectations. diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 438bae9..8761e97 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -5241,13 +5241,39 @@ check_VecOperands (const insn_template *t) op = MAX_OPERANDS - 1; /* Avoid uninitialized variable warning. */ /* Check if requested masking is supported. */ - if (i.mask - && (!t->opcode_modifier.masking - || (i.mask->zeroing - && t->opcode_modifier.masking == MERGING_MASKING))) + if (i.mask) { - i.error = unsupported_masking; - return 1; + switch (t->opcode_modifier.masking) + { + case BOTH_MASKING: + break; + case MERGING_MASKING: + if (i.mask->zeroing) + { + case 0: + i.error = unsupported_masking; + return 1; + } + break; + case DYNAMIC_MASKING: + /* Memory destinations allow only merging masking. */ + if (i.mask->zeroing && i.mem_operands) + { + /* Find memory operand. */ + for (op = 0; op < i.operands; op++) + if (i.types[op].bitfield.mem) + break; + gas_assert (op < i.operands); + if (op == i.operands - 1) + { + i.error = unsupported_masking; + return 1; + } + } + break; + default: + abort (); + } } /* Check if masking is applied to dest operand. */ |