summaryrefslogtreecommitdiff
path: root/src/arch/riscv/include/bits.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/riscv/include/bits.h')
-rw-r--r--src/arch/riscv/include/bits.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/arch/riscv/include/bits.h b/src/arch/riscv/include/bits.h
index f69c7ec0da..d824f3ec98 100644
--- a/src/arch/riscv/include/bits.h
+++ b/src/arch/riscv/include/bits.h
@@ -47,10 +47,19 @@
#define STR(x) XSTR(x)
#define XSTR(x) #x
-# define SLL32 sllw
-# define STORE sd
-# define LOAD ld
-# define LOG_REGBYTES 3
+#if __riscv_xlen == 64
+#define SLL32 sllw
+#define STORE sd
+#define LOAD ld
+#define LWU lwu
+#define LOG_REGBYTES 3
+#else
+#define SLL32 sll
+#define STORE sw
+#define LOAD lw
+#define LWU lw
+#define LOG_REGBYTES 2
+#endif
#define REGBYTES (1 << LOG_REGBYTES)