diff --git a/contrib/sockets/sockets.lisp b/contrib/sockets/sockets.lisp index 609d0451c..6e680c008 100755 --- a/contrib/sockets/sockets.lisp +++ b/contrib/sockets/sockets.lisp @@ -107,7 +107,7 @@ (define-c-constants +af-inet+ "AF_INET" - +af-local+ #-sun4sol2 "AF_LOCAL" #+sun4sol2 "AF_UNIX" + +af-local+ #-(or sun4sol2 aix) "AF_LOCAL" #+(or sun4sol2 aix) "AF_UNIX" +eagain+ "EAGAIN" +eintr+ "EINTR") diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 84afdd68a..3e93a53d3 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -442,6 +442,11 @@ case "${host_os}" in ECL_LDRPATH='-Wld=\"-rld_l ~A\"' clibs="-Wld=-lrld" ;; + aix*) + PICFLAG='' + thehost="aix" + shared="no" + ;; *) thehost="$host_os" shared="no" diff --git a/src/bdwgc/libatomic_ops/src/atomic_ops/sysdeps/ibmc/powerpc.h b/src/bdwgc/libatomic_ops/src/atomic_ops/sysdeps/ibmc/powerpc.h index e2d40272a..cb79c8903 100644 --- a/src/bdwgc/libatomic_ops/src/atomic_ops/sysdeps/ibmc/powerpc.h +++ b/src/bdwgc/libatomic_ops/src/atomic_ops/sysdeps/ibmc/powerpc.h @@ -16,6 +16,8 @@ #include "../all_aligned_atomic_load_store.h" +#include "../test_and_set_t_is_ao_t.h" + void AO_sync(void); #pragma mc_func AO_sync { "7c0004ac" } @@ -55,11 +57,42 @@ AO_store_release(volatile AO_t *addr, AO_t value) /* This is similar to the code in the garbage collector. Deleting */ /* this and having it synthesized from compare_and_swap would probably */ /* only cost us a load immediate instruction. */ -/*AO_INLINE AO_TS_VAL_t +AO_INLINE AO_TS_VAL_t AO_test_and_set(volatile AO_TS_t *addr) { -# error FIXME Implement me +#if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__) +/* Completely untested. And we should be using smaller objects anyway. */ + unsigned long oldval; + unsigned long temp = 1; /* locked value */ + + __asm__ __volatile__( + "1:ldarx %0,0,%1\n" /* load and reserve */ + "cmpdi %0, 0\n" /* if load is */ + "bne 2f\n" /* non-zero, return already set */ + "stdcx. %2,0,%1\n" /* else store conditional */ + "bne- 1b\n" /* retry if lost reservation */ + "2:\n" /* oldval is zero if we set */ + : "=&r"(oldval) + : "r"(addr), "r"(temp) + : "memory", "cr0"); +#else + int oldval; + int temp = 1; /* locked value */ + + __asm__ __volatile__( + "1:lwarx %0,0,%1\n" /* load and reserve */ + "cmpwi %0, 0\n" /* if load is */ + "bne 2f\n" /* non-zero, return already set */ + "stwcx. %2,0,%1\n" /* else store conditional */ + "bne- 1b\n" /* retry if lost reservation */ + "2:\n" /* oldval is zero if we set */ + : "=&r"(oldval) + : "r"(addr), "r"(temp) + : "memory", "cr0"); +#endif + return (AO_TS_VAL_t)oldval; } -#define AO_HAVE_test_and_set*/ +#define AO_HAVE_test_and_set + AO_INLINE AO_TS_VAL_t AO_test_and_set_acquire(volatile AO_TS_t *addr) { @@ -87,12 +120,36 @@ AO_test_and_set_full(volatile AO_TS_t *addr) { #define AO_HAVE_test_and_set_full #endif /* !AO_PREFER_GENERALIZED */ -/*AO_INLINE AO_t +AO_INLINE AO_t AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old_val, AO_t new_val) { -# error FIXME Implement me + AO_t fetched_val; +# if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__) + __asm__ __volatile__( + "1:ldarx %0,0,%1\n" /* load and reserve */ + "cmpd %0, %3\n" /* if load is not equal to */ + "bne 2f\n" /* old_val, fail */ + "stdcx. %2,0,%1\n" /* else store conditional */ + "bne- 1b\n" /* retry if lost reservation */ + "2:\n" + : "=&r"(fetched_val) + : "r"(addr), "r"(new_val), "r"(old_val) + : "memory", "cr0"); +# else + __asm__ __volatile__( + "1:lwarx %0,0,%1\n" /* load and reserve */ + "cmpw %0, %3\n" /* if load is not equal to */ + "bne 2f\n" /* old_val, fail */ + "stwcx. %2,0,%1\n" /* else store conditional */ + "bne- 1b\n" /* retry if lost reservation */ + "2:\n" + : "=&r"(fetched_val) + : "r"(addr), "r"(new_val), "r"(old_val) + : "memory", "cr0"); +# endif + return fetched_val; } -#define AO_HAVE_fetch_compare_and_swap*/ +#define AO_HAVE_fetch_compare_and_swap AO_INLINE AO_t AO_fetch_compare_and_swap_acquire(volatile AO_t *addr, AO_t old_val, diff --git a/src/c/printer/write_sse.d b/src/c/printer/write_sse.d index 1913df5c2..d3447af7d 100644 --- a/src/c/printer/write_sse.d +++ b/src/c/printer/write_sse.d @@ -16,11 +16,11 @@ See file '../Copyright' for full details. */ - +#ifdef ECL_SSE2 #include #include -#ifdef ECL_SSE2 + static int is_all_FF(void *ptr, int size) { int i; diff --git a/src/cmp/cmpos-features.lsp b/src/cmp/cmpos-features.lsp index 57cef14b0..21fe67a4b 100644 --- a/src/cmp/cmpos-features.lsp +++ b/src/cmp/cmpos-features.lsp @@ -137,7 +137,10 @@ we are currently using with ECL." (executable-features #-windows (run-and-collect-keywords "file" (list ecl-binary))) - (compiler-version (run-and-collect-keywords c::*cc* '("--version"))) + (compiler-version (run-and-collect-keywords c::*cc* + (if (search "xlc" c::*cc*) + '("-qversion") + '("--version")))) (compiler-features (reduce #'append (mapcar #'rest (compiler-defines +compiler-macros+))))) diff --git a/src/configure b/src/configure index f151f8d56..dbeabb07b 100755 --- a/src/configure +++ b/src/configure @@ -5064,6 +5064,11 @@ LSP_FEATURES="(cons :android ${LSP_FEATURES})" ECL_LDRPATH='-Wld=\"-rld_l ~A\"' clibs="-Wld=-lrld" ;; + aix*) + PICFLAG='' + thehost="aix" + shared="no" + ;; *) thehost="$host_os" shared="no" @@ -10275,7 +10280,7 @@ ecl config.status 16.1.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it."