From: Matt Birkholz Date: Thu, 8 Mar 2012 03:40:02 +0000 (-0700) Subject: svm: Fix COMPILER_TEMP_SIZE to 2. X-Git-Tag: release-9.2.0~273 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=1f42f5b69b145b8625d004a5b76e61aa9c63de2d;p=mit-scheme.git svm: Fix COMPILER_TEMP_SIZE to 2. On x86-64 sizeof(double)/sizeof(SCHEME_OBJECT) is 1, but svm/machine.scm expects it to be 2 (as on i386). --- diff --git a/src/microcode/cmpintmd/svm1.h b/src/microcode/cmpintmd/svm1.h index 332e754a2..656980580 100644 --- a/src/microcode/cmpintmd/svm1.h +++ b/src/microcode/cmpintmd/svm1.h @@ -32,8 +32,10 @@ USA. #define ASM_RESET_HOOK initialize_svm1 #define COMPILER_REGBLOCK_N_TEMPS 256 -#define COMPILER_TEMP_SIZE ((sizeof (double)) / (sizeof (SCHEME_OBJECT))) -#define COMPILER_REGBLOCK_N_FIXED REGBLOCK_MINIMUM_LENGTH +#define COMPILER_REGBLOCK_N_FIXED 14 +#define COMPILER_TEMP_SIZE 2 +/* COMPILER_TEMP_SIZE is NOT ((sizeof (double)) / (sizeof (SCHEME_OBJECT))). + It must not vary e.g. from 1 on x86-64 to 2 on i386. */ typedef byte_t insn_t; diff --git a/src/microcode/svm1-interp.c b/src/microcode/svm1-interp.c index 4df83ea41..72a236c8c 100644 --- a/src/microcode/svm1-interp.c +++ b/src/microcode/svm1-interp.c @@ -182,9 +182,7 @@ initialize_svm1 (void) FREG_SET (i, 0.0); WREG_SET (SVM1_REG_INTERPRETER_REGISTER_BLOCK, ((word_t)Registers)); - /* These are hard-coded into compiler/machines/svm/machine.scm. */ - assert (COMPILER_TEMP_SIZE == 2); - assert (COMPILER_REGBLOCK_N_FIXED == 14); + assert (((sizeof (double)) / (sizeof (SCHEME_OBJECT))) <= COMPILER_TEMP_SIZE); } #define IMPORT_REGS() do \