On Mon, Jan 21, 2019 at 11:00 AM Hongtao Liu <crazy...@gmail.com> wrote:
>
> Hi Uros,
>
> There are
>
> struct builtin_description
> {
>   const HOST_WIDE_INT mask;
>   const enum insn_code icode;
>   const char *const name;
>   const enum ix86_builtins code;
>   const enum rtx_code comparison;
>   const int flag;
> };
>
> Since "mask" is used for both ix86_isa_flags and ix86_isa_flags2,
> buitins with both flags can't be handled easily.
> This patch intends to handle this issue.
> Tested with bootstrap and regression test on x86, no problem found.
> Is it ok for trunk?

Let's go all the way and add mask2 to all builtins. While it is
understandable that by introducing BDESC2 and relevant processing
functions you were trying to minimize the patch size, I think that the
proposed patch is complicating things too much. Although the patch
that adds mask2 to each and every builtin will be big, it will be
fairly straightforward (an hopefully the change can be scripted to
some degree), and it will avoid further future complications in this
area. Other than that, builtins are covered by a bunch of very picky
testcases via intrinsics, so I'm fairly confident that the patch is
manageable, despite its size.

BR,
Uros.

> Thanks,
> Hongtao
>
> ---
> gcc/
>
> 2019-01-21  Hongtao Liu <hongtao....@intel.com>
>     H.J. Lu <hongjiu...@intel.com>
>
> PR target/88909
> * config/i386/i386-builtin.def:
> Refine builtins related to ix86_isa_flags2.
> * config/i386/i386.c (BDESC2): Define.
> (BDESC2_FIRST): Likewise.
> (BDESC2_END): Likewise.
> (builtin_description): Add new member mask2.
> (define_builtin2): Modified to handle both
> ix86_isa_flags and ix86_isa_flags2.
> (define_builtin_const2): Likewise.
> (define_builtin): Likewise.
> (bdesc_tm[]): Likewise.
> (ix86_init_mmx_sse_builtins): Likewise.
> ---

Reply via email to