Cui, Lili
80d61d8d61
Support APX GPR32 with rex2 prefix
APX uses the REX2 prefix to support EGPR for map0 and map1 of legacy
instructions. We added the NoEgpr flag in i386-gen.c for instructions
that do not support EGPR.
gas/ChangeLog:
2023-12-28 Lingling Kong <lingling.kong@intel.com>
H.J. Lu <hongjiu.lu@intel.com>
Lili Cui <lili.cui@intel.com>
Lin Hu <lin1.hu@intel.com>
* config/tc-i386.c
(enum i386_error): Add unsupported_EGPR_for_addressing
and invalid_pseudo_prefix.
(struct _i386_insn): Add rex2 and rex2_encoding for
gpr32.
(cpu_arch): Add apx_f.
(is_cpu): Ditto.
(register_number): Handle RegRex2 for gpr32.
(is_apx_rex2_encoding): New func. Test rex2 prefix encoding.
(build_rex2_prefix): New func. Build legacy insn in
opcode 0/1 use gpr32 with rex2 prefix.
(establish_rex): Handle rex2 and rex2_encoding.
(optimize_encoding): Handel add r16-r31 for registers.
(md_assemble): Handle apx encoding.
(parse_insn): Handle Prefix_REX2.
(check_EgprOperands): New func. Check if Egprs operands
are valid for the instruction
(match_template): Handle Egpr operands check.
(set_rex_rex2): New func. set i.rex and i.rex2.
(build_modrm_byte): Ditto.
(output_insn): Handle rex2 2-byte prefix output.
(check_register): Handle check egpr illegal without
target apx, 64-bit mode and with rex_prefix.
* doc/c-i386.texi: Document .apx.
* testsuite/gas/i386/ilp32/x86-64-opcode-inval-intel.d: D5 valid
in 64-bit mode.
* testsuite/gas/i386/ilp32/x86-64-opcode-inval.d: Ditto.
* testsuite/gas/i386/rex-bad: Adjust rex testcase.
* testsuite/gas/i386/x86-64-opcode-inval-intel.d: Ditto.
* testsuite/gas/i386/x86-64-opcode-inval.d: Ditto.
* testsuite/gas/i386/x86-64-opcode-inval.s: Ditto.
* testsuite/gas/i386/x86-64-pseudos-bad.l: Add illegal rex2 test.
* testsuite/gas/i386/x86-64-pseudos-bad.s: Ditto.
* testsuite/gas/i386/x86-64-pseudos.d: Add rex2 test.
* testsuite/gas/i386/x86-64-pseudos.s: Ditto.
* testsuite/gas/i386/x86-64.exp: Run APX tests.
* testsuite/gas/i386/x86-64-apx-egpr-inval.l: New test.
* testsuite/gas/i386/x86-64-apx-egpr-inval.s: New test.
* testsuite/gas/i386/x86-64-apx-rex2.d: New test.
* testsuite/gas/i386/x86-64-apx-rex2.s: New test.
include/ChangeLog:
* opcode/i386.h (REX2_OPCODE): New.
(REX2_M): Ditto.
opcodes/ChangeLog:
* i386-dis.c (struct instr_info): Add erex for gpr32.
Add last_erex_prefix for rex2 prefix.
(REX2_M): Extend for gpr32.
(PREFIX_REX2): Ditto.
(PREFIX_REX2_ILLEGAL): Ditto.
(ckprefix): Ditto.
(prefix_name): Ditto.
(print_insn): Ditto.
(print_register): Ditto.
(OP_E_memory): Ditto.
(OP_REG): Ditto.
(OP_EX): Ditto.
* i386-gen.c (rex2_disallowed): Some instructions are not allowed rex2 prefix.
(process_i386_opcode_modifier): Set NoEgpr for VEX and some special instructions.
(output_i386_opcode): Handle if_entry_needs_special_handle.
* i386-init.h : Regenerated.
* i386-mnem.h : Regenerated.
* i386-opc.h (enum i386_cpu): Add CpuAPX_F.
(NoEgpr): New.
(Prefix_NoOptimize): Ditto.
(Prefix_REX2): Ditto.
(RegRex2): Ditto.
* i386-opc.tbl: Add rex2 prefix.
* i386-reg.tbl: Add egprs (r16-r31).
* i386-tbl.h: Regenerated.
2023-12-28 11:14:41 +00:00
..
2023-05-30 12:51:22 +09:30
2023-01-01 21:50:11 +10:30
2023-12-05 13:20:27 +01:00
2023-12-25 11:46:22 +08:00
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-12-28 11:14:41 +00:00
2023-01-18 20:47:55 -05:00
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-08-12 09:58:22 +09:30
2023-11-10 11:37:27 +00:00
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-11-28 13:29:58 +01:00
2018-01-03 17:49:42 +10:30
2019-01-01 21:25:40 +10:30
2020-01-01 18:12:08 +10:30
2021-01-01 10:31:02 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-12 14:40:47 +00:00
2023-01-01 21:50:11 +10:30
2023-03-06 21:00:52 -05:00
2023-08-16 14:22:54 +01:00
2023-12-10 14:55:22 -07:00
2023-08-12 09:58:22 +09:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-08-12 09:58:22 +09:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-05-17 11:21:43 +09:30
2023-01-01 21:50:11 +10:30
2023-06-29 16:31:58 -07:00
2023-06-29 16:31:58 -07:00
2023-11-28 13:29:58 +01:00
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-08-12 09:58:22 +09:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30
2023-08-12 10:24:26 +09:30
2023-01-01 21:50:11 +10:30
2023-01-01 21:50:11 +10:30