shithub: femtolisp

Download patch

ref: 0f664a3861fdcf35a30c877668f330e378270b0e
parent: 737bdb16e48d985da87ea50c57f2580bc95b8219
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Tue Mar 7 16:50:54 EST 2023

quick & dirty arm64 support

--- a/llt/dtypes.h
+++ b/llt/dtypes.h
@@ -34,7 +34,7 @@
 #endif
 
 #if defined(OPENBSD) || defined(FREEBSD) || defined(NETBSD) || defined(__plan9__)
-#if defined(__x86_64__) || defined(__amd64__)
+#if defined(__x86_64__) || defined(__amd64__) || defined(__arm64__)
 #  define __SIZEOF_POINTER__ 8
 #else
 #  define __SIZEOF_POINTER__ 4
--- a/llt/utils.h
+++ b/llt/utils.h
@@ -23,6 +23,9 @@
 #elif defined( __i386__ )//gnu c
 #  define ARCH_X86
 #  define __CPU__ 386
+#elif defined( __arm64__ )
+#  define ARCH_ARM64
+#  define __CPU__ arm64
 #else
 #  error "unknown architecture"
 #endif
@@ -32,7 +35,7 @@
 int str2int(char *str, size_t len, int64_t *res, uint32_t base);
 int isdigit_base(char c, int base);
 
-#ifdef ARCH_X86_64
+#if defined(ARCH_X86_64) || defined(ARCH_ARM64)
 #  define LEGACY_REGS "=Q"
 #else
 #  define LEGACY_REGS "=q"