aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidlt <david.abd@gmail.com>2018-05-22 14:35:04 +0200
committerEugene Kliuchnikov <eustas@google.com>2018-05-22 14:35:04 +0200
commitf9b8c02673c576a3e807edbf3a9328e9e7af6d7c (patch)
treed089e7a8cc26a98c6045abc289d9fbe68ee3214b
parent48a25b3fa4c486cac053830b0ac7072ba4d7f7a3 (diff)
downloadbrotli-f9b8c02673c576a3e807edbf3a9328e9e7af6d7c.tar.gz
Add RISC-V 64-bit (riscv64) platform configuration (#669)
Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
-rwxr-xr-xc/common/platform.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/c/common/platform.h b/c/common/platform.h
index 37b9d21..b1fb996 100755
--- a/c/common/platform.h
+++ b/c/common/platform.h
@@ -406,12 +406,16 @@ OR:
#define BROTLI_TARGET_POWERPC64
#endif
+#if defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
+#define BROTLI_TARGET_RISCV64
+#endif
+
#if defined(BROTLI_BUILD_64_BIT)
#define BROTLI_64_BITS 1
#elif defined(BROTLI_BUILD_32_BIT)
#define BROTLI_64_BITS 0
#elif defined(BROTLI_TARGET_X64) || defined(BROTLI_TARGET_ARMV8) || \
- defined(BROTLI_TARGET_POWERPC64)
+ defined(BROTLI_TARGET_POWERPC64) || defined(BROTLI_TARGET_RISCV64)
#define BROTLI_64_BITS 1
#else
#define BROTLI_64_BITS 0
@@ -461,7 +465,8 @@ OR:
#if defined(BROTLI_BUILD_PORTABLE)
#define BROTLI_ALIGNED_READ (!!1)
#elif defined(BROTLI_TARGET_X86) || defined(BROTLI_TARGET_X64) || \
- defined(BROTLI_TARGET_ARMV7) || defined(BROTLI_TARGET_ARMV8)
+ defined(BROTLI_TARGET_ARMV7) || defined(BROTLI_TARGET_ARMV8) || \
+ defined(BROTLI_TARGET_RISCV64)
/* Allow unaligned read only for white-listed CPUs. */
#define BROTLI_ALIGNED_READ (!!0)
#else