From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by sourceware.org (Postfix) with ESMTPS id C3A533948A7B for ; Mon, 14 Jun 2021 07:58:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C3A533948A7B Received: by mail-ed1-x535.google.com with SMTP id s6so45217869edu.10 for ; Mon, 14 Jun 2021 00:58:55 -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; bh=/oGzeGLd4Kfrrhx3I56pLzmionuuBEcOZ3dSP+T9ofA=; b=X5ZQCZEBYOKa/ZU0FZvTyhkIBL5ne23dxdbFAoUmPHBZa4NiEn/y99tq3gxlBs5ArQ ULYJ9QqWhN706LiavpDg0FWCkc4Wh5kc0Umoots2vWebKR/u0+0pY8JHOM3m/2rcqvPt YkZPTjJzjoe8hjIm28yVWbNJEV8C9vt2KlIMK3Y2BbxF1VdliXc4GjEaAKCeFOJ3fgxX MdSiC2v4FUTxysjWoN0+dIm7q3ao3HoaL7SDjllSwPOuZR/UxmR3iig8d2Jx2W4fnm0k 6Gvqq0Mv2se8ohM2H8URM0T1p3pEs1WI1oocs3feQJIFNPLePszyqyUFlfd86DXTaLD9 DbCA== X-Gm-Message-State: AOAM533Ztt4LnefAggadX1Hz49HeK32ZbnVLAeYmMuW1ta0rgWrsGOAc tfPRuN4BsegSiRLiVNHXcNJNRkwThw07aFE3Klg3t2xfAOdt9w== X-Google-Smtp-Source: ABdhPJzIxQDSb/5eoDIV179QXB2lufpOR2lTFxugsrFLu5YbDVJ+r4b1R0osdxtcU6f9Dco0KSNL7TrUvDSkdnUt98Q= X-Received: by 2002:a05:6402:b76:: with SMTP id cb22mr15761238edb.112.1623657534762; Mon, 14 Jun 2021 00:58:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Prathamesh Kulkarni Date: Mon, 14 Jun 2021 13:28:17 +0530 Message-ID: Subject: Re: [ARM] PR97906 - Missed lowering abs(a) >= abs(b) to vacge To: gcc Patches , Kyrill Tkachov Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Mon, 14 Jun 2021 07:58:57 -0000 On Mon, 7 Jun 2021 at 12:46, Prathamesh Kulkarni wrote: > > On Tue, 1 Jun 2021 at 16:03, Prathamesh Kulkarni > wrote: > > > > Hi, > > As mentioned in PR, for following test-case: > > > > #include > > > > uint32x2_t f1(float32x2_t a, float32x2_t b) > > { > > return vabs_f32 (a) >= vabs_f32 (b); > > } > > > > uint32x2_t f2(float32x2_t a, float32x2_t b) > > { > > return (uint32x2_t) __builtin_neon_vcagev2sf (a, b); > > } > > > > We generate vacge for f2, but with -ffast-math, we generate following for f1: > > f1: > > vabs.f32 d1, d1 > > vabs.f32 d0, d0 > > vcge.f32 d0, d0, d1 > > bx lr > > > > This happens because, the middle-end inverts the comparison to b <= a, > > .optimized dump: > > _8 = __builtin_neon_vabsv2sf (a_4(D)); > > _7 = __builtin_neon_vabsv2sf (b_5(D)); > > _1 = _7 <= _8; > > _2 = VIEW_CONVERT_EXPR(_1); > > _6 = VIEW_CONVERT_EXPR(_2); > > return _6; > > > > and combine fails to match the following pattern: > > (set (reg:V2SI 121) > > (neg:V2SI (le:V2SI (abs:V2SF (reg:V2SF 123)) > > (abs:V2SF (reg:V2SF 122))))) > > > > because neon_vca pattern has GTGE code iterator. > > The attached patch adjusts the neon_vca patterns to use GLTE instead > > similar to neon_vca_fp16insn, and removes NEON_VACMP iterator. > > Code-gen with patch: > > f1: > > vacle.f32 d0, d1, d0 > > bx lr > > > > Bootstrapped + tested on arm-linux-gnueabihf and cross-tested on arm*-*-*. > > OK to commit ? > ping https://gcc.gnu.org/pipermail/gcc-patches/2021-June/571568.html ping * 2 https://gcc.gnu.org/pipermail/gcc-patches/2021-June/571568.html Thanks, Prathamesh > > Thanks, > Prathamesh > > > > Thanks, > > Prathamesh