Message ID | 20211111141020.2738001-3-philipp.tomsich@vrull.eu |
---|---|
State | Deferred, archived |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> 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 B7785385AC1D for <patchwork@sourceware.org>; Thu, 11 Nov 2021 14:14:16 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by sourceware.org (Postfix) with ESMTPS id E7C1A3857C64 for <gcc-patches@gcc.gnu.org>; Thu, 11 Nov 2021 14:10:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E7C1A3857C64 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-lf1-x132.google.com with SMTP id b1so8611121lfs.13 for <gcc-patches@gcc.gnu.org>; Thu, 11 Nov 2021 06:10:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull-eu.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BFD6ISME8C+orS+3J2LXk3cTm00Lpf2p4Bi/zPt2h4c=; b=NRB2u1i4DKBD6h5U5ddpT4+LRU5T6zNTfrZUDkr5oOnkmKsMu9N58Li5DAQdybif1s F9oAVyhVrcdvS2QdtqkkOU1BbMl316g8FsYU/ImqSwBZL61dJI7RYleQ54ry1NNQGr3M HEubQh2L6zo7Uj1mDbCHi3B+S98WuzN/m71Rsaar9GKJ4yfXkN3uhc/panCmS9r5Mlfy L9julM089WE2VmXnktFFixtK/RKFGgHHd1dFvcanXSlAKBaX/iRhVatISLDT29TY4d+E WuCSEQWDNdCxWzXAXTBBT3MNL4LEOeH7BVnk5pCjwPVnBFM1Fhpd+EzV8FrXOY9NvPIm piKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BFD6ISME8C+orS+3J2LXk3cTm00Lpf2p4Bi/zPt2h4c=; b=ct/Fo7CEuWAI9JBNTTUTFsChVBpS1fw3enksZIYI2fgUV8zn4/yw58A/MUZ5nXt9hQ 2uV5gPcmRntkfgSSOrW7S8lZMMjhHsaDSdPS1CMvUQ6T1x1gNl91ZKtiV+g9z7lw4Zro YZpyN68ndmlSvpDyiVKwhsyykCSpCvnCzGjXBD5o/JcwZj5VApEpWitTQqU+Ojbu26rN XNNI5JBkrlsysfdwf0jsz2riAhQZWQjganCyO7C+spUKJuclQLZRie3VuI/CHOIDif7S KZ7IE8cbv7U7mnnVVkh3/ejqwt7RqU2HzTfhxhSdXwAvCDSO4Iwnu0n486icnggVF4Mg YEnA== X-Gm-Message-State: AOAM532e4LeZgpyqX9Cll6jvLQ2n+LsePU9sayKGf7XmhXp00N0yp33r 7bcSaA0mFGB4WUo0GYCKdacEXLFRjcAYru9u X-Google-Smtp-Source: ABdhPJyCXpBMQ2ZBhaTn7y+vX79CWjIxyM9SgWldT/YWvAJvlaBBUJ1xB8OOYzzky+tuFLQDpaM1jA== X-Received: by 2002:a05:6512:2611:: with SMTP id bt17mr6648779lfb.189.1636639825655; Thu, 11 Nov 2021 06:10:25 -0800 (PST) Received: from ubuntu-focal.. ([2a01:4f9:3a:1e26::2]) by smtp.gmail.com with ESMTPSA id a23sm274427ljh.140.2021.11.11.06.10.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Nov 2021 06:10:25 -0800 (PST) From: Philipp Tomsich <philipp.tomsich@vrull.eu> To: gcc-patches@gcc.gnu.org Subject: [PATCH v1 2/8] RISC-V: costs: handle BSWAP Date: Thu, 11 Nov 2021 15:10:14 +0100 Message-Id: <20211111141020.2738001-3-philipp.tomsich@vrull.eu> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211111141020.2738001-1-philipp.tomsich@vrull.eu> References: <20211111141020.2738001-1-philipp.tomsich@vrull.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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> Cc: wilson@tuliptree.org, kito.cheng@gmail.com, Philipp Tomsich <philipp.tomsich@vrull.eu> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
Improvements to bitmanip-1.0 (Zb[abcs]) support
|
|
Commit Message
Philipp Tomsich
Nov. 11, 2021, 2:10 p.m. UTC
The BSWAP operation is not handled in rtx_costs. Add it.
gcc/ChangeLog:
* config/riscv/riscv.c (rtx_costs): Add BSWAP.
Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
---
gcc/config/riscv/riscv.c | 8 ++++++++
1 file changed, 8 insertions(+)
Comments
> diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c > index c77b0322869..8480cf09294 100644 > --- a/gcc/config/riscv/riscv.c > +++ b/gcc/config/riscv/riscv.c > @@ -2131,6 +2131,14 @@ riscv_rtx_costs (rtx x, machine_mode mode, int outer_code, int opno ATTRIBUTE_UN > *total = riscv_extend_cost (XEXP (x, 0), GET_CODE (x) == ZERO_EXTEND); > return false; > > + case BSWAP: > + if (TARGET_ZBB) > + { > + *total = COSTS_N_INSNS (1); Add a cost model for HImode? maybe `*total = COSTS_N_INSNS (mode == HImode ? 2 : 1);` ?
diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c index c77b0322869..8480cf09294 100644 --- a/gcc/config/riscv/riscv.c +++ b/gcc/config/riscv/riscv.c @@ -2131,6 +2131,14 @@ riscv_rtx_costs (rtx x, machine_mode mode, int outer_code, int opno ATTRIBUTE_UN *total = riscv_extend_cost (XEXP (x, 0), GET_CODE (x) == ZERO_EXTEND); return false; + case BSWAP: + if (TARGET_ZBB) + { + *total = COSTS_N_INSNS (1); + return true; + } + return false; + case FLOAT: case UNSIGNED_FLOAT: case FIX: