aboutsummaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
authorZhang Na <44800775+loongson-zn@users.noreply.github.com>2023-06-20 15:44:23 +0800
committerGitHub <noreply@github.com>2023-06-20 09:44:23 +0200
commit1d8452b783dafd7e2acc0914919d38d46b861765 (patch)
treee11b22a08d810854e4d0780978d7d95beeed66d0 /c
parented1995b6bda19244070ab5d331111f16f67c8054 (diff)
downloadbrotli-1d8452b783dafd7e2acc0914919d38d46b861765.zip
brotli-1d8452b783dafd7e2acc0914919d38d46b861765.tar.gz
brotli-1d8452b783dafd7e2acc0914919d38d46b861765.tar.bz2
Add loongarch64 support (#1022)
Diffstat (limited to 'c')
-rw-r--r--c/common/platform.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/c/common/platform.h b/c/common/platform.h
index 4186a8e..d0e3186 100644
--- a/c/common/platform.h
+++ b/c/common/platform.h
@@ -208,8 +208,13 @@ OR:
#define BROTLI_TARGET_RISCV64
#endif
+#if defined(__loongarch_lp64)
+#define BROTLI_TARGET_LOONGARCH64
+#endif
+
#if defined(BROTLI_TARGET_X64) || defined(BROTLI_TARGET_ARMV8_64) || \
- defined(BROTLI_TARGET_POWERPC64) || defined(BROTLI_TARGET_RISCV64)
+ defined(BROTLI_TARGET_POWERPC64) || defined(BROTLI_TARGET_RISCV64) || \
+ defined(BROTLI_TARGET_LOONGARCH64)
#define BROTLI_TARGET_64_BITS 1
#else
#define BROTLI_TARGET_64_BITS 0
@@ -268,7 +273,7 @@ OR:
#define BROTLI_UNALIGNED_READ_FAST (!!0)
#elif defined(BROTLI_TARGET_X86) || defined(BROTLI_TARGET_X64) || \
defined(BROTLI_TARGET_ARMV7) || defined(BROTLI_TARGET_ARMV8_ANY) || \
- defined(BROTLI_TARGET_RISCV64)
+ defined(BROTLI_TARGET_RISCV64) || defined(BROTLI_TARGET_LOONGARCH64)
/* These targets are known to generate efficient code for unaligned reads
* (e.g. a single instruction, not multiple 1-byte loads, shifted and or'd
* together). */