Message ID | 20221113212030.4078815-6-philipp.tomsich@vrull.eu |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1837122wru; Sun, 13 Nov 2022 13:24:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf5J59PdVG+10/9CdLaZXm5S9l/XiQNFfJSUki9j2nNXK8MyGB2R/Pru2X40zbhsXB+cDgPT X-Received: by 2002:a17:906:53d8:b0:7ad:cc9f:4ae0 with SMTP id p24-20020a17090653d800b007adcc9f4ae0mr8001069ejo.504.1668374654158; Sun, 13 Nov 2022 13:24:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668374654; cv=none; d=google.com; s=arc-20160816; b=B6DfkqaMJqh1ylYFC2ySeBjThBki/MR88M+iCYxcLPp4nWhNzdBLnFM5Bea21/xW7Y qqixNOA2xG6KAWmxmFc6xxGam1hgLb3Jiy2IAy4t+XsyIRCmqPp7sptBP0O8aqnuSOe6 OlLvvbJZr9NzhhE2qYxIHgaspycZX4F1nU7Tn3BwkhcCJIDwzWi7UtUygWNzRpDLdSbj ClsLuadd1E1q4Z4byy86TUWQ1a8i5j/ZQ1Rg2IgNCNLPALEtfqV4fhmXIDglZTSkb9qQ ZvkoM2HHiY2ACHkAZ1SAf746jFcIZ1G18r4vx20ooSkcw3A8xfr++oYSj6O8dBbZ+DqR ensA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=RIq9mP5aMinKyTfA0EYklaBArZOHJY9294/fIk2BNqY=; b=xcBoyQN85mYneRHnxB9Qu7h369e5gZNeG5eyiBfhgizRcI/KawpQu/nkcu1mJHibnN cBxM/MYO/8uj1LxbiQlv83utmINJo7c8jAJr1rDBeX5ozSYrVzNkvnlmyGXfSCRJjEdF oSCd4AOqkFmUE31FnhVf6FNZwyt09e5BSYNP9inXU6oYfzEZJL4acUrBjdauHSd6MyFg fI+svxsnNWB1qOwnacxUlaGTEFo4eU6Oo8ubzgksOCQTXyAglw4e/PQyVnKjbt3GFGtS 1HHUTsbdw+Y/hLeBjlW9Iy+NnetMeYkJd6/9eZ16wTe53H/9up/vr/LbO7yGcv+oD4LK NeFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=GdFpJlsa; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id q26-20020a50cc9a000000b0045c3f6adb7csi7204857edi.215.2022.11.13.13.24.13 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 13:24:14 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@vrull.eu header.s=google header.b=GdFpJlsa; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 56F753896C0A for <ouuuleilei@gmail.com>; Sun, 13 Nov 2022 21:21:41 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by sourceware.org (Postfix) with ESMTPS id 67AD53885520 for <gcc-patches@gcc.gnu.org>; Sun, 13 Nov 2022 21:20:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 67AD53885520 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-lj1-x22f.google.com with SMTP id t10so10790628ljj.0 for <gcc-patches@gcc.gnu.org>; Sun, 13 Nov 2022 13:20:41 -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:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RIq9mP5aMinKyTfA0EYklaBArZOHJY9294/fIk2BNqY=; b=GdFpJlsaZnpJqmOzBtHG1xPEvUxMpLqgvnMPuxlE1c1qvDINpcMXmXjDXsDBgpKYdO XNRJq+knG9ChQDidRUvE+hLmSCWRCnntw449WLwsU35JcemqqAN9BfDzNb02CGcRS2ng mvatfQrxRoFawh2tEQxlIwgNnm/YGVwIa7dwN0qaqwDWD7ZSKrFkIxicWVc4nqQ3Og5o s1PV7JTAGiUO6JtRjZetDD+PdQvC5wl9qLVzRgEYehWSkDOxebmLjoQYY5wLLahMSLyW JC5D8XUK0xlYNzkWg0IAzC4z1N09THDpHO/UIS3DTNSKzGwwUFBBIY9XfT3/IOaocjzb gNDQ== 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:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RIq9mP5aMinKyTfA0EYklaBArZOHJY9294/fIk2BNqY=; b=HtxgY5Hkqm5BXlY0f7q3LkBJoJ+Ooq0lt5Xe6ssw/wUhl4kESGBuk1rcrEuRbzVmEC 2Up/O2xRnnMqCQDHo8A3YHUL9rvzQ8utc7kvNPRpQXzA2GlgfUG9ziV4p2NOach8YuWM LPefeRkYmplxyZ8H9nw4On6/0XiKj0EC882wAzy58fwJRVhaKy3l7+aLd1VY5R30WWcq N4i3L/prh7jTnZWgUia0I829TAWv+B/FaNkmZL9oMj+1wq+16R36f/825iheun23Fcvd cE16WxnZULUuODKDArECvHKD2fBD0CbCTRHw0JkdPd34W1DvPO1Dzc6HVEx0UiuOMJ1O egNg== X-Gm-Message-State: ANoB5plHVgEzKUsiQ3qfs056HRl597WVTOdWjhvY8stU0MwQQZdVhXUG eqDuM6jJx9x/ur5eiiQgbclg5IdwQhzBu6YE X-Received: by 2002:a2e:7209:0:b0:277:13a1:187e with SMTP id n9-20020a2e7209000000b0027713a1187emr3149600ljc.498.1668374439503; Sun, 13 Nov 2022 13:20:39 -0800 (PST) Received: from ubuntu-focal.. ([2a01:4f9:3a:1e26::2]) by smtp.gmail.com with ESMTPSA id d5-20020a0565123d0500b004948ddb4e4dsm1529079lfv.301.2022.11.13.13.20.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Nov 2022 13:20:39 -0800 (PST) From: Philipp Tomsich <philipp.tomsich@vrull.eu> To: gcc-patches@gcc.gnu.org Cc: Jeff Law <jlaw@ventanamicro.com>, Vineet Gupta <vineetg@rivosinc.com>, Kito Cheng <kito.cheng@gmail.com>, Christoph Muellner <christoph.muellner@vrull.eu>, Palmer Dabbelt <palmer@rivosinc.com>, Philipp Tomsich <philipp.tomsich@vrull.eu> Subject: [PATCH v2 5/8] RISC-V: Recognize bexti in negated if-conversion Date: Sun, 13 Nov 2022 22:20:26 +0100 Message-Id: <20221113212030.4078815-6-philipp.tomsich@vrull.eu> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221113212030.4078815-1-philipp.tomsich@vrull.eu> References: <20221113212030.4078815-1-philipp.tomsich@vrull.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749417621509417015?= X-GMAIL-MSGID: =?utf-8?q?1749417621509417015?= |
Series |
RISC-V: Backend support for XVentanaCondOps/ZiCondops
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Philipp Tomsich
Nov. 13, 2022, 9:20 p.m. UTC
While the positive case "if ((bits >> SHAMT) & 1)" for SHAMT 0..10 can
trigger conversion into efficient branchless sequences
- with Zbs (bexti + neg + and)
- with XVentanaCondOps (andi + vt.maskc)
the inverted/negated case results in
andi a5,a0,1024
seqz a5,a5
neg a5,a5
and a5,a5,a1
due to how the sequence presents to the combine pass.
This adds an additional splitter to reassociate the polarity reversed
case into bexti + addi, if Zbs is present.
gcc/ChangeLog:
* config/riscv/xventanacondops.md: Add split to reassociate
"andi + seqz + neg" into "bexti + addi".
Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
---
Changes in v2:
- Removed spurious empty line at the end of xventanacondops.md.
gcc/config/riscv/xventanacondops.md | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/gcc/config/riscv/xventanacondops.md b/gcc/config/riscv/xventanacondops.md index a4068e53c13..81e5e8a8298 100644 --- a/gcc/config/riscv/xventanacondops.md +++ b/gcc/config/riscv/xventanacondops.md @@ -119,3 +119,13 @@ { operands[2] = GEN_INT(1 << UINTVAL(operands[2])); }) + +(define_split + [(set (match_operand:X 0 "register_operand") + (neg:X (eq:X (zero_extract:X (match_operand:X 1 "register_operand") + (const_int 1) + (match_operand 2 "immediate_operand")) + (const_int 0))))] + "!TARGET_XVENTANACONDOPS && TARGET_ZBS" + [(set (match_dup 0) (zero_extract:X (match_dup 1) (const_int 1) (match_dup 2))) + (set (match_dup 0) (plus:X (match_dup 0) (const_int -1)))])