-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for riscv64 #48
Comments
Hi there, thanks for submitting your patch 🙂 We will try to integrate this upstream. Pasting the patch here for reference: --- a/include/Zycore/Defines.h
+++ b/include/Zycore/Defines.h
@@ -131,6 +131,8 @@
# define ZYAN_AARCH64
#elif defined(_M_ARM) || defined(_M_ARMT) || defined(__arm__) || defined(__thumb__)
# define ZYAN_ARM
+#elif defined(_M_RISCV64) || defined(__riscv) && __riscv_xlen == 64
+# define ZYAN_RISCV64
#elif defined(__EMSCRIPTEN__)
// Nothing to do, `ZYAN_EMSCRIPTEN` is both platform and arch macro for this one.
#else
--- a/src/Format.c
+++ b/src/Format.c
@@ -423,7 +423,7 @@
ZyanStatus ZyanStringAppendDecU(ZyanString* string, ZyanU64 value, ZyanU8 padding_length)
{
-#if defined(ZYAN_X64) || defined(ZYAN_AARCH64)
+#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) || defined(ZYAN_RISCV64)
return ZyanStringAppendDecU64(string, value, padding_length);
#else
// Working with 64-bit values is slow on non 64-bit systems
@@ -464,7 +464,7 @@
ZyanStatus ZyanStringAppendHexU(ZyanString* string, ZyanU64 value, ZyanU8 padding_length,
ZyanBool uppercase)
{
-#if defined(ZYAN_X64) || defined(ZYAN_AARCH64)
+#if defined(ZYAN_X64) || defined(ZYAN_AARCH64) || defined(ZYAN_RISCV64)
return ZyanStringAppendHexU64(string, value, padding_length, uppercase);
#else
// Working with 64-bit values is slow on non 64-bit systems |
@athre0z We should probably as well introduce a generic |
Yeah, was thinking the same thing when reading the patch: let's do that! Maybe |
Hi, many thanks for working on this. |
The patch submitted by Bo in https://bugs.debian.org/1015787 and zyantific#48 also checked for this additional define, but it was not part of 3e95307. This patch adds the additional check. Co-authored-by: Bo YU <[email protected]>
Hi,
I am porting the package to riscv64 arch on Debian, the build is ok and it pass its test suite from my local build log. The patch is here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=1015787;filename=zycore-c-add-support-for-riscv64.patch;msg=5
And the reportbug is here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1015787
If there is any issue please let me know, thanks
The text was updated successfully, but these errors were encountered: