]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
riscv: Define Xmode macro
authorChristoph Müllner <christoph.muellner@vrull.eu>
Tue, 25 Apr 2023 13:24:13 +0000 (15:24 +0200)
committerKito Cheng <kito.cheng@sifive.com>
Wed, 12 Jul 2023 08:12:27 +0000 (16:12 +0800)
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>
gcc/config/riscv/riscv.h

index 83dcac165b5105ec8a424473888e3b89bb44d883..7d548ac4b23b9383e973a591c66093d3c3d74831 100644 (file)
@@ -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.  */