diff --git a/AK/Platform.h b/AK/Platform.h index 87108c86e0d..8d4503e023e 100644 --- a/AK/Platform.h +++ b/AK/Platform.h @@ -13,14 +13,23 @@ #ifdef __x86_64__ # define AK_ARCH_X86_64 1 +# define AK_IS_ARCH_X86_64() 1 +#else +# define AK_IS_ARCH_X86_64() 0 #endif #ifdef __aarch64__ # define AK_ARCH_AARCH64 1 +# define AK_IS_ARCH_AARCH64() 1 +#else +# define AK_IS_ARCH_AARCH64() 0 #endif #ifdef __wasm32__ # define AK_ARCH_WASM32 1 +# define AK_IS_ARCH_WASM32() 1 +#else +# define AK_IS_ARCH_WASM32() 0 #endif #if (defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8) || defined(_WIN64) @@ -88,7 +97,7 @@ # define AK_OS_EMSCRIPTEN #endif -#define ARCH(arch) (defined(AK_ARCH_##arch) && AK_ARCH_##arch) +#define ARCH(arch) (AK_IS_ARCH_##arch()) #if ARCH(X86_64) # define VALIDATE_IS_X86() @@ -192,7 +201,7 @@ extern "C" { #endif #ifndef AK_SYSTEM_CACHE_ALIGNMENT_SIZE -# if ARCH(AARCH64) || ARCH(x86_64) +# if ARCH(AARCH64) || ARCH(X86_64) # define AK_SYSTEM_CACHE_ALIGNMENT_SIZE 64 # else # define AK_SYSTEM_CACHE_ALIGNMENT_SIZE 128 diff --git a/AK/SIMDMath.h b/AK/SIMDMath.h index 5356d184c52..28df4004e30 100644 --- a/AK/SIMDMath.h +++ b/AK/SIMDMath.h @@ -77,7 +77,7 @@ ALWAYS_INLINE static f32x4 exp_approximate(f32x4 v) ALWAYS_INLINE static f32x4 sqrt(f32x4 v) { -#if ARCH(x86_64) +#if ARCH(X86_64) return __builtin_ia32_sqrtps(v); #else return f32x4 { @@ -91,7 +91,7 @@ ALWAYS_INLINE static f32x4 sqrt(f32x4 v) ALWAYS_INLINE static f32x4 rsqrt(f32x4 v) { -#if ARCH(x86_64) +#if ARCH(X86_64) return __builtin_ia32_rsqrtps(v); #else return f32x4 { diff --git a/Userland/Utilities/readelf.cpp b/Userland/Utilities/readelf.cpp index 19e2cfa57d4..5c608635d5f 100644 --- a/Userland/Utilities/readelf.cpp +++ b/Userland/Utilities/readelf.cpp @@ -186,7 +186,7 @@ static char const* object_symbol_binding_to_string(ElfW(Word) type) static char const* object_relocation_type_to_string(ElfW(Word) type) { switch (type) { -#if ARCH(x86_64) +#if ARCH(X86_64) case R_X86_64_NONE: return "R_X86_64_NONE"; case R_X86_64_64: