Change cache serialization to do condition testing once when Scheme is
authorChris Hanson <org/chris-hanson/cph>
Wed, 19 Dec 2001 19:53:46 +0000 (19:53 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 19 Dec 2001 19:53:46 +0000 (19:53 +0000)
started rather each time a closure is created.

v7/src/microcode/cmpauxmd/i386.m4
v7/src/microcode/cmpintmd/i386.h

index 58a86ef74841c0d5a45b45eefc2f91984283a86d..940f9c25900642adabe8a1914892c5676672ba5d 100644 (file)
@@ -1,6 +1,6 @@
 ### -*-Midas-*-
 ###
-### $Id: i386.m4,v 1.55 2001/12/17 22:05:33 cph Exp $
+### $Id: i386.m4,v 1.56 2001/12/19 19:53:35 cph Exp $
 ###
 ### Copyright (c) 1992-2001 Massachusetts Institute of Technology
 ###
@@ -670,16 +670,18 @@ define_code_label(EFR(ia32_cache_synchronize))
        leave
        ret
 
-### Conditionally run the CPUID instruction for serialization.
+### Run the CPUID instruction for serialization.
 
-define_hook_label(conditionally_serialize)
-       OP(cmp,l)       TW(IMM(0),ABS(EVR(ia32_cpuid_needed)))
-       je      asm_conditionally_serialize_done
+define_hook_label(serialize_cache)
        pusha
        OP(xor,l)       TW(REG(eax),REG(eax))
        cpuid
        popa
-asm_conditionally_serialize_done:
+       ret
+
+### Stub to be used in place of above on machines that don't need it.
+
+define_hook_label(dont_serialize_cache)
        ret
 \f
 ###    Assembly language hooks used to reduce code size.
index cb4ac56f211d4336754cc2314d17637966fc4b2c..b95b693276afc9a153a193237e75532cf2ac5384 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Id: i386.h,v 1.33 2001/12/16 06:01:33 cph Exp $
+$Id: i386.h,v 1.34 2001/12/19 19:53:46 cph Exp $
 
 Copyright (c) 1992-2001 Massachusetts Institute of Technology
 
@@ -540,6 +540,7 @@ DEFUN_VOID (i386_reset_hook)
 {
   extern int EXFUN (ASM_ENTRY_POINT(i386_interface_initialize), (void));
   extern void EXFUN (declare_builtin, (unsigned long, char *));
+  extern int ia32_cpuid_needed;
   int offset = (COMPILER_REGBLOCK_N_FIXED * (sizeof (SCHEME_OBJECT)));
   unsigned char * esi_value = ((unsigned char *) (&Registers[0]));
   int fp_support_present = (i386_interface_initialize ());
@@ -631,7 +632,14 @@ DEFUN_VOID (i386_reset_hook)
   SETUP_REGISTER (asm_sc_apply_size_7);                        /* -10 */
   SETUP_REGISTER (asm_sc_apply_size_8);                        /* -9 */
   SETUP_REGISTER (asm_interrupt_continuation_2);       /* -8 */
-  SETUP_REGISTER (asm_conditionally_serialize);                /* -7 */
+  if (ia32_cpuid_needed)
+    {
+      SETUP_REGISTER (asm_serialize_cache);            /* -7 */
+    }
+  else
+    {
+      SETUP_REGISTER (asm_dont_serialize_cache);       /* -7 */
+    }
 \f
 #ifdef _MACH_UNIX
   {