From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) by sourceware.org (Postfix) with ESMTPS id E7A943857807 for ; Wed, 26 May 2021 04:12:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E7A943857807 Received: by mail-yb1-xb2b.google.com with SMTP id y197so146471ybe.11 for ; Tue, 25 May 2021 21:12: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; bh=jb2IrVg6bAKPqRtwWTZNaD3/9dOzS2X4GswImu1Go6k=; b=NWRekuZGfvQ8Bf1/7iRT5QGT+EPcNwS+2lOkhp6nTLriq3QXHSW+XZNnyGgJzFU8hW 6obEKxJpbYeVA3iKW/nnfF86lEHAbNQtG4kASxObpQY7kK3rVY+tQMXGnApKYNck5KCy VjN7NNme3GnoMks7iFiGjU8YsODVwmIhEPnaJwR4virdT3jk8GHYzQhsdt8wa3Di64gy 40OYS+SRIRYxnOAkZ26mzSiUkRLigxGtuZiv1AqsBo/BgWgUU+Rm/I19HwWNg2tgiJZ/ FRJoeW3pJyDH8gDUGvAWVH2N0/SwhRjnIL7jPWdhSu/nqlcc4yWrzOEm8/wKoUtp5chv O9oQ== X-Gm-Message-State: AOAM533Cj+xLIQNsBkb0r5KQXOyTPrIWSbTUF+gP1oQNIEA99riN9GHn QLNa8JcNSaWkPijzyRF30rsI9M+J50mTgHt1RGk= X-Google-Smtp-Source: ABdhPJxfGk46nxbsx3dD3NtwBU+VnBfkogF3jEjkGZdMqEXZTy4qSlOiH50N7a80CXDpNbNiSkUi3ELV3D7lW4p2j+k= X-Received: by 2002:a25:be0c:: with SMTP id h12mr47616079ybk.29.1622002362149; Tue, 25 May 2021 21:12:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andrew Pinski Date: Tue, 25 May 2021 21:12:30 -0700 Message-ID: Subject: Re: [PATCH][i386] Split not+broadcast+pand to broadcast+pandn. To: Hongtao Liu Cc: Segher Boessenkool , GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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: Wed, 26 May 2021 04:12:44 -0000 On Tue, May 25, 2021 at 6:17 PM Hongtao Liu wrote: > > Update patch: > The new patch simplify (vec_duplicate (not (nonimmedaite_operand))) > to (not (vec_duplicate (nonimmedaite_operand))). This is not a > straightforward simplification, just adding some tendency to pull not > out of vec_duplicate. > > For i386, it will enable below opt > > from > notl %edi > vpbroadcastd %edi, %xmm0 > vpand %xmm1, %xmm0, %xmm0 > to > vpbroadcastd %edi, %xmm0 > vpandn %xmm1, %xmm0, %xmm0 > > Bootstrapped and regtested on x86_64-linux-gnu{-m32,}. > Ok for trunk? > gcc/ChangeLog: > > PR target/100711 > * simplify-rtx.c (simplify_unary_operation_1): > Simplify (vec_duplicate (not (nonimmedaite_operand))) > to (not (vec_duplicate (nonimmedaite_operand))). > > gcc/testsuite/ChangeLog: > > PR target/100711 > * gcc.target/i386/avx2-pr100711.c: New test. > * gcc.target/i386/avx512bw-pr100711.c: New test. This patch should not use nonimmedaite_operand at all in simplify-rtx.c. Rather use !CONSTANT_P (XEXP (op, 0)) instead. And even then (not CONST_INT) will never be there anyways as it will always be simplified to a constant in the first place. So removing that check is fine. Thanks, Andrew