public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Hongtao Liu <crazylht@gmail.com>
To: liuhongt <hongtao.liu@intel.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	"H. J. Lu" <hjl.tools@gmail.com>,
	 Uros Bizjak <ubizjak@gmail.com>,
	Jakub Jelinek <jakub@redhat.com>
Subject: Re: [PATCH 44/62] AVX512FP16: Add scalar/vector bitwise operations, including
Date: Mon, 26 Jul 2021 10:25:42 +0800	[thread overview]
Message-ID: <CAMZc-bzP1hjEEckXLD5VXFdkAdpHhH1f63HMJ19wfeLbQ0aNMQ@mail.gmail.com> (raw)
In-Reply-To: <CAMZc-bxuK0jzMgVpOHDwNMG=1DiDBdCRsspW5Ur0uFzpfGUOaQ@mail.gmail.com>

On Fri, Jul 23, 2021 at 1:13 PM Hongtao Liu <crazylht@gmail.com> wrote:
>
> On Thu, Jul 1, 2021 at 2:18 PM liuhongt <hongtao.liu@intel.com> wrote:
> >
> > From: "H.J. Lu" <hjl.tools@gmail.com>
> >
> > 1. FP16 vector xor/ior/and/andnot/abs/neg
> > 2. FP16 scalar abs/neg/copysign/xorsign
> >
> > gcc/ChangeLog:
> >
> >         * config/i386/i386-expand.c (ix86_expand_fp_absneg_operator):
> >         Handle HFmode.
> >         (ix86_expand_copysign): Ditto.
> >         (ix86_expand_xorsign): Ditto.
> >         * config/i386/i386.c (ix86_build_const_vector): Handle HF vector
> >         modes.
> >         (ix86_build_signbit_mask): Ditto.
> >         (ix86_can_change_mode_class): Ditto.
> >         * config/i386/i386.md (SSEMODEF): Add HF mode.
> >         (ssevecmodef): Ditto.
> >         (<code><mode>2): Use MODEFH.
> >         (*<code><mode>2_1): Ditto.
> >         (define_split): Ditto.
> >         (xorsign<mode>3): Ditto.
> >         (@xorsign<mode>3_1): Ditto.
> As mentioned by uros, l think these also better have separate patterns for hf.
I realized there're parameters names in define_insn and
define_insn_and_split, and they will be called by xorsign/copysign
functions in i386-expand.c, for simplicity i'd like to keep the
macroization of HF patterns in this patch.

> >         * config/i386/sse.md (VFB): New mode iterator.
> >         (VFB_128_256): Ditto.
> >         (VFB_512): Ditto.
> >         (sseintvecmode2): Support HF vector mode.
> >         (<code><mode>2): Use new mode iterator.
> >         (*<code><mode>2): Ditto.
> >         (copysign<mode>3): Ditto.
> >         (xorsign<mode>3): Ditto.
> >         (<code><mode>3<mask_name>): Ditto.
> >         (<code><mode>3<mask_name>): Ditto.
> >         (<sse>_andnot<mode>3<mask_name>): Adjust for HF vector mode.
> >         (<sse>_andnot<mode>3<mask_name>): Ditto.
> >         (*<code><mode>3<mask_name>): Ditto.
> >         (*<code><mode>3<mask_name>): Ditto.
> > ---
> >  gcc/config/i386/i386-expand.c |  12 +++-
> >  gcc/config/i386/i386.c        |  12 +++-
> >  gcc/config/i386/i386.md       |  40 ++++++-----
> >  gcc/config/i386/sse.md        | 128 ++++++++++++++++++++--------------
> >  4 files changed, 118 insertions(+), 74 deletions(-)
> >
> > diff --git a/gcc/config/i386/i386-expand.c b/gcc/config/i386/i386-expand.c
> > index 9233c6cd1e8..006f4bec8db 100644
> > --- a/gcc/config/i386/i386-expand.c
> > +++ b/gcc/config/i386/i386-expand.c
> > @@ -1781,6 +1781,8 @@ ix86_expand_fp_absneg_operator (enum rtx_code code, machine_mode mode,
> >         vmode = V4SFmode;
> >        else if (mode == DFmode)
> >         vmode = V2DFmode;
> > +      else if (mode == HFmode)
> > +       vmode = V8HFmode;
> >      }
> >
> >    dst = operands[0];
> > @@ -1918,7 +1920,9 @@ ix86_expand_copysign (rtx operands[])
> >
> >    mode = GET_MODE (dest);
> >
> > -  if (mode == SFmode)
> > +  if (mode == HFmode)
> > +    vmode = V8HFmode;
> > +  else if (mode == SFmode)
> >      vmode = V4SFmode;
> >    else if (mode == DFmode)
> >      vmode = V2DFmode;
> > @@ -1934,7 +1938,7 @@ ix86_expand_copysign (rtx operands[])
> >        if (real_isneg (CONST_DOUBLE_REAL_VALUE (op0)))
> >         op0 = simplify_unary_operation (ABS, mode, op0, mode);
> >
> > -      if (mode == SFmode || mode == DFmode)
> > +      if (mode == HFmode || mode == SFmode || mode == DFmode)
> >         {
> >           if (op0 == CONST0_RTX (mode))
> >             op0 = CONST0_RTX (vmode);
> > @@ -2073,7 +2077,9 @@ ix86_expand_xorsign (rtx operands[])
> >
> >    mode = GET_MODE (dest);
> >
> > -  if (mode == SFmode)
> > +  if (mode == HFmode)
> > +    vmode = V8HFmode;
> > +  else if (mode == SFmode)
> >      vmode = V4SFmode;
> >    else if (mode == DFmode)
> >      vmode = V2DFmode;
> > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
> > index dc0d440061b..17e1b5ea874 100644
> > --- a/gcc/config/i386/i386.c
> > +++ b/gcc/config/i386/i386.c
> > @@ -15374,6 +15374,9 @@ ix86_build_const_vector (machine_mode mode, bool vect, rtx value)
> >      case E_V2DImode:
> >        gcc_assert (vect);
> >        /* FALLTHRU */
> > +    case E_V8HFmode:
> > +    case E_V16HFmode:
> > +    case E_V32HFmode:
> >      case E_V16SFmode:
> >      case E_V8SFmode:
> >      case E_V4SFmode:
> > @@ -15412,6 +15415,13 @@ ix86_build_signbit_mask (machine_mode mode, bool vect, bool invert)
> >
> >    switch (mode)
> >      {
> > +    case E_V8HFmode:
> > +    case E_V16HFmode:
> > +    case E_V32HFmode:
> > +      vec_mode = mode;
> > +      imode = HImode;
> > +      break;
> > +
> >      case E_V16SImode:
> >      case E_V16SFmode:
> >      case E_V8SImode:
> > @@ -19198,7 +19208,7 @@ ix86_can_change_mode_class (machine_mode from, machine_mode to,
> >          disallow a change to these modes, reload will assume it's ok to
> >          drop the subreg from (subreg:SI (reg:HI 100) 0).  This affects
> >          the vec_dupv4hi pattern.  */
> > -      if (GET_MODE_SIZE (from) < 4)
> > +      if (GET_MODE_SIZE (from) < 4 && from != E_HFmode)
> >         return false;
> >      }
> >
> > diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
> > index 014aba187e1..a85c23d74f1 100644
> > --- a/gcc/config/i386/i386.md
> > +++ b/gcc/config/i386/i386.md
> > @@ -1233,9 +1233,10 @@ (define_mode_iterator MODEFH [(HF "TARGET_AVX512FP16") SF DF])
> >  ;; All x87 floating point modes plus HFmode
> >  (define_mode_iterator X87MODEFH [HF SF DF XF])
> >
> > -;; All SSE floating point modes
> > -(define_mode_iterator SSEMODEF [SF DF TF])
> > -(define_mode_attr ssevecmodef [(SF "V4SF") (DF "V2DF") (TF "TF")])
> > +;; All SSE floating point modes and HFmode
> > +(define_mode_iterator SSEMODEF [HF SF DF TF])
> > +(define_mode_attr ssevecmodef [(HF "V8HF") (SF "V4SF") (DF "V2DF") (TF "TF")])
> > +
> >
> >  ;; SSE instruction suffix for various modes
> >  (define_mode_attr ssemodesuffix
> > @@ -10529,8 +10530,8 @@ (define_insn_and_split "*nabstf2_1"
> >    [(set_attr "isa" "noavx,noavx,avx,avx")])
> >
> >  (define_expand "<code><mode>2"
> > -  [(set (match_operand:X87MODEF 0 "register_operand")
> > -       (absneg:X87MODEF (match_operand:X87MODEF 1 "register_operand")))]
> > +  [(set (match_operand:X87MODEFH 0 "register_operand")
> > +       (absneg:X87MODEFH (match_operand:X87MODEFH 1 "register_operand")))]
> >    "TARGET_80387 || (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)"
> >    "ix86_expand_fp_absneg_operator (<CODE>, <MODE>mode, operands); DONE;")
> >
> > @@ -10559,9 +10560,9 @@ (define_split
> >    "ix86_split_fp_absneg_operator (<CODE>, <MODE>mode, operands); DONE;")
> >
> >  (define_insn "*<code><mode>2_1"
> > -  [(set (match_operand:MODEF 0 "register_operand" "=x,x,Yv,f,!r")
> > -       (absneg:MODEF
> > -         (match_operand:MODEF 1 "register_operand" "0,x,Yv,0,0")))
> > +  [(set (match_operand:MODEFH 0 "register_operand" "=x,x,Yv,f,!r")
> > +       (absneg:MODEFH
> > +         (match_operand:MODEFH 1 "register_operand" "0,x,Yv,0,0")))
> >     (use (match_operand:<ssevecmode> 2 "vector_operand" "xBm,0,Yvm,X,X"))
> >     (clobber (reg:CC FLAGS_REG))]
> >    "TARGET_80387 || (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)"
> > @@ -10572,7 +10573,8 @@ (define_insn "*<code><mode>2_1"
> >         (match_test ("SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH"))
> >         (if_then_else
> >          (eq_attr "alternative" "3,4")
> > -        (symbol_ref "TARGET_MIX_SSE_I387")
> > +        (symbol_ref "TARGET_MIX_SSE_I387
> > +                     && <MODE>mode != HFmode")
> >          (const_string "*"))
> >         (if_then_else
> >          (eq_attr "alternative" "3,4")
> > @@ -10580,9 +10582,9 @@ (define_insn "*<code><mode>2_1"
> >          (symbol_ref "false"))))])
> >
> >  (define_split
> > -  [(set (match_operand:MODEF 0 "sse_reg_operand")
> > -       (absneg:MODEF
> > -         (match_operand:MODEF 1 "sse_reg_operand")))
> > +  [(set (match_operand:MODEFH 0 "sse_reg_operand")
> > +       (absneg:MODEFH
> > +         (match_operand:MODEFH 1 "sse_reg_operand")))
> >     (use (match_operand:<ssevecmodef> 2 "vector_operand"))
> >     (clobber (reg:CC FLAGS_REG))]
> >    "SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
> > @@ -10706,17 +10708,17 @@ (define_split
> >    "ix86_split_copysign_var (operands); DONE;")
> >
> >  (define_expand "xorsign<mode>3"
> > -  [(match_operand:MODEF 0 "register_operand")
> > -   (match_operand:MODEF 1 "register_operand")
> > -   (match_operand:MODEF 2 "register_operand")]
> > +  [(match_operand:MODEFH 0 "register_operand")
> > +   (match_operand:MODEFH 1 "register_operand")
> > +   (match_operand:MODEFH 2 "register_operand")]
> >    "SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH"
> >    "ix86_expand_xorsign (operands); DONE;")
> >
> >  (define_insn_and_split "@xorsign<mode>3_1"
> > -  [(set (match_operand:MODEF 0 "register_operand" "=Yv")
> > -       (unspec:MODEF
> > -         [(match_operand:MODEF 1 "register_operand" "Yv")
> > -          (match_operand:MODEF 2 "register_operand" "0")
> > +  [(set (match_operand:MODEFH 0 "register_operand" "=Yv")
> > +       (unspec:MODEFH
> > +         [(match_operand:MODEFH 1 "register_operand" "Yv")
> > +          (match_operand:MODEFH 2 "register_operand" "0")
> >            (match_operand:<ssevecmode> 3 "nonimmediate_operand" "Yvm")]
> >           UNSPEC_XORSIGN))]
> >    "SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH"
> > diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
> > index fdcc0515228..7c594babcce 100644
> > --- a/gcc/config/i386/sse.md
> > +++ b/gcc/config/i386/sse.md
> > @@ -317,11 +317,26 @@ (define_mode_iterator VFH
> >     (V16SF "TARGET_AVX512F") (V8SF "TARGET_AVX") V4SF
> >     (V8DF "TARGET_AVX512F") (V4DF "TARGET_AVX") (V2DF "TARGET_SSE2")])
> >
> > +;; 128-, 256- and 512-bit float vector modes for bitwise operations
> > +(define_mode_iterator VFB
> > +  [(V32HF "TARGET_AVX512FP16")
> > +   (V16HF "TARGET_AVX512FP16")
> > +   (V8HF "TARGET_AVX512FP16")
> > +   (V16SF "TARGET_AVX512F") (V8SF "TARGET_AVX") V4SF
> > +   (V8DF "TARGET_AVX512F") (V4DF "TARGET_AVX") (V2DF "TARGET_SSE2")])
> > +
> >  ;; 128- and 256-bit float vector modes
> >  (define_mode_iterator VF_128_256
> >    [(V8SF "TARGET_AVX") V4SF
> >     (V4DF "TARGET_AVX") (V2DF "TARGET_SSE2")])
> >
> > +;; 128- and 256-bit float vector modes for bitwise operations
> > +(define_mode_iterator VFB_128_256
> > +  [(V16HF "TARGET_AVX512FP16")
> > +   (V8HF "TARGET_AVX512FP16")
> > +   (V8SF "TARGET_AVX") V4SF
> > +   (V4DF "TARGET_AVX") (V2DF "TARGET_SSE2")])
> > +
> >  ;; All SFmode vector float modes
> >  (define_mode_iterator VF1
> >    [(V16SF "TARGET_AVX512F") (V8SF "TARGET_AVX") V4SF])
> > @@ -374,6 +389,10 @@ (define_mode_iterator VF_256
> >  (define_mode_iterator VF_512
> >    [V16SF V8DF])
> >
> > +;; All 512bit vector float modes for bitwise operations
> > +(define_mode_iterator VFB_512
> > +  [(V32HF "TARGET_AVX512FP16") V16SF V8DF])
> > +
> >  (define_mode_iterator VI48_AVX512VL
> >    [V16SI (V8SI  "TARGET_AVX512VL") (V4SI  "TARGET_AVX512VL")
> >     V8DI  (V4DI  "TARGET_AVX512VL") (V2DI  "TARGET_AVX512VL")])
> > @@ -923,7 +942,8 @@ (define_mode_attr sseintvecmode
> >
> >  (define_mode_attr sseintvecmode2
> >    [(V8DF "XI") (V4DF "OI") (V2DF "TI")
> > -   (V8SF "OI") (V4SF "TI")])
> > +   (V8SF "OI") (V4SF "TI")
> > +   (V16HF "OI") (V8HF "TI")])
> >
> >  (define_mode_attr sseintvecmodelower
> >    [(V16SF "v16si") (V8DF "v8di")
> > @@ -1968,22 +1988,22 @@ (define_insn "kunpckdi"
> >  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> >
> >  (define_expand "<code><mode>2"
> > -  [(set (match_operand:VF 0 "register_operand")
> > -       (absneg:VF
> > -         (match_operand:VF 1 "register_operand")))]
> > +  [(set (match_operand:VFB 0 "register_operand")
> > +       (absneg:VFB
> > +         (match_operand:VFB 1 "register_operand")))]
> >    "TARGET_SSE"
> >    "ix86_expand_fp_absneg_operator (<CODE>, <MODE>mode, operands); DONE;")
> >
> >  (define_insn_and_split "*<code><mode>2"
> > -  [(set (match_operand:VF 0 "register_operand" "=x,x,v,v")
> > -       (absneg:VF
> > -         (match_operand:VF 1 "vector_operand" "0,xBm,v,m")))
> > -   (use (match_operand:VF 2 "vector_operand" "xBm,0,vm,v"))]
> > +  [(set (match_operand:VFB 0 "register_operand" "=x,x,v,v")
> > +       (absneg:VFB
> > +         (match_operand:VFB 1 "vector_operand" "0,xBm,v,m")))
> > +   (use (match_operand:VFB 2 "vector_operand" "xBm,0,vm,v"))]
> >    "TARGET_SSE"
> >    "#"
> >    "&& reload_completed"
> >    [(set (match_dup 0)
> > -       (<absneg_op>:VF (match_dup 1) (match_dup 2)))]
> > +       (<absneg_op>:VFB (match_dup 1) (match_dup 2)))]
> >  {
> >    if (TARGET_AVX)
> >      {
> > @@ -3893,11 +3913,11 @@ (define_expand "vcond_mask_<mode><sseintvecmodelower>"
> >  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> >
> >  (define_insn "<sse>_andnot<mode>3<mask_name>"
> > -  [(set (match_operand:VF_128_256 0 "register_operand" "=x,x,v,v")
> > -       (and:VF_128_256
> > -         (not:VF_128_256
> > -           (match_operand:VF_128_256 1 "register_operand" "0,x,v,v"))
> > -         (match_operand:VF_128_256 2 "vector_operand" "xBm,xm,vm,vm")))]
> > +  [(set (match_operand:VFB_128_256 0 "register_operand" "=x,x,v,v")
> > +       (and:VFB_128_256
> > +         (not:VFB_128_256
> > +           (match_operand:VFB_128_256 1 "register_operand" "0,x,v,v"))
> > +         (match_operand:VFB_128_256 2 "vector_operand" "xBm,xm,vm,vm")))]
> >    "TARGET_SSE && <mask_avx512vl_condition>"
> >  {
> >    char buf[128];
> > @@ -3920,6 +3940,8 @@ (define_insn "<sse>_andnot<mode>3<mask_name>"
> >
> >    switch (get_attr_mode (insn))
> >      {
> > +    case MODE_V16HF:
> > +    case MODE_V8HF:
> >      case MODE_V8SF:
> >      case MODE_V4SF:
> >        suffix = "ps";
> > @@ -3958,11 +3980,11 @@ (define_insn "<sse>_andnot<mode>3<mask_name>"
> >               (const_string "<MODE>")))])
> >
> >  (define_insn "<sse>_andnot<mode>3<mask_name>"
> > -  [(set (match_operand:VF_512 0 "register_operand" "=v")
> > -       (and:VF_512
> > -         (not:VF_512
> > -           (match_operand:VF_512 1 "register_operand" "v"))
> > -         (match_operand:VF_512 2 "nonimmediate_operand" "vm")))]
> > +  [(set (match_operand:VFB_512 0 "register_operand" "=v")
> > +       (and:VFB_512
> > +         (not:VFB_512
> > +           (match_operand:VFB_512 1 "register_operand" "v"))
> > +         (match_operand:VFB_512 2 "nonimmediate_operand" "vm")))]
> >    "TARGET_AVX512F"
> >  {
> >    char buf[128];
> > @@ -3972,8 +3994,9 @@ (define_insn "<sse>_andnot<mode>3<mask_name>"
> >    suffix = "<ssemodesuffix>";
> >    ops = "";
> >
> > -  /* There is no vandnp[sd] in avx512f.  Use vpandn[qd].  */
> > -  if (!TARGET_AVX512DQ)
> > +  /* Since there are no vandnp[sd] without AVX512DQ nor vandnph,
> > +     use vp<logic>[dq].  */
> > +  if (!TARGET_AVX512DQ || <MODE>mode == V32HFmode)
> >      {
> >        suffix = GET_MODE_INNER (<MODE>mode) == DFmode ? "q" : "d";
> >        ops = "p";
> > @@ -3993,26 +4016,26 @@ (define_insn "<sse>_andnot<mode>3<mask_name>"
> >                       (const_string "XI")))])
> >
> >  (define_expand "<code><mode>3<mask_name>"
> > -  [(set (match_operand:VF_128_256 0 "register_operand")
> > -       (any_logic:VF_128_256
> > -         (match_operand:VF_128_256 1 "vector_operand")
> > -         (match_operand:VF_128_256 2 "vector_operand")))]
> > +  [(set (match_operand:VFB_128_256 0 "register_operand")
> > +       (any_logic:VFB_128_256
> > +         (match_operand:VFB_128_256 1 "vector_operand")
> > +         (match_operand:VFB_128_256 2 "vector_operand")))]
> >    "TARGET_SSE && <mask_avx512vl_condition>"
> >    "ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
> >
> >  (define_expand "<code><mode>3<mask_name>"
> > -  [(set (match_operand:VF_512 0 "register_operand")
> > -       (any_logic:VF_512
> > -         (match_operand:VF_512 1 "nonimmediate_operand")
> > -         (match_operand:VF_512 2 "nonimmediate_operand")))]
> > +  [(set (match_operand:VFB_512 0 "register_operand")
> > +       (any_logic:VFB_512
> > +         (match_operand:VFB_512 1 "nonimmediate_operand")
> > +         (match_operand:VFB_512 2 "nonimmediate_operand")))]
> >    "TARGET_AVX512F"
> >    "ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
> >
> >  (define_insn "*<code><mode>3<mask_name>"
> > -  [(set (match_operand:VF_128_256 0 "register_operand" "=x,x,v,v")
> > -       (any_logic:VF_128_256
> > -         (match_operand:VF_128_256 1 "vector_operand" "%0,x,v,v")
> > -         (match_operand:VF_128_256 2 "vector_operand" "xBm,xm,vm,vm")))]
> > +  [(set (match_operand:VFB_128_256 0 "register_operand" "=x,x,v,v")
> > +       (any_logic:VFB_128_256
> > +         (match_operand:VFB_128_256 1 "vector_operand" "%0,x,v,v")
> > +         (match_operand:VFB_128_256 2 "vector_operand" "xBm,xm,vm,vm")))]
> >    "TARGET_SSE && <mask_avx512vl_condition>
> >     && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
> >  {
> > @@ -4036,6 +4059,8 @@ (define_insn "*<code><mode>3<mask_name>"
> >
> >    switch (get_attr_mode (insn))
> >      {
> > +    case MODE_V16HF:
> > +    case MODE_V8HF:
> >      case MODE_V8SF:
> >      case MODE_V4SF:
> >        suffix = "ps";
> > @@ -4074,10 +4099,10 @@ (define_insn "*<code><mode>3<mask_name>"
> >               (const_string "<MODE>")))])
> >
> >  (define_insn "*<code><mode>3<mask_name>"
> > -  [(set (match_operand:VF_512 0 "register_operand" "=v")
> > -       (any_logic:VF_512
> > -         (match_operand:VF_512 1 "nonimmediate_operand" "%v")
> > -         (match_operand:VF_512 2 "nonimmediate_operand" "vm")))]
> > +  [(set (match_operand:VFB_512 0 "register_operand" "=v")
> > +       (any_logic:VFB_512
> > +         (match_operand:VFB_512 1 "nonimmediate_operand" "%v")
> > +         (match_operand:VFB_512 2 "nonimmediate_operand" "vm")))]
> >    "TARGET_AVX512F && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
> >  {
> >    char buf[128];
> > @@ -4087,8 +4112,9 @@ (define_insn "*<code><mode>3<mask_name>"
> >    suffix = "<ssemodesuffix>";
> >    ops = "";
> >
> > -  /* There is no v<logic>p[sd] in avx512f.  Use vp<logic>[dq].  */
> > -  if (!TARGET_AVX512DQ)
> > +  /* Since there are no v<logic>p[sd] without AVX512DQ nor v<logic>ph,
> > +     use vp<logic>[dq].  */
> > +  if (!TARGET_AVX512DQ || <MODE>mode == V32HFmode)
> >      {
> >        suffix = GET_MODE_INNER (<MODE>mode) == DFmode ? "q" : "d";
> >        ops = "p";
> > @@ -4109,14 +4135,14 @@ (define_insn "*<code><mode>3<mask_name>"
> >
> >  (define_expand "copysign<mode>3"
> >    [(set (match_dup 4)
> > -       (and:VF
> > -         (not:VF (match_dup 3))
> > -         (match_operand:VF 1 "vector_operand")))
> > +       (and:VFB
> > +         (not:VFB (match_dup 3))
> > +         (match_operand:VFB 1 "vector_operand")))
> >     (set (match_dup 5)
> > -       (and:VF (match_dup 3)
> > -               (match_operand:VF 2 "vector_operand")))
> > -   (set (match_operand:VF 0 "register_operand")
> > -       (ior:VF (match_dup 4) (match_dup 5)))]
> > +       (and:VFB (match_dup 3)
> > +                (match_operand:VFB 2 "vector_operand")))
> > +   (set (match_operand:VFB 0 "register_operand")
> > +       (ior:VFB (match_dup 4) (match_dup 5)))]
> >    "TARGET_SSE"
> >  {
> >    operands[3] = ix86_build_signbit_mask (<MODE>mode, 1, 0);
> > @@ -4127,11 +4153,11 @@ (define_expand "copysign<mode>3"
> >
> >  (define_expand "xorsign<mode>3"
> >    [(set (match_dup 4)
> > -       (and:VF (match_dup 3)
> > -               (match_operand:VF 2 "vector_operand")))
> > -   (set (match_operand:VF 0 "register_operand")
> > -       (xor:VF (match_dup 4)
> > -               (match_operand:VF 1 "vector_operand")))]
> > +       (and:VFB (match_dup 3)
> > +               (match_operand:VFB 2 "vector_operand")))
> > +   (set (match_operand:VFB 0 "register_operand")
> > +       (xor:VFB (match_dup 4)
> > +                (match_operand:VFB 1 "vector_operand")))]
> >    "TARGET_SSE"
> >  {
> >    operands[3] = ix86_build_signbit_mask (<MODE>mode, 1, 0);
> > --
> > 2.18.1
> >
>
>
> --
> BR,
> Hongtao



--
BR,
Hongtao

  reply	other threads:[~2021-07-26  2:25 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-01  6:15 [PATCH 00/62] Support all AVX512FP16 intrinsics liuhongt
2021-07-01  6:15 ` [PATCH 01/62] AVX512FP16: Support vector init/broadcast for FP16 liuhongt
2021-07-01  6:15 ` [PATCH 02/62] AVX512FP16: Add testcase for vector init and broadcast intrinsics liuhongt
2021-07-01  6:15 ` [PATCH 03/62] AVX512FP16: Fix HF vector passing in variable arguments liuhongt
2021-07-01  6:15 ` [PATCH 04/62] AVX512FP16: Add ABI tests for xmm liuhongt
2021-07-01  6:15 ` [PATCH 05/62] AVX512FP16: Add ABI test for ymm liuhongt
2021-07-01  6:15 ` [PATCH 06/62] AVX512FP16: Add abi test for zmm liuhongt
2021-07-01  6:15 ` [PATCH 07/62] AVX512FP16: Add vaddph/vsubph/vdivph/vmulph liuhongt
2021-09-09  7:48   ` Hongtao Liu
2021-07-01  6:15 ` [PATCH 08/62] AVX512FP16: Add testcase for vaddph/vsubph/vmulph/vdivph liuhongt
2021-07-01  6:15 ` [PATCH 09/62] AVX512FP16: Enable _Float16 autovectorization liuhongt
2021-09-10  7:03   ` Hongtao Liu
2021-07-01  6:15 ` [PATCH 10/62] AVX512FP16: Add vaddsh/vsubsh/vmulsh/vdivsh liuhongt
2021-07-01  6:15 ` [PATCH 11/62] AVX512FP16: Add testcase for vaddsh/vsubsh/vmulsh/vdivsh liuhongt
2021-07-01  6:15 ` [PATCH 12/62] AVX512FP16: Add vmaxph/vminph/vmaxsh/vminsh liuhongt
2021-07-01  6:15 ` [PATCH 13/62] AVX512FP16: Add testcase for vmaxph/vmaxsh/vminph/vminsh liuhongt
2021-07-01  6:16 ` [PATCH 14/62] AVX512FP16: Add vcmpph/vcmpsh/vcomish/vucomish liuhongt
2021-07-01  6:16 ` [PATCH 15/62] AVX512FP16: Add testcase for vcmpph/vcmpsh/vcomish/vucomish liuhongt
2021-07-01  6:16 ` [PATCH 16/62] AVX512FP16: Add vsqrtph/vrsqrtph/vsqrtsh/vrsqrtsh liuhongt
2021-09-14  3:50   ` Hongtao Liu
2021-07-01  6:16 ` [PATCH 17/62] AVX512FP16: Add testcase for vsqrtph/vsqrtsh/vrsqrtph/vrsqrtsh liuhongt
2021-07-01  6:16 ` [PATCH 18/62] AVX512FP16: Add vrcpph/vrcpsh/vscalefph/vscalefsh liuhongt
2021-07-01  6:16 ` [PATCH 19/62] AVX512FP16: Add testcase for vrcpph/vrcpsh/vscalefph/vscalefsh liuhongt
2021-07-01  6:16 ` [PATCH 20/62] AVX512FP16: Add vreduceph/vreducesh/vrndscaleph/vrndscalesh liuhongt
2021-07-01  6:16 ` [PATCH 21/62] AVX512FP16: Add testcase for vreduceph/vreducesh/vrndscaleph/vrndscalesh liuhongt
2021-07-01  6:16 ` [PATCH 22/62] AVX512FP16: Add fpclass/getexp/getmant instructions liuhongt
2021-07-01  6:16 ` [PATCH 23/62] AVX512FP16: Add testcase for fpclass/getmant/getexp instructions liuhongt
2021-07-01  6:16 ` [PATCH 24/62] AVX512FP16: Add vmovw/vmovsh liuhongt
2021-09-16  5:08   ` Hongtao Liu
2021-07-01  6:16 ` [PATCH 25/62] AVX512FP16: Add testcase for vmovsh/vmovw liuhongt
2021-07-01  6:16 ` [PATCH 26/62] AVX512FP16: Add vcvtph2dq/vcvtph2qq/vcvtph2w/vcvtph2uw/vcvtph2uqq/vcvtph2udq liuhongt
2021-07-01  6:16 ` [PATCH 27/62] AVX512FP16: Add testcase for vcvtph2w/vcvtph2uw/vcvtph2dq/vcvtph2udq/vcvtph2qq/vcvtph2uqq liuhongt
2021-07-01  6:16 ` [PATCH 28/62] AVX512FP16: Add vcvtuw2ph/vcvtw2ph/vcvtdq2ph/vcvtudq2ph/vcvtqq2ph/vcvtuqq2ph liuhongt
2021-07-01  6:16 ` [PATCH 29/62] AVX512FP16: Add testcase for vcvtw2ph/vcvtuw2ph/vcvtdq2ph/vcvtudq2ph/vcvtqq2ph/vcvtuqq2ph liuhongt
2021-07-01  6:16 ` [PATCH 30/62] AVX512FP16: Add vcvtsh2si/vcvtsh2usi/vcvtsi2sh/vcvtusi2sh liuhongt
2021-09-17  8:07   ` Hongtao Liu
2021-07-01  6:16 ` [PATCH 31/62] AVX512FP16: Add testcase for vcvtsh2si/vcvtsh2usi/vcvtsi2sh/vcvtusi2sh liuhongt
2021-07-01  6:16 ` [PATCH 32/62] AVX512FP16: Add vcvttph2w/vcvttph2uw/vcvttph2dq/vcvttph2qq/vcvttph2udq/vcvttph2uqq liuhongt
2021-07-01  6:16 ` [PATCH 33/62] AVX512FP16: Add testcase for vcvttph2w/vcvttph2uw/vcvttph2dq/vcvttph2udq/vcvttph2qq/vcvttph2uqq liuhongt
2021-07-01  6:16 ` [PATCH 34/62] AVX512FP16: Add vcvttsh2si/vcvttsh2usi liuhongt
2021-07-01  6:16 ` [PATCH 35/62] AVX512FP16: Add vcvtph2pd/vcvtph2psx/vcvtpd2ph/vcvtps2phx liuhongt
2021-07-01  6:16 ` [PATCH 36/62] AVX512FP16: Add testcase for vcvtph2pd/vcvtph2psx/vcvtpd2ph/vcvtps2phx liuhongt
2021-07-01  6:16 ` [PATCH 37/62] AVX512FP16: Add vcvtsh2ss/vcvtsh2sd/vcvtss2sh/vcvtsd2sh liuhongt
2021-07-01  6:16 ` [PATCH 38/62] AVX512FP16: Add testcase for vcvtsh2sd/vcvtsh2ss/vcvtsd2sh/vcvtss2sh liuhongt
2021-07-01  6:16 ` [PATCH 39/62] AVX512FP16: Add intrinsics for casting between vector float16 and vector float32/float64/integer liuhongt
2021-07-01  6:16 ` [PATCH 40/62] AVX512FP16: Add vfmaddsub[132, 213, 231]ph/vfmsubadd[132, 213, 231]ph liuhongt
2021-09-18  7:04   ` Hongtao Liu
2021-07-01  6:16 ` [PATCH 41/62] AVX512FP16: Add testcase for " liuhongt
2021-07-01  6:16 ` [PATCH 42/62] AVX512FP16: Add FP16 fma instructions liuhongt
2021-07-01  6:16 ` [PATCH 43/62] AVX512FP16: Add testcase for " liuhongt
2021-07-01  6:16 ` [PATCH 44/62] AVX512FP16: Add scalar/vector bitwise operations, including liuhongt
2021-07-23  5:13   ` Hongtao Liu
2021-07-26  2:25     ` Hongtao Liu [this message]
2021-07-01  6:16 ` [PATCH 45/62] AVX512FP16: Add testcase for fp16 bitwise operations liuhongt
2021-07-01  6:16 ` [PATCH 46/62] AVX512FP16: Enable FP16 mask load/store liuhongt
2021-07-01  6:16 ` [PATCH 47/62] AVX512FP16: Add scalar fma instructions liuhongt
2021-07-01  6:16 ` [PATCH 48/62] AVX512FP16: Add testcase for scalar FMA instructions liuhongt
2021-07-01  6:16 ` [PATCH 49/62] AVX512FP16: Add vfcmaddcph/vfmaddcph/vfcmulcph/vfmulcph liuhongt
2021-09-22  4:38   ` Hongtao Liu
2021-07-01  6:16 ` [PATCH 50/62] AVX512FP16: Add testcases for vfcmaddcph/vfmaddcph/vfcmulcph/vfmulcph liuhongt
2021-07-01  6:16 ` [PATCH 51/62] AVX512FP16: Add vfcmaddcsh/vfmaddcsh/vfcmulcsh/vfmulcsh liuhongt
2021-07-01  6:16 ` [PATCH 52/62] AVX512FP16: Add testcases for vfcmaddcsh/vfmaddcsh/vfcmulcsh/vfmulcsh liuhongt
2021-07-01  6:16 ` [PATCH 53/62] AVX512FP16: Add expander for sqrthf2 liuhongt
2021-07-23  5:12   ` Hongtao Liu
2021-07-01  6:16 ` [PATCH 54/62] AVX512FP16: Add expander for ceil/floor/trunc/roundeven liuhongt
2021-07-01  6:16 ` [PATCH 55/62] AVX512FP16: Add expander for cstorehf4 liuhongt
2021-07-01  6:16 ` [PATCH 56/62] AVX512FP16: Optimize (_Float16) sqrtf ((float) f16) to sqrtf16 (f16) liuhongt
2021-07-01  9:50   ` Richard Biener
2021-07-01 10:23     ` Hongtao Liu
2021-07-01 12:43       ` Richard Biener
2021-07-01 21:48         ` Joseph Myers
2021-07-02  7:38           ` Richard Biener
2021-07-01 21:17   ` Joseph Myers
2021-07-01  6:16 ` [PATCH 57/62] AVX512FP16: Add expander for fmahf4 liuhongt
2021-07-01  6:16 ` [PATCH 58/62] AVX512FP16: Optimize for code like (_Float16) __builtin_ceif ((float) f16) liuhongt
2021-07-01  9:52   ` Richard Biener
2021-07-01 21:26   ` Joseph Myers
2021-07-02  7:36     ` Richard Biener
2021-07-02 11:46       ` Bernhard Reutner-Fischer
2021-07-04  5:17         ` Hongtao Liu
2021-07-01  6:16 ` [PATCH 59/62] AVX512FP16: Support load/store/abs intrinsics liuhongt
2021-09-22 10:30   ` Hongtao Liu
2021-07-01  6:16 ` [PATCH 60/62] AVX512FP16: Add reduce operators(add/mul/min/max) liuhongt
2021-07-01  6:16 ` [PATCH 61/62] AVX512FP16: Add complex conjugation intrinsic instructions liuhongt
2021-07-01  6:16 ` [PATCH 62/62] AVX512FP16: Add permutation and mask blend intrinsics liuhongt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMZc-bzP1hjEEckXLD5VXFdkAdpHhH1f63HMJ19wfeLbQ0aNMQ@mail.gmail.com \
    --to=crazylht@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=hongtao.liu@intel.com \
    --cc=jakub@redhat.com \
    --cc=ubizjak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).