AK: Add riscv64 support

This commit is contained in:
Sönke Holz 2023-08-20 19:46:05 +02:00 committed by Jelle Raaijmakers
parent 3c176bafee
commit d572ad38ac
Notes: sideshowbarker 2024-07-17 06:40:21 +09:00
2 changed files with 13 additions and 0 deletions

View file

@ -25,4 +25,5 @@ extern "C" __attribute__((noreturn)) void ak_verification_failed(char const*);
static constexpr bool TODO = false;
# define TODO() VERIFY(TODO) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */
# define TODO_AARCH64() VERIFY(TODO) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */
# define TODO_RISCV64() VERIFY(TODO) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */
#endif

View file

@ -23,6 +23,12 @@
# define AK_IS_ARCH_AARCH64() 0
#endif
#if defined(__riscv) && __riscv_xlen == 64
# define AK_IS_ARCH_RISCV64() 1
#else
# define AK_IS_ARCH_RISCV64() 0
#endif
#ifdef __wasm32__
# define AK_IS_ARCH_WASM32() 1
#else
@ -113,6 +119,12 @@
# define VALIDATE_IS_AARCH64() static_assert(false, "Trying to include aarch64 only header on non aarch64 platform");
#endif
#if ARCH(RISCV64)
# define VALIDATE_IS_RISCV64()
#else
# define VALIDATE_IS_RISCV64() static_assert(false, "Trying to include riscv64 only header on non riscv64 platform");
#endif
#if !defined(AK_COMPILER_CLANG)
# define AK_HAS_CONDITIONALLY_TRIVIAL
#endif