[PATCH 1/2] x86: fold SReg{2,3}

H.J. Lu hjl.tools@gmail.com
Wed Sep 18 18:35:00 GMT 2019


On Thu, Jul 4, 2019 at 2:01 AM Jan Beulich <JBeulich@suse.com> wrote:
>
> They're the only exception to there generally being no mix of register
> kinds possible in an insn operand template, and there being two bits per
> operand for their representation is also quite wasteful, considering the
> low number of uses.  Fold both bits and deal with the little bit of
> fallout.
>
> Also take the liberty and drop dead code trying to set REX_B: No segment
> register has RegRex set on it.
>
> Additionally I was quite surprised that PUSH/POP with the permitted
> segment registers is not covered by the test cases.  Add the missing
> pieces.
>
> gas/
> 2019-07-04  Jan Beulich  <jbeulich@suse.com>
>
>         * config/tc-i386.c (type_names): Replace SReg entries.
>         (pi, check_byte_reg, build_modrm_byte, i386_att_operand,
>         parse_real_register): Switch to using sreg field.
>         (process_operands): Likewise. Extend handling of PUSH/POP of
>         segment registers. Drop dead setting of REX_B.
>         * config/tc-i386-intel.c (i386_intel_simplify_register,
>         i386_intel_operand): Switch to using sreg field.
>         * testsuite/gas/i386/x86-64-opcode.s: Add PUSH/POP of %fs/%gs.
>         * testsuite/gas/i386/x86-64-opcode.d: Adjust expectations.
>         * testsuite/gas/i386/ilp32/x86-64-opcode.d: Use parent dir
>         expectations.
>
> include/
> 2019-07-04  Jan Beulich  <jbeulich@suse.com>
>
>         * opcode/i386.h (POP_SEG386_SHORT): New.
>
> opcodes/
> 2019-07-04  Jan Beulich  <jbeulich@suse.com>
>
>         * i386-gen.c (operand_type_init, operand_types): Replace SReg
>         entries.
>         * i386-opc.h (SReg2, SReg3): Delete.
>         (SReg): new.
>         (union i386_operand_type): Replace sreg fields.
>         * i386-opc.tbl (mov, ): Use SReg.
>         (push, pop): Likewies. Drop i386 and x86-64 specific segment
>         register flavors.
>         * i386-reg.tbl (cs, ds, es, fs, gs, ss, flat): Use SReg.
>         * opcodes/i386-init.h, i386-tbl.h: Re-generate.
>

This caused:

https://sourceware.org/bugzilla/show_bug.cgi?id=25012

-- 
H.J.



More information about the Binutils mailing list