public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Kito Cheng <kito@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r13-2330] RISC-V: Add vector registers in TARGET_CONDITIONAL_REGISTER_USAGE
Date: Thu,  1 Sep 2022 02:04:23 +0000 (GMT)	[thread overview]
Message-ID: <20220901020423.F2CC838362FE@sourceware.org> (raw)

https://gcc.gnu.org/g:e8c83ab9d5142a305bbd75c7ff0e41eae38433df

commit r13-2330-ge8c83ab9d5142a305bbd75c7ff0e41eae38433df
Author: zhongjuzhe <juzhe.zhong@rivai.ai>
Date:   Tue Aug 30 14:27:52 2022 +0800

    RISC-V: Add vector registers in TARGET_CONDITIONAL_REGISTER_USAGE
    
    gcc/ChangeLog:
    
            * config/riscv/riscv.cc (riscv_conditional_register_usage): Add vector
            registers.

Diff:
---
 gcc/config/riscv/riscv.cc | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 30cbf00542e..675d92c0961 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -5438,6 +5438,15 @@ riscv_conditional_register_usage (void)
       for (int regno = FP_REG_FIRST; regno <= FP_REG_LAST; regno++)
 	call_used_regs[regno] = 1;
     }
+
+  if (!TARGET_VECTOR)
+    {
+      for (int regno = V_REG_FIRST; regno <= V_REG_LAST; regno++)
+	fixed_regs[regno] = call_used_regs[regno] = 1;
+
+      fixed_regs[VTYPE_REGNUM] = call_used_regs[VTYPE_REGNUM] = 1;
+      fixed_regs[VL_REGNUM] = call_used_regs[VL_REGNUM] = 1;
+    }
 }
 
 /* Return a register priority for hard reg REGNO.  */

                 reply	other threads:[~2022-09-01  2:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220901020423.F2CC838362FE@sourceware.org \
    --to=kito@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).