From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id 360913857365 for ; Sun, 13 Nov 2022 23:05:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 360913857365 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-ej1-x634.google.com with SMTP id 13so24506685ejn.3 for ; Sun, 13 Nov 2022 15:05:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=kDf6CpvIiHTXCKB+bGNFUiN2AZZOL3Lt7/xgFFvIVw0=; b=AiVnnOnyLSOGjL+tkaZIXrr9DNy2Pc7TOlV8P5hmG5SpSMIAep5+sCvMSSIF03e6Ur JdBsd51ttc+z/Wocfux0Z8qdtV74RINtiBiNhYgawDfaosdTNmmXbHBuaB2V0mufE5AR 6l5c60nRH78+MwlE7tNkRQne1VtG7YK6nZ2OKpW6XqRu/k/qpM+SLHpDbbUztgq2AUnd 5/j2jhf6mLcINX80xkCd9sKZ6a99iBR5M/BA2aQp65mUs3AzfAald6x3XpwuvtpF0+JU s2Dc922mCdkuqP6bZGe4TwAuRCxN5A2ccot4GIh+fq5Wo8uYML3a2P6UJHx0x6Y8uwql 5zsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kDf6CpvIiHTXCKB+bGNFUiN2AZZOL3Lt7/xgFFvIVw0=; b=ljWdJSwi6orWywv08mPxw0i59bgNMo3ZuKMSs58NHXFUixcUvAVSR/BStP5SbcyjtW neNwoW2cWQv18WhU2q+YH6KBCwTl44rvMC8uC5epAapXtvW8X6+lDRH9oQ8aIARiYsyn TyWUa+U3v6np8LQZ8LT8Kd+KpjTv6P9oA0fAalekF3A/wS2P84GPTDWh8Y3FphxRKjjC S/IY746MhtGPM3tUSSt1eOY1Lt3lnbDviMNDVz5gmo1E6G5e7dCEoC+ObgGMcDG4+l0G sXq+zEreYcMqN7hVWLviXv23sjPWxX8l66quP3esmO5XhZCJQ5yL3nGtCxgtj5AsFfpO Xb7Q== X-Gm-Message-State: ANoB5pmerw7JC0o4sxvVbz+ANTB1lg6q7UTjcsABhwebhjMqnvkqLus6 fzYzdDr4XPjSWWZHBll9zeUzpf/g6kamjWYR X-Google-Smtp-Source: AA0mqf74RgiScC6Kmq9hxRUSYj/MfyzoN5lNko7THo3SA7KYksHwydWmNhHRuBmsUcOTtv6clhWoKw== X-Received: by 2002:a17:906:f196:b0:78d:6a9b:216c with SMTP id gs22-20020a170906f19600b0078d6a9b216cmr8542359ejb.602.1668380725766; Sun, 13 Nov 2022 15:05:25 -0800 (PST) Received: from beast.fritz.box (62-178-148-172.cable.dynamic.surfer.at. [62.178.148.172]) by smtp.gmail.com with ESMTPSA id ku3-20020a170907788300b007ae21bbdd3fsm2361281ejc.162.2022.11.13.15.05.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 15:05:25 -0800 (PST) From: Christoph Muellner To: gcc-patches@gcc.gnu.org, Kito Cheng , Jim Wilson , Palmer Dabbelt , Andrew Waterman , Philipp Tomsich , Jeff Law , Vineet Gupta Subject: [PATCH 1/7] riscv: bitmanip: add orc.b as an unspec Date: Mon, 14 Nov 2022 00:05:15 +0100 Message-Id: <20221113230521.712693-2-christoph.muellner@vrull.eu> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221113230521.712693-1-christoph.muellner@vrull.eu> References: <20221113230521.712693-1-christoph.muellner@vrull.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_MANYTO,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: From: Philipp Tomsich As a basis for optimized string functions (e.g., the by-pieces implementations), we need orc.b available. This adds orc.b as an unspec, so we can expand to it. gcc/ChangeLog: * config/riscv/bitmanip.md (orcb2): Add orc.b as an unspec. * config/riscv/riscv.md: Add UNSPEC_ORC_B. Signed-off-by: Philipp Tomsich --- gcc/config/riscv/bitmanip.md | 8 ++++++++ gcc/config/riscv/riscv.md | 3 +++ 2 files changed, 11 insertions(+) diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md index b44fb9517e7..3dbe6002974 100644 --- a/gcc/config/riscv/bitmanip.md +++ b/gcc/config/riscv/bitmanip.md @@ -242,6 +242,14 @@ (define_insn "rotlsi3_sext" "rolw\t%0,%1,%2" [(set_attr "type" "bitmanip")]) +;; orc.b (or-combine) is added as an unspec for the benefit of the support +;; for optimized string functions (such as strcmp). +(define_insn "orcb2" + [(set (match_operand:X 0 "register_operand" "=r") + (unspec:X [(match_operand:X 1 "register_operand" "r")] UNSPEC_ORC_B))] + "TARGET_ZBB" + "orc.b\t%0,%1") + (define_insn "bswap2" [(set (match_operand:X 0 "register_operand" "=r") (bswap:X (match_operand:X 1 "register_operand" "r")))] diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md index 798f7370a08..532289dd178 100644 --- a/gcc/config/riscv/riscv.md +++ b/gcc/config/riscv/riscv.md @@ -62,6 +62,9 @@ (define_c_enum "unspec" [ ;; Stack tie UNSPEC_TIE + + ;; OR-COMBINE + UNSPEC_ORC_B ]) (define_c_enum "unspecv" [ -- 2.38.1