Comments (4)
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
from zycore-c.
@athre0z We should probably as well introduce a generic ZYAN_ARCH64
(open for better name suggestions). Same for 32-bit environments.
from zycore-c.
Yeah, was thinking the same thing when reading the patch: let's do that! Maybe ZYAN_64_BIT_ARCH
? ZYAN_ARCH64
would be fine as well if ARM folks hadn't decided to call their ISA AARCH64
... 😅
from zycore-c.
Hi, many thanks for working on this.
Please feel free to tell me if there need me to do some tests on real riscv64 hardware(Unmatched board). Or:
Applying for accessing to real riscv64 hardware(Unmatched board also) from here:
https://github.com/plctlab/riscv-lab-access
from zycore-c.
Related Issues (17)
- Inconsistent naming scheme (`ZYCORE_` vs `ZYAN_`)
- Don't use floating-point types to provide kernel-mode support
- Build error ZycoreExportConfig.h HOT 2
- Implement more basic containers
- Implement LRU cache
- Warning when building with clang-cl HOT 5
- WDK compatibility
- Coverity complains about likely NPE in zycore HOT 1
- Tag/release zycore-c? HOT 1
- typo in ifdef in Types.h HOT 1
- Support in linux kernel 5.4 HOT 5
- Potential security issue
- Please consider tagging releases HOT 6
- CMake Error HOT 1
- Support running on big-endian architectures HOT 3
- zycore doesn't build on NetBSD HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zycore-c.