From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id 160773857C65 for ; Wed, 17 Nov 2021 14:52:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 160773857C65 Received: by mail-ed1-x52b.google.com with SMTP id g14so12329408edb.8 for ; Wed, 17 Nov 2021 06:52:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qumj05riV/T+x5KowXHUI7m1YWQWIPds+k4DNNNZoZ4=; b=mxFE1Z94YbWfz0byDoqIfGN88d5gJVtKC7p6bimOHhYIQ04iIiDmcS5pQAEsyVT+5W oWjy17EvNu05Af7YcsqLmQo5SetSnyNThYPse7fdtgWeCQivgjldIxXAYj9kCYA00j85 ZJTBniQvOP7NfHmuQqJOP/66uMRjzjFGdoe4n6s4uDzLqWtDEpXBhrSIXxnfNV3588En 9399dAdYLKmSHQX8JdJVrBaPhncYQstCn/9oYSocyzliVRsDrjB5c1+slJPFwJ7FdPY6 r1fsZifFxkC427PwIEjUEDWlGLODzJVlea0x56ev+6B/aB7Oq7soYKHs5iD8jY7yEvpq 7jYA== X-Gm-Message-State: AOAM533dfYPRL1QuJMOlOTJdWGRqh3ykoGGnQjolaJLK7xE8BGL1yt/M ogC5RWKLD/unMhhJC7LYXYQVmdRGDmvrfjG+rZc= X-Google-Smtp-Source: ABdhPJzyx6wfwiOQuLroKPbKvGGCo67mAdHTZMlgqP88ueXcGvc38h9qFdOWEOP3QyS279zD8aqNFSN/97aXV2/f3vk= X-Received: by 2002:a17:906:40c4:: with SMTP id a4mr21029953ejk.185.1637160768955; Wed, 17 Nov 2021 06:52:48 -0800 (PST) MIME-Version: 1.0 References: <20211111141020.2738001-1-philipp.tomsich@vrull.eu> <20211111141020.2738001-3-philipp.tomsich@vrull.eu> In-Reply-To: <20211111141020.2738001-3-philipp.tomsich@vrull.eu> From: Kito Cheng Date: Wed, 17 Nov 2021 22:52:37 +0800 Message-ID: Subject: Re: [PATCH v1 2/8] RISC-V: costs: handle BSWAP To: Philipp Tomsich Cc: GCC Patches , wilson@tuliptree.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2021 14:52:51 -0000 > 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);` ?