From patchwork Mon Feb 26 04:28:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xi Ruoyao X-Patchwork-Id: 86356 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C065A3858C98 for ; Mon, 26 Feb 2024 04:29:21 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id D6DFC3858D1E for ; Mon, 26 Feb 2024 04:28:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D6DFC3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D6DFC3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=89.208.246.23 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708921733; cv=none; b=aIvE2VfJRlrfwLH9bTsc1/jMaKWKGXJFpjk0ranVfZCaPn1JLvCHOUm9VaSNRgKjayAoGXAMIgs3YiENdvo9vSEe4/PrB1MtZ7/eXt6DKTvs0O549vlnp30xKhT1Dr+PsyHCRjxifdJGSplUFyz/ND9Gl3/RqysQGknWMnA6YCw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708921733; c=relaxed/simple; bh=g6GMKkUPGweH8M0CUgJcZmGF1qt/qKQ2Oo0PTRFAHM4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=eHvB/ebnRzduesP4QedJbro5nXuxSphoo8j34gmfAEQkD7O3idd1tEY9CCDKjZ12MQpYsDofSq7dRO0jhnvh6RUtx/xUC2rikxybYEBy/apxRLr+2P65CtvheX5BxKGXOY8g5zOY/sDxtsActreoebBW5b2nZfLoIHRc2vK8V4Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1708921728; bh=g6GMKkUPGweH8M0CUgJcZmGF1qt/qKQ2Oo0PTRFAHM4=; h=From:To:Cc:Subject:Date:From; b=R34s3QZ5DnQnmJZjK8WdDZnIKrCiv/nc1a12r3j/2pu+5b/pv7FThHVWfHdy81Yj+ lEw2WRvWq2dpY7zYMhgymLC624nyx80rawHI+cw1n3c1QmPy73TNgCvV1HW8p25Ytt ghUwTxCpg1ECB6Ymgo0BCbKr9jld37jEZPqg+v+0= Received: from stargazer.. (unknown [IPv6:240e:358:11b4:ae00:dc73:854d:832e:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 0716F66E1A; Sun, 25 Feb 2024 23:28:45 -0500 (EST) From: Xi Ruoyao To: gcc-patches@gcc.gnu.org Cc: chenglulu , i@xen0n.name, xuchenghua@loongson.cn, Xi Ruoyao Subject: [PATCH 1/2] LoongArch: NFC: Deduplicate crc instruction defines Date: Mon, 26 Feb 2024 12:28:03 +0800 Message-ID: <20240226042830.6927-1-xry111@xry111.site> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, LIKELY_SPAM_FROM, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Introduce an iterator for UNSPEC_CRC and UNSPEC_CRCC to make the next change easier. gcc/ChangeLog: * config/loongarch/loongarch.md (CRC): New define_int_iterator. (crc): New define_int_attr. (loongarch_crc_w__w, loongarch_crcc_w__w): Unify into ... (loongarch__w__w): ... here. --- gcc/config/loongarch/loongarch.md | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/gcc/config/loongarch/loongarch.md b/gcc/config/loongarch/loongarch.md index 2ce7a151880..4ded1b3a117 100644 --- a/gcc/config/loongarch/loongarch.md +++ b/gcc/config/loongarch/loongarch.md @@ -4251,24 +4251,16 @@ (define_peephole2 (define_mode_iterator QHSD [QI HI SI DI]) +(define_int_iterator CRC [UNSPEC_CRC UNSPEC_CRCC]) +(define_int_attr crc [(UNSPEC_CRC "crc") (UNSPEC_CRCC "crcc")]) -(define_insn "loongarch_crc_w__w" +(define_insn "loongarch__w__w" [(set (match_operand:SI 0 "register_operand" "=r") (unspec:SI [(match_operand:QHSD 1 "register_operand" "r") (match_operand:SI 2 "register_operand" "r")] - UNSPEC_CRC))] + CRC))] "" - "crc.w..w\t%0,%1,%2" - [(set_attr "type" "unknown") - (set_attr "mode" "")]) - -(define_insn "loongarch_crcc_w__w" - [(set (match_operand:SI 0 "register_operand" "=r") - (unspec:SI [(match_operand:QHSD 1 "register_operand" "r") - (match_operand:SI 2 "register_operand" "r")] - UNSPEC_CRCC))] - "" - "crcc.w..w\t%0,%1,%2" + ".w..w\t%0,%1,%2" [(set_attr "type" "unknown") (set_attr "mode" "")])