From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by sourceware.org (Postfix) with ESMTPS id CCAB73858D32 for ; Thu, 7 Jul 2022 06:11:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CCAB73858D32 Received: by mail-qt1-x832.google.com with SMTP id r2so21375504qta.0 for ; Wed, 06 Jul 2022 23:11:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=b/ymI7Mn0Y55pNkI6ccvqP617Cunrh0VN+fcaDnQxQY=; b=KBBLt41zbzbgmQXuYuagpZid/rMdimDbLxtfnqjNGg8Ueap6kDXWyzLiN8RuVT/Itn 2b2ftEb6SRT52pDo2glgO6jy3ZTVhdYSeqxb6soaoEilLWxjz9t29tzp9oIrM0F9VjHL I6L0Ol4ejJ8JS7cVvVV/jEWbgLB+KIVN+ND4QZSSXNu+H0ntQ16Yqu7AOCs9Xs3mTxnS htN8juuhjBBN33c7IZZ8FxnUERQYOb2x+dUEDEnuB6XZ8I+pPNyQzqmGzzqSGQNFRJwv qAaiSiLPd4UZLewIxLgPuF0Iw+uqD5Qr2SZjZ6nhL5EasIZ8VOcmUsSBwem8GnO01nSK Xe0w== X-Gm-Message-State: AJIora9AMB7Kofb6L5/ez+gls2NIkYlhCj47A3/Na8Nzdt3lgHnjy26q Z8sP9YvGhVsTUJ2XGavRwpkR82Wg7GKEYktXX+Y= X-Google-Smtp-Source: AGRyM1tNJK75YucKydyIvVpHriKiHw2xytYwdOqXTJksmppwZdRR7aQyOVLp7Ie7zpXieXmfapuRv+H8X9TDBnh5r1E= X-Received: by 2002:ac8:5a83:0:b0:31a:272f:d67d with SMTP id c3-20020ac85a83000000b0031a272fd67dmr34700356qtc.57.1657174300097; Wed, 06 Jul 2022 23:11:40 -0700 (PDT) MIME-Version: 1.0 References: <20220707055218.663144-1-haochen.jiang@intel.com> In-Reply-To: <20220707055218.663144-1-haochen.jiang@intel.com> From: Uros Bizjak Date: Thu, 7 Jul 2022 08:11:29 +0200 Message-ID: Subject: Re: [PATCH] i386: Handle memory operand for direct call to cvtps2pd in unpack To: Haochen Jiang Cc: "gcc-patches@gcc.gnu.org" , Hongtao Liu , Martin Liska , Jakub Jelinek Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Jul 2022 06:11:42 -0000 On Thu, Jul 7, 2022 at 7:52 AM Haochen Jiang wrote: > > Hi all, > > This patch aim to fix the ICE for vec unpack using for memory after the commit > r13-1418 on inproper insn of cvtps2pd. > > Regtested on x86_64-pc-linux-gnu. Ok for trunk? > > BRs, > Haochen > > gcc/ChangeLog: > > PR target/106180 > * config/i386/sse.md (sse2_cvtps2pd_1): > Rename from *sse2_cvtps2pd_1. > (vec_unpacks_lo_v4sf): Add handler for memory operand. > > gcc/testsuite/ChangeLog: > > PR target/106180 > * g++.target/i386/pr106180-1.C: New test. LGTM. Thanks, Uros. > --- > gcc/config/i386/sse.md | 12 +++++++-- > gcc/testsuite/g++.target/i386/pr106180-1.C | 31 ++++++++++++++++++++++ > 2 files changed, 41 insertions(+), 2 deletions(-) > create mode 100644 gcc/testsuite/g++.target/i386/pr106180-1.C > > diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md > index 3396ff748da..5b91c7be54e 100644 > --- a/gcc/config/i386/sse.md > +++ b/gcc/config/i386/sse.md > @@ -9208,7 +9208,7 @@ > (set_attr "prefix" "maybe_vex") > (set_attr "mode" "V2DF")]) > > -(define_insn "*sse2_cvtps2pd_1" > +(define_insn "sse2_cvtps2pd_1" > [(set (match_operand:V2DF 0 "register_operand" "=v") > (float_extend:V2DF > (match_operand:V2SF 1 "memory_operand" "m")))] > @@ -9270,7 +9270,15 @@ > (vec_select:V2SF > (match_operand:V4SF 1 "vector_operand") > (parallel [(const_int 0) (const_int 1)]))))] > - "TARGET_SSE2") > + "TARGET_SSE2" > +{ > + if (MEM_P (operands[1])) > + { > + operands[1] = adjust_address_nv (operands[1], V2SFmode, 0); > + emit_insn (gen_sse2_cvtps2pd_1 (operands[0], operands[1])); > + DONE; > + } > +}) > > (define_expand "vec_unpacks_lo_v8sf" > [(set (match_operand:V4DF 0 "register_operand") > diff --git a/gcc/testsuite/g++.target/i386/pr106180-1.C b/gcc/testsuite/g++.target/i386/pr106180-1.C > new file mode 100644 > index 00000000000..7f734536001 > --- /dev/null > +++ b/gcc/testsuite/g++.target/i386/pr106180-1.C > @@ -0,0 +1,31 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O3 -c -ffloat-store -std=c++11" } */ > + > +struct PointT > +{ > + double x, y; > +}; > +using PointF = PointT; > + > +template struct __array_traits { typedef PointT _Type[_Nm]; }; > +template struct array > +{ > + typename __array_traits<_Nm>::_Type _M_elems; > +}; > + > +float SampleGrid_low, SampleGrid_high; > +using QuadrilateralF = array<4>; > +struct PerspectiveTransform > +{ > + PerspectiveTransform (QuadrilateralF, QuadrilateralF); > +}; > + > +void SampleGrid() > +{ > + PerspectiveTransform > + { > + { PointF {SampleGrid_high, SampleGrid_low}, > + SampleGrid_low, SampleGrid_high }, > + {} > + }; > +} > -- > 2.18.2 >