--- a/include/api/wasmedge/int128.h +++ b/include/api/wasmedge/int128.h @@ -16,7 +16,8 @@ #define WASMEDGE_C_API_INT128_H #if defined(__x86_64__) || defined(__aarch64__) || \ - (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) + (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) || \ + defined(__alpha__) typedef unsigned __int128 uint128_t; typedef __int128 int128_t; #else --- a/include/common/int128.h +++ b/include/common/int128.h @@ -131,7 +131,8 @@ public: constexpr uint128(uint64_t H, uint64_t L) noexcept : Low(L), High(H) {} #if defined(__x86_64__) || defined(__aarch64__) || \ - (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) + (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) || \ + defined(__alpha__) constexpr uint128(unsigned __int128 V) noexcept : Low(static_cast(V)), High(static_cast(V >> 64)) {} #endif @@ -395,7 +396,8 @@ public: constexpr int128(uint128 V) noexcept; constexpr int128(int64_t H, uint64_t L) noexcept : Low(L), High(H) {} #if defined(__x86_64__) || defined(__aarch64__) || \ - (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) + (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) || \ + defined(__alpha__) constexpr int128(__int128 V) noexcept : Low(static_cast(V)), High(V >> 64) {} #endif @@ -539,7 +541,8 @@ public: namespace WasmEdge { // If there is a built-in type __int128, then use it directly #if defined(__x86_64__) || defined(__aarch64__) || \ - (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) + (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) || \ + defined(__alpha__) using int128_t = __int128; using uint128_t = unsigned __int128; #else --- a/include/ast/instruction.h +++ b/include/ast/instruction.h @@ -55,7 +55,8 @@ public: Instruction(OpCode Byte, uint32_t Off = 0) noexcept : Offset(Off), Code(Byte) { #if defined(__x86_64__) || defined(__aarch64__) || \ - (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) + (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) || \ + defined(__alpha__) Data.Num = static_cast(0); #else Data.Num.Low = static_cast(0); @@ -211,7 +212,8 @@ public: /// Getter and setter for the constant value. ValVariant getNum() const noexcept { #if defined(__x86_64__) || defined(__aarch64__) || \ - (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) + (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) || \ + defined(__alpha__) return ValVariant(Data.Num); #else uint128_t N{Data.Num.High, Data.Num.Low}; @@ -220,7 +222,8 @@ public: } void setNum(ValVariant N) noexcept { #if defined(__x86_64__) || defined(__aarch64__) || \ - (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) + (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) || \ + defined(__alpha__) Data.Num = N.get(); #else uint128_t V = N.get(); @@ -316,7 +319,8 @@ private: } Memories; // Type 8: Num. #if defined(__x86_64__) || defined(__aarch64__) || \ - (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) + (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) || \ + defined(__alpha__) uint128_t Num; #else struct { --- a/include/common/errinfo.h +++ b/include/common/errinfo.h @@ -628,7 +628,8 @@ struct fmt::formatter inline constexpr ::uint128_t to_uint128_t(C Val) noexcept { #if defined(__x86_64__) || defined(__aarch64__) || \ - (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) + (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) || \ + defined(__alpha__) return Val; #else return {/* Low */ Val.low(), /* High */ static_cast(Val.high())}; @@ -162,7 +163,8 @@ inline constexpr ::uint128_t to_uint128_ } template inline constexpr ::int128_t to_int128_t(C Val) noexcept { #if defined(__x86_64__) || defined(__aarch64__) || \ - (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) + (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) || \ + defined(__alpha__) return Val; #else return {/* Low */ Val.low(), /* High */ Val.high()}; @@ -174,7 +176,8 @@ template inline constexpr : template inline constexpr C to_WasmEdge_128_t(T Val) noexcept { #if defined(__x86_64__) || defined(__aarch64__) || \ - (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) + (defined(__riscv) && __riscv_xlen == 64) || defined(__s390x__) || \ + defined(__alpha__) return Val; #else return C(Val.High, Val.Low); --- a/lib/system/allocator.cpp +++ b/lib/system/allocator.cpp @@ -9,11 +9,10 @@ #if WASMEDGE_OS_WINDOWS #include "system/winapi.h" -#elif defined(HAVE_MMAP) && defined(__x86_64__) || defined(__aarch64__) || \ - defined(__arm__) || (defined(__riscv) && __riscv_xlen == 64) || \ - defined(__s390x__) -#include #else +#if defined(HAVE_MMAP) +#include +#endif #include #include #include