public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-2453] riscv: Define Xmode macro
@ 2023-07-12  8:13 Kito Cheng
  0 siblings, 0 replies; only message in thread
From: Kito Cheng @ 2023-07-12  8:13 UTC (permalink / raw)
  To: gcc-cvs

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

commit r14-2453-ga3480aacc4ab01651725a63e05829a43bc23d549
Author: Christoph Müllner <christoph.muellner@vrull.eu>
Date:   Tue Apr 25 15:24:13 2023 +0200

    riscv: Define Xmode macro
    
    Define a Xmode macro that specifies the registers size (XLEN)
    similar to Pmode. This allows the backend code to write generic
    RV32/RV64 C code (under certain circumstances).
    
    gcc/ChangeLog:
    
            * config/riscv/riscv.h (Xmode): New macro.
    
    Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>

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

diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h
index 83dcac165b5..7d548ac4b23 100644
--- a/gcc/config/riscv/riscv.h
+++ b/gcc/config/riscv/riscv.h
@@ -800,6 +800,10 @@ typedef struct {
 
 #define Pmode word_mode
 
+/* Specify the machine mode that registers have.  */
+
+#define Xmode (TARGET_64BIT ? DImode : SImode)
+
 /* Give call MEMs SImode since it is the "most permissive" mode
    for both 32-bit and 64-bit targets.  */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-12  8:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-12  8:13 [gcc r14-2453] riscv: Define Xmode macro Kito Cheng

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).