From 875d09ffcabdde721c240f8ae0820137fe8ab5b7 Mon Sep 17 00:00:00 2001 From: wuruilong Date: Thu, 7 Sep 2023 11:35:17 +0000 Subject: [PATCH] Add support for loongarch --- include/Zycore/Defines.h | 2 ++ src/Format.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/Zycore/Defines.h b/include/Zycore/Defines.h index 3eaed88..0b266eb 100644 --- a/include/Zycore/Defines.h +++ b/include/Zycore/Defines.h @@ -136,6 +136,8 @@ # define ZYAN_ARM #elif defined(__EMSCRIPTEN__) || defined(__wasm__) || defined(__WASM__) # define ZYAN_WASM +#elif defined(__loongarch__) +# define ZYAN_LOONGARCH #elif defined(__powerpc64__) # define ZYAN_PPC64 #elif defined(__powerpc__) diff --git a/src/Format.c b/src/Format.c index bd8e8e8..46d87e1 100644 --- a/src/Format.c +++ b/src/Format.c @@ -423,7 +423,7 @@ ZyanStatus ZyanStringAppendFormat(ZyanString* string, const char* format, ...) ZyanStatus ZyanStringAppendDecU(ZyanString* string, ZyanU64 value, ZyanU8 padding_length) { -#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) || defined(ZYAN_PPC64) || defined(ZYAN_RISCV64) +#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) || defined(ZYAN_PPC64) || defined(ZYAN_RISCV64) || defined(ZYAN_LOONGARCH) return ZyanStringAppendDecU64(string, value, padding_length); #else // Working with 64-bit values is slow on non 64-bit systems @@ -464,7 +464,7 @@ ZyanStatus ZyanStringAppendDecS(ZyanString* string, ZyanI64 value, ZyanU8 paddin ZyanStatus ZyanStringAppendHexU(ZyanString* string, ZyanU64 value, ZyanU8 padding_length, ZyanBool uppercase) { -#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) || defined(ZYAN_PPC64) || defined(ZYAN_RISCV64) +#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) || defined(ZYAN_PPC64) || defined(ZYAN_RISCV64) || defined(ZYAN_LOONGARCH) return ZyanStringAppendHexU64(string, value, padding_length, uppercase); #else // Working with 64-bit values is slow on non 64-bit systems