0.9.9.1:
authorJuho Snellman <jsnell@iki.fi>
Thu, 26 Jan 2006 21:51:31 +0000 (21:51 +0000)
committerJuho Snellman <jsnell@iki.fi>
Thu, 26 Jan 2006 21:51:31 +0000 (21:51 +0000)
        Use an opt-in strategy for SSE. By default use the base version
        of fast_bzero unconditionally. The cpuid-based detection is only
        enabled when we have reason to believe that the operating system
        supports SSE. Patch by NIIMI Satoshi.

src/runtime/bsd-os.c
src/runtime/linux-os.c
src/runtime/x86-arch.h
src/runtime/x86-assem.S
version.lisp-expr

index 2c84a10..0bd5fc9 100644 (file)
@@ -299,16 +299,14 @@ static void freebsd_init()
      * x86-assem.S.
      */
 #ifdef LISP_FEATURE_X86
-    extern void fast_bzero_base(void *, size_t);
-    extern void (*fast_bzero_pointer)(void *, size_t);
     size_t len;
     int instruction_sse;
 
     len = sizeof(instruction_sse);
-    if (sysctlbyname("hw.instruction_sse", &instruction_sse, &len, NULL, 0) != 0
-        || instruction_sse == 0) {
-        /* Use the non-SSE version*/
-        fast_bzero_pointer = fast_bzero_base;
+    if (sysctlbyname("hw.instruction_sse", &instruction_sse, &len, NULL, 0) == 0
+        && instruction_sse != 0) {
+        /* Use the SSE detector */
+        fast_bzero_pointer = fast_bzero_detect;
     }
 #endif /* LISP_FEATURE_X86 */
 }
index 778f72c..2b1dd25 100644 (file)
@@ -208,6 +208,10 @@ os_init(char *argv[], char *envp[])
             fprintf(stderr, "WARNING: Couldn't re-execute SBCL with the proper personality flags (maybe /proc isn't mounted?). Trying to continue anyway.\n");
         }
     }
+    /* Use SSE detector.  Recent versions of Linux enable SSE support
+     * on SSE capable CPUs.  */
+    /* FIXME: Are there any old versions that does not support SSE?  */
+    fast_bzero_pointer = fast_bzero_detect;
 #endif
 }
 
index f8174c2..7fe1aa0 100644 (file)
@@ -56,4 +56,7 @@ swap_lispobjs(volatile lispobj *dest, lispobj value)
     return old_value;
 }
 
+extern void fast_bzero_detect(void *, size_t);
+extern void (*fast_bzero_pointer)(void *, size_t);
+
 #endif /* _X86_ARCH_H */
index cae77e3..2069f96 100644 (file)
@@ -868,9 +868,9 @@ GNAME(exception_trampoline):
         .align 4
 GNAME(fast_bzero_pointer):
         /* Variable containing a pointer to the bzero function to use.
-         * Initially points to a function that detects which implementation
-         * should be used, and then updates the variable. */
-        .long GNAME(fast_bzero_detect)
+         * Initially points to a basic function.  Change this variable
+         * to fast_bzero_detect if OS supports SSE.  */
+        .long GNAME(fast_bzero_base)
 \f
        .text
        .align  align_8byte,0x90
index 110602a..937d404 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.9"
+"0.9.9.1"