From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-f177.google.com (mail-vk1-f177.google.com [209.85.221.177]) by sourceware.org (Postfix) with ESMTPS id EE6233857C60 for ; Wed, 5 May 2021 19:26:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org EE6233857C60 Received: by mail-vk1-f177.google.com with SMTP id o17so713505vko.8 for ; Wed, 05 May 2021 12:26:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FWsXTb7imGAobwfpf/NQpraww6QcNBLZ230Kkj4JHko=; b=iS4nyyqbApKafpDFkX4M8Ckt8NgMlYuIamKvCDRsxs5kwXsZ9Z8+M0PpOW9gqQFVFJ veNpHp4FnPeeDSUAyOziAiQynZHxg7ph4EIJBAHKJ0mug5MkEx3CXNqYCsXaoUwrtIwz wMcNdc+mkqK3tRiH95XmQDo1Tsc7DEMtGPL/O9WUxYG5ssBJz2j/etxDmpmpNJ+M54Hg HLW6sTeKLa8g2p2HLLhRvCsfvJ6ddfTiGARJZt8iv70beixbNDS/GvhYVBj69sVEPx/N sVFyQ4mLqg8OF9odI1C1fY0pB1dc3XOkBoyhSJ1lq1o9mT/NwU4j0dUjKzS4emPe5My0 H56w== X-Gm-Message-State: AOAM532GKbgfpIKIGrvG1Be9RHQUBtvj47lMrMvUnT5JKca6i+AaP+o9 CiG5T2XDs2mPdsTek1jBvmerXNYLB1dbnQ== X-Google-Smtp-Source: ABdhPJxqpGp4O6QZtKmuOagAQzrFdHlXk2Xp5v19DW5pAmZ52K2mj8JwLEv/BQSN4DDzF4PU9fXjDA== X-Received: by 2002:a1f:4644:: with SMTP id t65mr220706vka.0.1620242809218; Wed, 05 May 2021 12:26:49 -0700 (PDT) Received: from mail-vs1-f42.google.com (mail-vs1-f42.google.com. [209.85.217.42]) by smtp.gmail.com with ESMTPSA id w144sm14052vke.47.2021.05.05.12.26.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 May 2021 12:26:49 -0700 (PDT) Received: by mail-vs1-f42.google.com with SMTP id h18so1687764vsp.8 for ; Wed, 05 May 2021 12:26:48 -0700 (PDT) X-Received: by 2002:a67:f2c7:: with SMTP id a7mr295178vsn.4.1620242808827; Wed, 05 May 2021 12:26:48 -0700 (PDT) MIME-Version: 1.0 References: <20210426124552.3316789-1-cmuellner@gcc.gnu.org> <20210426124552.3316789-10-cmuellner@gcc.gnu.org> In-Reply-To: From: =?UTF-8?Q?Christoph_M=C3=BCllner?= Date: Wed, 5 May 2021 21:26:37 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 09/10] RISC-V: Generate helpers for cbranch4 [PR 100266] To: Kito Cheng Cc: GCC Patches , Jim Wilson Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 05 May 2021 19:26:51 -0000 On Mon, Apr 26, 2021 at 4:40 PM Kito Cheng wrote: > > This patch is a good and simple improvement which could be an independent patch. > > There is only 1 comment from me for this patch, could you also add @ > to cbranch pattern for floating mode, I would prefer make the > gen_cbranch4 could handle floating mode for consistency. Did that and I also found one more code location, where which could be simplified. Patch can be found here: https://gcc.gnu.org/pipermail/gcc-patches/2021-May/569689.html > > So feel free to commit this patch once you have addressed my comment. > > > > On Mon, Apr 26, 2021 at 8:46 PM Christoph Muellner > wrote: > > > > On RISC-V we are facing the fact, that our conditional branches > > require Pmode conditions. Currently, we generate them explicitly > > with a check for Pmode and then calling the proper generator > > (i.e. gen_cbranchdi4 on RV64 and gen_cbranchsi4 on RV32). > > Let's make simplify this code by using gen_cbranch4 (Pmode). > > > > gcc/ > > PR 100266 > > * config/rsicv/riscv.c (riscv_block_move_loop): Simplify. > > * config/rsicv/riscv.md (cbranch4): Generate helpers. > > --- > > gcc/config/riscv/riscv.c | 5 +---- > > gcc/config/riscv/riscv.md | 2 +- > > 2 files changed, 2 insertions(+), 5 deletions(-) > > > > diff --git a/gcc/config/riscv/riscv.c b/gcc/config/riscv/riscv.c > > index 87cdde73ae21..6e97b38db6db 100644 > > --- a/gcc/config/riscv/riscv.c > > +++ b/gcc/config/riscv/riscv.c > > @@ -3250,10 +3250,7 @@ riscv_block_move_loop (rtx dest, rtx src, unsigned HOST_WIDE_INT length, > > > > /* Emit the loop condition. */ > > test = gen_rtx_NE (VOIDmode, src_reg, final_src); > > - if (Pmode == DImode) > > - emit_jump_insn (gen_cbranchdi4 (test, src_reg, final_src, label)); > > - else > > - emit_jump_insn (gen_cbranchsi4 (test, src_reg, final_src, label)); > > + emit_jump_insn (gen_cbranch4 (Pmode, test, src_reg, final_src, label)); > > > > /* Mop up any left-over bytes. */ > > if (leftover) > > diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md > > index c3687d57047b..52f8a321ac23 100644 > > --- a/gcc/config/riscv/riscv.md > > +++ b/gcc/config/riscv/riscv.md > > @@ -1908,7 +1908,7 @@ > > (label_ref (match_operand 1)) > > (pc)))]) > > > > -(define_expand "cbranch4" > > +(define_expand "@cbranch4" > > [(set (pc) > > (if_then_else (match_operator 0 "comparison_operator" > > [(match_operand:BR 1 "register_operand") > > -- > > 2.31.1 > >