From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id C1C5A3858D39 for ; Fri, 28 Oct 2022 22:28:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C1C5A3858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-x235.google.com with SMTP id d3so10080259ljl.1 for ; Fri, 28 Oct 2022 15:28:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=s9HhSwQCqpbynEfvXhxm1DhhzoEokC5ru0YQsTIc31c=; b=nuDplDcgFduw9XF40MFolWPdqUsnu1sUV3ZvlGC9oBk2uFL3YMhrWzB2YPvfgneT0k K9/NT3WovFTIC8cffc6DY3rzktGsUh2JIiN+R2BsWgg1WcA4ZmBKrOYbhn9aBKIOXVQI kMZuWR1ADeks3MC4MebI5NTWkGjGcFtxlyWV4cx4ePFw694RdgmkuNcmdfzXCXg57T2A PY3rkoxbUiC/scpPCFHXSMVFp+WxYiyeyv7HXasquDs+xUvxJPR/Y9qC+XsCKWNoOSO3 PUn3l5o9jMi+33oQB0qre1Bg21onArtDPaZcD4jVCNMcqqLrnz1x1HNvk236QSrfofzb pPAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=s9HhSwQCqpbynEfvXhxm1DhhzoEokC5ru0YQsTIc31c=; b=UAVrlDvF5uNvkmBxTh9ax2lGeGi8VosjPfm53ww7pSrJa8W1FhtqIEp03r3HiWsnVn dEk1ddtCmr4OzMbo9lXnnjF2WOgshKn4+pc5ysJ0oVLaZXKBU9xT5iqev4Dp8tCyGOo1 MNmPwN+B1qCqz78YIr93osxX93TzC5PhBI3B8wKjdZNp0e0XD0Hds+Gz3+Q0hTDe6CPg 4wIBwyjHGVk/ZA3yritLUFLqMlyksqYxkgEal8NxaTshVyWN6fwAVVkR9X08LZBPFAUw BxkeudfH4p1YWH4G7M62IABg7slhNyUcqqP7Nwtw9hj2Dzo6VeAhD2VH7qMtw8FIegFj YMyQ== X-Gm-Message-State: ACrzQf0chQ1vyVe5RGhZB85FxDRSMwMMdtkTmbMImWVKmr9covMM60pw h3vh83WP7UDAt3ZMt5dHjDDu7TtupinMiOQIeyg= X-Google-Smtp-Source: AMsMyM4/5uGeHCKJlOmGaA+Dg6A4muMQemfcVj0A22us955JbizP/wm9VcnFXrbJUMLkz43L5t4HtFh6V6+/6CY9C+E= X-Received: by 2002:a2e:9d5a:0:b0:25e:2c67:edaf with SMTP id y26-20020a2e9d5a000000b0025e2c67edafmr628158ljj.437.1666996133266; Fri, 28 Oct 2022 15:28:53 -0700 (PDT) MIME-Version: 1.0 References: <20221026185857.234023-1-hjl.tools@gmail.com> <20221028213249.GG25951@gate.crashing.org> In-Reply-To: <20221028213249.GG25951@gate.crashing.org> From: "H.J. Lu" Date: Fri, 28 Oct 2022 15:28:16 -0700 Message-ID: Subject: Re: [PATCH] x86: Replace ne:CCC/ne:CCO with UNSPEC_CC_NE in neg patterns To: Segher Boessenkool Cc: gcc-patches@gcc.gnu.org, Uros Bizjak Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3017.2 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Oct 28, 2022 at 2:34 PM Segher Boessenkool wrote: > > On Wed, Oct 26, 2022 at 11:58:57AM -0700, H.J. Lu via Gcc-patches wrote: > > In i386.md, neg patterns which set MODE_CC register like > > > > (set (reg:CCC FLAGS_REG) > > (ne:CCC (match_operand:SWI48 1 "general_reg_operand") (const_int 0))) > > > > can lead to errors when operand 1 is a constant value. If FLAGS_REG in > > But it cannot be. general_reg_operand will not allow that: > === > (define_predicate "general_reg_operand" > (and (match_code "reg") > (match_test "GENERAL_REGNO_P (REGNO (op))"))) > === > > > (set (reg:CCC FLAGS_REG) > > (ne:CCC (const_int 2) (const_int 0))) > > > > is set to 1, RTX simplifiers may simplify > Here is another example: (define_insn "*neg_ccc_1" [(set (reg:CCC FLAGS_REG) (ne:CCC (match_operand:SWI 1 "nonimmediate_operand" "0") (const_int 0))) (set (match_operand:SWI 0 "nonimmediate_operand" "=m") (neg:SWI (match_dup 1)))] "" "neg{}\t%0" [(set_attr "type" "negnot") (set_attr "mode" "")]) Operand 1 can be a known value. H.J.