diff --git a/src/lisp/Config.x86_linux b/src/lisp/Config.x86_linux index b991683940163375ea8d8f390668237844ab39b5..4aa3eee86cb75889d15fb3ecd895a5a8d5aa47e3 100644 --- a/src/lisp/Config.x86_linux +++ b/src/lisp/Config.x86_linux @@ -3,7 +3,7 @@ include Config.x86_common # gcc 8.1.1 and 8.3.1 (and probably anything after 8.1.1?) won't # produce a working lisp with -O2. Just use -O1. -COPT = -O1 +COPT = -O2 CFLAGS += $(COPT) CPPFLAGS += -m32 -D__NO_CTYPE -D_GNU_SOURCE CFLAGS += -rdynamic -march=pentium4 -mfpmath=sse -mtune=generic diff --git a/src/lisp/gencgc.c b/src/lisp/gencgc.c index 01a97fafaa59f9a9c0d4088a854c0eecb54f7693..d9c392b5e8f6ba65c6006ed342e0603784d8280d 100644 --- a/src/lisp/gencgc.c +++ b/src/lisp/gencgc.c @@ -8412,9 +8412,24 @@ gencgc_pickup_dynamic(void) void do_pending_interrupt(void); +//#pragma GCC optimize ("-O1") char * alloc(int nbytes) { +#if 0 && (defined(i386) || defined(__x86_64)) + /* + * Need to save and restore the FPU registers on x86, but only for + * sse2. See Ticket #61. + * + * Not needed by sparc or ppc because we never call alloc from + * Lisp directly to do allocation. + */ + FPU_STATE(fpu_state); + + if (fpu_mode == SSE2) { + save_fpu_state(fpu_state); + } +#endif void *new_obj; #if !(defined(sparc) || (defined(DARWIN) && defined(__ppc__))) /* @@ -8442,19 +8457,19 @@ alloc(int nbytes) set_current_region_free((lispobj) new_free_pointer); break; } else if (bytes_allocated <= auto_gc_trigger) { -#if defined(i386) || defined(__x86_64) - /* - * Need to save and restore the FPU registers on x86, but only for - * sse2. See Ticket #61. - * - * Not needed by sparc or ppc because we never call alloc from - * Lisp directly to do allocation. - */ - FPU_STATE(fpu_state); +#if 1 && (defined(i386) || defined(__x86_64)) + /* + * Need to save and restore the FPU registers on x86, but only for + * sse2. See Ticket #61. + * + * Not needed by sparc or ppc because we never call alloc from + * Lisp directly to do allocation. + */ + FPU_STATE(fpu_state); - if (fpu_mode == SSE2) { - save_fpu_state(fpu_state); - } + if (fpu_mode == SSE2) { + save_fpu_state(fpu_state); + } #endif /* Call gc_alloc. */ boxed_region.free_pointer = (void *) get_current_region_free(); @@ -8466,10 +8481,10 @@ alloc(int nbytes) set_current_region_free((lispobj) boxed_region.free_pointer); set_current_region_end((lispobj) boxed_region.end_addr); -#if defined(i386) || defined(__x86_64) - if (fpu_mode == SSE2) { - restore_fpu_state(fpu_state); - } +#if 1 && (defined(i386) || defined(__x86_64)) + if (fpu_mode == SSE2) { + restore_fpu_state(fpu_state); + } #endif break; } else { @@ -8484,8 +8499,14 @@ alloc(int nbytes) } } +#if 0 && (defined(i386) || defined(__x86_64)) + if (fpu_mode == SSE2) { + restore_fpu_state(fpu_state); + } +#endif return new_obj; } +#pragma GCC optimize ("-O2") char * alloc_pseudo_atomic(int nbytes) @@ -8545,6 +8566,7 @@ component_ptr_from_pc(lispobj * pc) return NULL; } +#pragma GCC optimize ("-O1") /* * Get lower and upper(middle) 28 bits of total allocation */ diff --git a/src/lisp/x86-arch.h b/src/lisp/x86-arch.h index 8314063fd916177cfd89f3b6951704998d6ec3ff..3283cce5ad9f20814da91a488e589f0d8725a4ae 100644 --- a/src/lisp/x86-arch.h +++ b/src/lisp/x86-arch.h @@ -21,12 +21,12 @@ extern boolean os_support_sse2(void); * 512+16 bytes of space and let the routine adjust the appropriate * alignment. */ -#define SSE_STATE_SIZE ((512+16)/4) +#define SSE_STATE_SIZE 512 /* * Just use the SSE size for both x87 and sse2 since the SSE size is * enough for either. */ -#define FPU_STATE(name) int name[SSE_STATE_SIZE]; +#define FPU_STATE(name) u_int8_t name[SSE_STATE_SIZE] __attribute__((aligned(16))) #endif