From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by sourceware.org (Postfix) with ESMTPS id 88FD83AA9C2B for ; Thu, 15 Jul 2021 08:23:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 88FD83AA9C2B Received: by mail-qk1-x730.google.com with SMTP id 23so4436230qke.0 for ; Thu, 15 Jul 2021 01:23:42 -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:content-transfer-encoding; bh=Vc00Z76iYwbdJl7M8Jl92P3SlrSLJYT64+IJUKERuAg=; b=IRRKBja0Tmxb7066s7sU6Rck5XHssPg3y/4zdJw7eug2ft5F1h3BK4rqCWE1xGnkr+ 8cNc60ATj4jZFMyoh3VXL3yMn8chGlC6sN/roOi8evLwlSRkSv8O/mDWTodvrFkN82Xf U6Znnegdt4zBJD0Wp51NT0pK2y0jeuhx4IzxwVTihFbXgh1vBtHxJl3zFr3dwPSPc8UN WEMTDzfx55BnrIP5cE0FrKUhJ6J+s7iBxBIw62Vr2twEN0qibyJAV19uuzkeNUvim5Sd 7yYLVtLgBBEcgYkIQD8/Z91GxWL8LhO+PmpWjwvVz55I/Zn3RIDJSKDoYHWQohyb2A9z tqvQ== X-Gm-Message-State: AOAM53380eBq7WDtP58TNaa8ZK8RqgZXmI6adPEAg0gsRGr4TLpVDp1l eXCddveLr4pHNY5KLY1gfS2QKNgrEf4wuvkUqoA= X-Google-Smtp-Source: ABdhPJy/xGk0Af8kPwThOsI0/5V/72wnOh5yE+r3j2EoN8DRfAaEu5HHP3bin0Xze3JP0hg496VOjIXK9AK3WAlXCJA= X-Received: by 2002:a05:620a:17a5:: with SMTP id ay37mr2820910qkb.465.1626337422099; Thu, 15 Jul 2021 01:23:42 -0700 (PDT) MIME-Version: 1.0 References: <0b72fa77-a281-35e6-34e3-17cf26f18bc1@linux.ibm.com> <46838de4-3d92-a270-e71a-73fbe923d306@linux.ibm.com> In-Reply-To: From: Uros Bizjak Date: Thu, 15 Jul 2021 10:23: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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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 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 08:23:44 -0000 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 wrot= e: > >>>>> > >>>>> 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 w= rote: > >>>> > >>>>> I guess the proposed IFN would be directly mapped for [us]mul_highp= art? > >>>> > >>>> Yes. > >>>> > >>> > >>> Thanks for confirming! The related patch v2 is attached and the test= ing > >>> 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 be= low: > >> > >> 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-model > 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 that: > 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 optab > support), if we don't follow the same way for IFN_MULH, I'm worried that > we may cost the IFN_MULH wrongly. If taking IFN_MULH as normal stmt is > 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, Uros.