From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x72e.google.com (mail-qk1-x72e.google.com [IPv6:2607:f8b0:4864:20::72e]) by sourceware.org (Postfix) with ESMTPS id 7CB373AAAC20 for ; Thu, 15 Jul 2021 09:41:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7CB373AAAC20 Received: by mail-qk1-x72e.google.com with SMTP id m68so4547356qke.7 for ; Thu, 15 Jul 2021 02:41:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ByvjW2BmBOZQvgu7eqMV3j0zaDiTBf+u0Gumu0V8QN0=; b=NIV4ASgp6najjSE6LQSmwuo2NcnFcQR36HlCQWhLMpkCjpJH+zJZicm85C8UcZosr0 aKuo3QC9vyWpWoIXJq4fzcnW4GHmoiUSLXOBs23RZxQMwHMEKuaP8339c1Voq9JQ8+Re JPNBKKlbcMDnmU5Xdq5e6QXKbcJkT1Q3zc8+I5K3uBfSu/gkgKXDkp6H+T2q4LYtuj// IHE449AnG1UWfaZhwEQnLkxWpIXw20s00/T5wsuwGlx60K3WDMIzPW/LNBrzcMKGIAaN flpWXL01Pg3DNB+cbs47/IaP3vKJC+RFHtb/di7/oT9+MORblevVhtEq7filctuz9Bzg D/FQ== X-Gm-Message-State: AOAM533YrlvK8H+aZWS1RM8TzuctW+fpSqtXmwTxutejzb8lo7Q34vOv UCewJSTnultN65c6K6qdDqe64BZdqlRLOSI6a98= X-Google-Smtp-Source: ABdhPJyKaFiX9MrRBd30pB+8erlBVB8No/fmCC58pA6zDDYf5n5E7x1G4Zbq0JL+oo1LaRm2EDX12Dbjm8KXrv3nUpM= X-Received: by 2002:ae9:dd06:: with SMTP id r6mr3130362qkf.74.1626342103094; Thu, 15 Jul 2021 02:41:43 -0700 (PDT) MIME-Version: 1.0 References: <0b72fa77-a281-35e6-34e3-17cf26f18bc1@linux.ibm.com> <46838de4-3d92-a270-e71a-73fbe923d306@linux.ibm.com> <6a13bfea-8482-ff6c-c3bf-e0110fc4b298@linux.ibm.com> In-Reply-To: <6a13bfea-8482-ff6c-c3bf-e0110fc4b298@linux.ibm.com> From: Uros Bizjak Date: Thu, 15 Jul 2021 11:41:30 +0200 Message-ID: Subject: Re: [PATCH v3] vect: Recog mul_highpart pattern To: "Kewen.Lin" Cc: Richard Biener , Richard Sandiford , Bill Schmidt , GCC Patches , Segher Boessenkool X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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, 15 Jul 2021 09:41:45 -0000 V =C4=8Det., 15. jul. 2021 10:49 je oseba Kewen.Lin napisala: > on 2021/7/15 =E4=B8=8B=E5=8D=884:23, Uros Bizjak wrote: > > On Thu, Jul 15, 2021 at 10:04 AM Kewen.Lin wrote: > >> > >> Hi Uros, > >> > >> on 2021/7/15 =E4=B8=8B=E5=8D=883:17, Uros Bizjak wrote: > >>> On Thu, Jul 15, 2021 at 9:07 AM Kewen.Lin wrote= : > >>>> > >>>> on 2021/7/14 =E4=B8=8B=E5=8D=883:45, Kewen.Lin via Gcc-patches wrote= : > >>>>> on 2021/7/14 =E4=B8=8B=E5=8D=882:38, Richard Biener wrote: > >>>>>> On Tue, Jul 13, 2021 at 4:59 PM Kewen.Lin > wrote: > >>>>>>> > >>>>>>> on 2021/7/13 =E4=B8=8B=E5=8D=888:42, Richard Biener wrote: > >>>>>>>> On Tue, Jul 13, 2021 at 12:25 PM Kewen.Lin > wrote: > >>>>>> > >>>>>>> I guess the proposed IFN would be directly mapped for > [us]mul_highpart? > >>>>>> > >>>>>> Yes. > >>>>>> > >>>>> > >>>>> Thanks for confirming! The related patch v2 is attached and the > testing > >>>>> is ongoing. > >>>>> > >>>> > >>>> It's bootstrapped & regtested on powerpc64le-linux-gnu P9 and > >>>> aarch64-linux-gnu. But on x86_64-redhat-linux there are XPASSes as > below: > >>>> > >>>> XFAIL->XPASS: gcc.target/i386/pr100637-3w.c scan-assembler pmulhuw > >>>> XFAIL->XPASS: gcc.target/i386/pr100637-3w.c scan-assembler pmulhuw > >>>> XFAIL->XPASS: gcc.target/i386/pr100637-3w.c scan-assembler pmulhw > >>>> XFAIL->XPASS: gcc.target/i386/pr100637-3w.c scan-assembler pmulhw > >>> > >>> These XFAILs should be removed after your patch. > >>> > >> I'm curious whether it's intentional not to specify -fno-vect-cost-mod= el > >> for this test case. As noted above, this case is sensitive on how we > >> cost mult_highpart. Without cost modeling, the XFAILs can be removed > >> only with this mul_highpart pattern support, no matter how we model it > >> (x86 part of this patch exists or not). > >> > >>> This is PR100696 [1], we want PMULH.W here, so x86 part of the patch > >>> is actually not needed. > >>> > >> > >> Thanks for the information! The justification for the x86 part is tha= t: > >> the IFN_MULH essentially covers MULT_HIGHPART_EXPR with mul_highpart > >> optab support, i386 port has already customized costing for > >> MULT_HIGHPART_EXPR (should mean/involve the case with mul_highpart opt= ab > >> support), if we don't follow the same way for IFN_MULH, I'm worried th= at > >> we may cost the IFN_MULH wrongly. If taking IFN_MULH as normal stmt i= s > >> a right thing (we shouldn't cost it specially), it at least means we > >> have to adjust ix86_multiplication_cost for MULT_HIGHPART_EXPR when it > >> has direct mul_highpart optab support, I think they should be costed > >> consistently. Does it sound reasonable? > > > > Ah, I was under impression that i386 part was introduced to avoid > > generation of PMULHW instructions in the testcases above (to keep > > XFAILs). Based on your explanation - yes, the costing function should > > be the same. So, the x86 part is OK. > > > > Thanks! It does have the effect to keep XFAILs. ;) I guess the case > doesn't care about the costing much just like most vectorization cases? > If so, do you want me to remove the xfails with one extra option > "-fno-vect-cost-model" along with this patch. > Yes, please do so. The testcase cares only about PMULHW generation. Thanks, Uros. > BR, > Kewen >