From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 2DE7A385142A for ; Tue, 1 Jun 2021 14:03:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2DE7A385142A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 151E2svY014712; Tue, 1 Jun 2021 09:02:54 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 151E2sJr014709; Tue, 1 Jun 2021 09:02:54 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Tue, 1 Jun 2021 09:02:54 -0500 From: Segher Boessenkool To: Hongtao Liu Cc: Andrew Pinski , GCC Patches Subject: Re: [PATCH][i386] Split not+broadcast+pand to broadcast+pandn. Message-ID: <20210601140254.GJ3085@gate.crashing.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, TXREP, T_SPF_HELO_PERMERROR, T_SPF_PERMERROR autolearn=no 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: Tue, 01 Jun 2021 14:03:56 -0000 > PR target/100711 > * simplify-rtx.c (simplify_unary_operation_1): > Simplify (vec_duplicate (not op)) to (not (vec_duplicate op)). This is not a simplification. If we want to do this we need to document this canonicalisation (in md.texi, "Insn Canonicalizations"). > + /* Prefer (not (vec_duplicate (nonimmedaite_operand))) > + to (vec_duplicate (not (nonimmedaite_operand))). */ What Andrew said here (also, it's misspelled :-) ) > + case VEC_DUPLICATE: > + if (GET_CODE (op) == NOT) > + return gen_rtx_NOT (mode, gen_rtx_VEC_DUPLICATE (mode, XEXP (op, 0))); > + break; If it isn't a canonicalisation you need to simplify the result, and then only do it if it does in fact simplify. You risk "simplification" loops if you don't. Segher