aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2018-03-08 08:51:18 +0100
committerJan Beulich <jbeulich@suse.com>2018-03-08 08:51:18 +0100
commit23e42951f2f2cca539c69a843ae31d9c6cdb194b (patch)
tree21f20bee8c57a67e766b9f818968ea901378bb2e /gas/config
parent8819ada6c48777c0dd0835d46f4a9dd3ecf2b0ec (diff)
downloadgdb-23e42951f2f2cca539c69a843ae31d9c6cdb194b.zip
gdb-23e42951f2f2cca539c69a843ae31d9c6cdb194b.tar.gz
gdb-23e42951f2f2cca539c69a843ae31d9c6cdb194b.tar.bz2
x86: correct operand size match checks for BMI/BMI2 insns
Some BMI/BMI2 insns allow their middle operands to be a memory one. In such a case, matching register types between operands 0 and 1 as well as 1 and 2 won't help - operands 0 and 2 also need to be checked.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 83fd18c..1da1fbd 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -5492,15 +5492,17 @@ check_reverse:
/* Fall through. */
case 3:
/* Here we make use of the fact that there are no
- reverse match 3 operand instructions, and all 3
- operand instructions only need to be checked for
- register consistency between operands 2 and 3. */
+ reverse match 3 operand instructions. */
if (!operand_type_match (overlap2, i.types[2])
|| (check_register
- && !operand_type_register_match (i.types[1],
- operand_types[1],
- i.types[2],
- operand_types[2])))
+ && (!operand_type_register_match (i.types[0],
+ operand_types[0],
+ i.types[2],
+ operand_types[2])
+ || !operand_type_register_match (i.types[1],
+ operand_types[1],
+ i.types[2],
+ operand_types[2]))))
continue;
break;
}