Update of /cvsroot/sbcl/sbcl/src/runtime
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29494/src/runtime
Modified Files:
bsd-os.c linux-os.c x86-arch.h x86-assem.S
Log Message:
0.9.9.1:
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.
Index: bsd-os.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/bsd-os.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- bsd-os.c 22 Jan 2006 18:55:07 -0000 1.31
+++ bsd-os.c 26 Jan 2006 21:51:32 -0000 1.32
@@ -299,16 +299,14 @@
* 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: linux-os.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/linux-os.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- linux-os.c 4 Dec 2005 22:25:07 -0000 1.57
+++ linux-os.c 26 Jan 2006 21:51:32 -0000 1.58
@@ -208,6 +208,10 @@
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: x86-arch.h
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/x86-arch.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- x86-arch.h 4 Oct 2005 17:31:27 -0000 1.11
+++ x86-arch.h 26 Jan 2006 21:51:32 -0000 1.12
@@ -56,4 +56,7 @@
return old_value;
}
+extern void fast_bzero_detect(void *, size_t);
+extern void (*fast_bzero_pointer)(void *, size_t);
+
#endif /* _X86_ARCH_H */
Index: x86-assem.S
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/x86-assem.S,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- x86-assem.S 9 Jan 2006 12:45:47 -0000 1.27
+++ x86-assem.S 26 Jan 2006 21:51:32 -0000 1.28
@@ -868,9 +868,9 @@
.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)
.text
.align align_8byte,0x90
|