From 17b4861e53fd5be2107f3b7fd8bf77f3d2cc15da Mon Sep 17 00:00:00 2001 From: lemon Date: Sun, 28 Dec 2025 19:02:39 +0100 Subject: backend: start implementing aarch64 --- common.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'common.h') diff --git a/common.h b/common.h index 9804447..ac4bc88 100644 --- a/common.h +++ b/common.h @@ -73,7 +73,7 @@ ptrhash(const void *p) { static inline uint popcnt(uvlong x) { #if HAS_BUILTIN(popcountll) - return __builtin_popcountll(x); + return x ? __builtin_popcountll(x) : 0; #else uint n = 0; while (x) n += x&1, x >>= 1; @@ -86,7 +86,7 @@ ispo2(uvlong x) { } static inline uint ilog2(uvlong x) { /* assumes x is a power of 2 */ -#if HAS_BUILTIN(ctz) +#if HAS_BUILTIN(ctzll) return __builtin_ctzll(x); #else uint n = 0; @@ -97,7 +97,7 @@ ilog2(uvlong x) { /* assumes x is a power of 2 */ static inline uint lowestsetbit(uvlong x) { -#if HAS_BUILTIN(ctz) +#if HAS_BUILTIN(ctzll) return __builtin_ctzll(x); #else int i = 0; @@ -163,7 +163,7 @@ extern struct inclpaths { /**********/ struct targtriple { - enum mcarch { ISxxx, ISx86_64 } arch; + enum mcarch { ISxxx, ISx86_64, ISaarch64 } arch; enum mcos { OSunknown, OSlinux } os; enum mcabi { ABInone, ABIgnu, ABImusl } abi; }; -- cgit v1.2.3