[PATCH] x86: Remove the prefix byte from base_opcode

H.J. Lu hjl.tools@gmail.com
Wed Oct 14 02:25:30 GMT 2020


On Tue, Oct 13, 2020 at 7:21 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Tue, Oct 13, 2020 at 2:49 PM H.J. Lu <hjl.tools@gmail.com> wrote:
> >
> > Rename VexOpcode to OpcodePrefix so that OpcodePrefix can be used for
> > regular encoding prefix.
> >
> > gas/
> >
> >         * config/tc-i386.c (build_vex_prefix): Replace vexopcode with
> >         opcodeprefix.
> >         (build_evex_prefix): Likewise.
> >         (is_any_vex_encoding): Don't check vexopcode.
> >         (output_insn): Handle opcodeprefix.
> >
> > opcodes/
> >
> >         * i386-gen.c (opcode_modifiers): Replace VexOpcode with
> >         OpcodePrefix.
> >         * i386-opc.h (VexOpcode): Renamed to ...
> >         (OpcodePrefix): This.
> >         (PREFIX_NONE): New.
> >         (PREFIX_F3): Likewise.
> >         * i386-opc.tbl: Replace VexOpcode= with OpcodePrefix=.
>
> This is the patch I am checking in.
>
> gas/
>
> * config/tc-i386.c (build_vex_prefix): Replace vexopcode with
> opcodeprefix.
> (build_evex_prefix): Likewise.
> (is_any_vex_encoding): Don't check vexopcode.
> (output_insn): Handle opcodeprefix.
>
> opcodes/
>
> * i386-gen.c (opcode_modifiers): Replace VexOpcode with
> OpcodePrefix.
> * i386-opc.h (VexOpcode): Renamed to ...
> (OpcodePrefix): This.
> (PREFIX_NONE): New.
> (PREFIX_0X66): Likewise.
> (PREFIX_0XF2): Likewise.
> (PREFIX_0XF3): Likewise.
> * i386-opc.tbl (Prefix_0X66): New.
> (Prefix_0XF2): Likewise.
> (Prefix_0XF3): Likewise.
> Replace VexOpcode= with OpcodePrefix=.  Use Prefix_0X66 on xorpd.
> Use Prefix_0XF3 on cvtdq2pd.  Use Prefix_0XF2 on cvtpd2dq.
> * i386-tbl.h: Regenerated.
>

Here is the followup patch to remove the prefix byte from
base_opcode.

Replace the prefix byte in base_opcode with PREFIX_0X66, PREFIX_0XF2 or
PREFIX_0XF3.

gas/

* config/tc-i386.c (load_insn_p): Check opcodeprefix == 0 for
base_opcode == 0xfc7.
(match_template): Likewise.
(process_suffix): Check opcodeprefix == PREFIX_0XF2 for CRC32.
(check_byte_reg): Likewise.
(output_insn): Abort if base_opcode has a prefix byte.

opcodes/

* i386-opc.tbl: Replace the prefix byte in base_opcode with
PREFIX_0X66, PREFIX_0XF2 or PREFIX_0XF3.
* i386-tbl.h: Regenerated.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-x86-Remove-the-prefix-byte-from-base_opcode.patch.xz
Type: application/x-xz
Size: 22384 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20201013/8a27a4ca/attachment-0001.xz>


More information about the Binutils mailing list