From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id CA1013857001 for ; Tue, 11 Oct 2022 13:58:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CA1013857001 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665496727; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=8VlHDdr5GMEKAKHc3RRK+4J3GO1ZEfOhAmjxv2QcBqg=; b=Dwq0HyefNZxOEvqvrVkfR/qmezP+BBFtQHxxjxRM25JGIInj+pAWleM99OXx4lvFycT5fe JKLUop7loPx9BDDflCv4SukVijauLmLMdGoD/tzWwB5L8kwxOeleVoXfqriuuJXn85WDn2 LuEwfrn2o04oytClMRBhY7NpOMzGrus= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-185-SBLEjQxlMUumWx5Q91BEww-1; Tue, 11 Oct 2022 09:58:44 -0400 X-MC-Unique: SBLEjQxlMUumWx5Q91BEww-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DF63F858F13; Tue, 11 Oct 2022 13:58:43 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9ECB12166B26; Tue, 11 Oct 2022 13:58:43 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 29BDweqc2969809 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 11 Oct 2022 15:58:41 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 29BDwdFQ2969808; Tue, 11 Oct 2022 15:58:39 +0200 Date: Tue, 11 Oct 2022 15:58:39 +0200 From: Jakub Jelinek To: liuhongt Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] [x86] Add define_insn_and_split to support general version of "kxnor". Message-ID: Reply-To: Jakub Jelinek References: <20221011080316.1778261-1-hongtao.liu@intel.com> MIME-Version: 1.0 In-Reply-To: <20221011080316.1778261-1-hongtao.liu@intel.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,WEIRD_PORT 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 Tue, Oct 11, 2022 at 04:03:16PM +0800, liuhongt via Gcc-patches wrote: > gcc/ChangeLog: > > * config/i386/i386.md (*notxor_1): New post_reload > define_insn_and_split. > (*notxorqi_1): Ditto. > --- a/gcc/config/i386/i386.md > +++ b/gcc/config/i386/i386.md > @@ -10826,6 +10826,39 @@ (define_insn "*_1" > (set_attr "type" "alu, alu, msklog") > (set_attr "mode" "")]) > > +(define_insn_and_split "*notxor_1" > + [(set (match_operand:SWI248 0 "nonimmediate_operand" "=rm,r,?k") > + (not:SWI248 > + (xor:SWI248 > + (match_operand:SWI248 1 "nonimmediate_operand" "%0,0,k") > + (match_operand:SWI248 2 "" "r,,k")))) > + (clobber (reg:CC FLAGS_REG))] > + "ix86_binary_operator_ok (XOR, mode, operands)" > + "#" > + "&& reload_completed" > + [(parallel > + [(set (match_dup 0) > + (xor:SWI248 (match_dup 1) (match_dup 2))) > + (clobber (reg:CC FLAGS_REG))]) > + (set (match_dup 0) > + (not:SWI248 (match_dup 1)))] > +{ > + if (MASK_REGNO_P (REGNO (operands[0]))) This causes --enable-checking=yes,rtl,extra regression on gcc.dg/store_merging_13.c test on x86_64-linux: .../gcc/testsuite/gcc.dg/store_merging_13.c: In function 'f13': .../gcc/testsuite/gcc.dg/store_merging_13.c:189:1: internal compiler error: RTL check: expected code 'reg', have 'mem' in rhs_regno, at rtl.h:1932 0x7b0c8f rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int, char const*) ../../gcc/rtl.cc:916 0x8e74be rhs_regno ../../gcc/rtl.h:1932 0x9785fd rhs_regno ./genrtl.h:120 0x9785fd gen_split_260(rtx_insn*, rtx_def**) ../../gcc/config/i386/i386.md:10846 0x23596dc split_insns(rtx_def*, rtx_insn*) ../../gcc/config/i386/i386.md:16392 0xfccd5a try_split(rtx_def*, rtx_insn*, int) ../../gcc/emit-rtl.cc:3799 0x132e9d8 split_insn ../../gcc/recog.cc:3384 0x13359d5 split_all_insns() ../../gcc/recog.cc:3488 0x1335ae8 execute ../../gcc/recog.cc:4412 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. Fixed thusly, tested on x86_64-linux, committed to trunk as obvious. 2022-10-11 Jakub Jelinek PR target/107185 * config/i386/i386.md (*notxor_1): Use MASK_REG_P (x) instead of MASK_REGNO_P (REGNO (x)). --- gcc/config/i386/i386.md.jj 2022-10-11 12:10:42.188891134 +0200 +++ gcc/config/i386/i386.md 2022-10-11 15:47:45.531449089 +0200 @@ -10843,7 +10843,7 @@ (define_insn_and_split "*notxor_1" (set (match_dup 0) (not:SWI248 (match_dup 0)))] { - if (MASK_REGNO_P (REGNO (operands[0]))) + if (MASK_REG_P (operands[0])) { emit_insn (gen_kxnor (operands[0], operands[1], operands[2])); DONE; Jakub