--- a/include/marisa/base.h
+++ b/include/marisa/base.h
@@ -31,7 +31,7 @@
 #if defined(_WIN64) || defined(__amd64__) || defined(__x86_64__) || \
     defined(__ia64__) || defined(__ppc64__) || defined(__powerpc64__) || \
     defined(__sparc64__) || defined(__mips64__) || defined(__aarch64__) || \
-    defined(__s390x__)
+    defined(__s390x__) || (defined(__riscv) && (__riscv_xlen == 64))
  #define MARISA_WORD_SIZE 64
 #else  // defined(_WIN64), etc.
  #define MARISA_WORD_SIZE 32
