From 44846f29ab3a5fdab229cb63d9cd42323ed85767 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 1 Jun 2018 08:39:54 +0200 Subject: x86: relax redundant REX prefix check All REX bits can be specified via individual prefixes. Redundancy should only be reported on a per-bit basis. Note that I originally had further checks added to the test case, checking the effect also on PDEP. I had to strip those, because my patch to correctly handle those (https://sourceware.org/ml/binutils/2017-02/msg00280.html) was rejected. I continue to think that there should not be any new prefix introduced to handle the VEX case - whether the encoding of an insn requires VEX et al should not be of immediate interest to the programmer. --- gas/config/tc-i386.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gas/config') diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 07a4e11..2d20f1c 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2330,8 +2330,9 @@ add_prefix (unsigned int prefix) && flag_code == CODE_64BIT) { if ((i.prefix[REX_PREFIX] & prefix & REX_W) - || ((i.prefix[REX_PREFIX] & (REX_R | REX_X | REX_B)) - && (prefix & (REX_R | REX_X | REX_B)))) + || (i.prefix[REX_PREFIX] & prefix & REX_R) + || (i.prefix[REX_PREFIX] & prefix & REX_X) + || (i.prefix[REX_PREFIX] & prefix & REX_B)) ret = PREFIX_EXIST; q = REX_PREFIX; } -- cgit v1.1