diff options
author | Cui, Lili <lili.cui@intel.com> | 2024-05-22 09:33:10 +0800 |
---|---|---|
committer | Cui, Lili <lili.cui@intel.com> | 2024-05-22 10:16:14 +0800 |
commit | 9f8b42c871ac1b75a4270378e33fd1b1fba95f84 (patch) | |
tree | 39e37d2a986be2284828ca3cc3dfd0f2be9c49e9 /gas/config/tc-i386.c | |
parent | 3a8ecbdade82981cd2fb257896b01afd54752491 (diff) | |
download | binutils-9f8b42c871ac1b75a4270378e33fd1b1fba95f84.zip binutils-9f8b42c871ac1b75a4270378e33fd1b1fba95f84.tar.gz binutils-9f8b42c871ac1b75a4270378e33fd1b1fba95f84.tar.bz2 |
Add check for 8-bit old registers in EVEX format
Since APX supports EVEX from legacy instructions, we need to check
the 8-bit old registers in EVEX format. And add test cases for it.
gas/ChangeLog:
* config/tc-i386.c (md_assemble): Add invalid check for old byte
registers in EVEX format.
* testsuite/gas/i386/x86-64-apx-inval.l: Add new test.
* testsuite/gas/i386/x86-64-apx-inval.s: Ditto.
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r-- | gas/config/tc-i386.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 12af7ce..dc6d8bb 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -4314,7 +4314,7 @@ static void establish_rex (void) /* For REX/REX2/EVEX prefix instructions, we need to convert old registers (AL, CL, DL and BL) to new ones (AXL, CXL, DXL and BXL) and reject AH, CH, DH and BH. */ - if (i.rex || i.rex2) + if (i.rex || i.rex2 || i.tm.opcode_modifier.evex) { for (unsigned int x = first; x <= last; x++) { @@ -4326,8 +4326,9 @@ static void establish_rex (void) /* In case it is "hi" register, give up. */ if (i.op[x].regs->reg_num > 3) as_bad (_("can't encode register '%s%s' in an " - "instruction requiring REX/REX2 prefix"), - register_prefix, i.op[x].regs->reg_name); + "instruction requiring %s prefix"), + register_prefix, i.op[x].regs->reg_name, + i.tm.opcode_modifier.evex ? "EVEX" : "REX/REX2"); /* Otherwise it is equivalent to the extended register. Since the encoding doesn't change this is merely |