/* ^Forth: Extra register variables and basic includes File: config.hf Author: david.n.williams@umich.edu License: LGPL Version: 0.1.6 Last Revision: November 25, 2002 Copyright (C) 2001, 2002 by David N. Williams This library is part of ^Forth. It is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or at your option any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. Please see the file POLITENESS included with this distribution. */ {" #define _P4_SOURCE 1 /* pfe register variables, etc. */ #include /* Compiler switches for extra registers are NO_EXTRA_REGS, HF_TOSREG, and HF_FTOSREG.*/ #if !defined NO_EXTRA_REGS #if defined __target_arch_ppc register int hf_index asm ("21"); /* top DO ... LOOP params */ register int hf_limit asm ("22"); #ifdef HF_TOSREG register int TOS asm ("23"); register int hf_flag asm ("24"); #endif /* HF_TOSREG */ #ifdef HF_FTOSREG register double FTOS asm ("f14"); #endif /* HF_FTOSREG */ #elif defined __target_arch_i386 static int hf_index; /* top DO ... LOOP params */ static int hf_limit; #undef HF_TOSREG #ifdef HF_FTOSREG /* THIS DOES NOT WORK! */ register double FTOS asm ("%st(7)"); #endif /* HF_FTOSREG */ #elif defined __target_cpu_hppa register int hf_index asm ("r11"); /* top DO ... LOOP params */ register int hf_limit asm ("r10"); #ifdef HF_TOSREG register int TOS asm ("r9"); register int hf_flag asm ("r8"); #endif /* HF_TOSREG */ #ifdef HF_FTOSREG register double FTOS asm ("fr21"); #endif /* HF_FTOSREG */ #else #define NO_EXTRA_REGS 1 #warning Unknown architecture, using no extra register variables. #endif #endif /* !defined NO_EXTRA_REGS */ #ifdef NO_EXTRA_REGS static int hf_index; /* top DO ... LOOP params */ static int hf_limit; #undef HF_TOSREG #undef HF_FTOSREG #endif /* NO_EXTRA_REGS */ #ifdef HF_TOSREG #define HF_FILL_TOS TOS = *SP; /* note ";" in these two */ #define HF_SPILL_TOS *SP = TOS; #define HF_PUSH(A) *SP-- = TOS; TOS = (A) #define HF_POP(A) (A) = TOS; TOS = *++SP #define HF_DROP1 TOS = *++SP #define HF_DROP2 SP += 2; TOS = *SP #define HF_IF HF_POP(hf_flag); if (hf_flag) #define HF_NIF HF_POP(hf_flag); if (!hf_flag) #define HF_UNTIL HF_POP(hf_flag);}while (!hf_flag) #define HF_NUNTIL HF_POP(hf_flag);}while (hf_flag) #else #define TOS *SP #define HF_FILL_TOS #define HF_SPILL_TOS #define HF_PUSH(A) *--SP = (A) #define HF_POP(A) (A) = *SP++ #define HF_DROP1 SP += 1 #define HF_DROP2 SP += 2 #define HF_IF if (*SP++) #define HF_NIF if (!*SP++) #define HF_UNTIL }while (!*SP++) #define HF_NUNTIL }while (*SP++) #endif /* HF_TOSREG */ #ifdef HF_FTOSREG #define HF_FILL_FTOS FTOS = *FP; /* note ";" in these two */ #define HF_SPILL_FTOS *FP = FTOS; #define HF_FPUSH(A) *FP-- = FTOS; FTOS = (A) #define HF_FPOP(A) (A) = FTOS; FTOS = *++FP #define HF_FDROP1 FTOS = *++FP #define HF_FDROP2 FP += 2; FTOS = *FP #define HF_FDROP3 FP += 3; FTOS = *FP #else #define FTOS *FP #define HF_FILL_FTOS #define HF_SPILL_FTOS #define HF_FPUSH(A) *--FP = (A) #define HF_FPOP(A) (A) = *FP++ #define HF_FDROP1 FP += 1 #define HF_FDROP2 FP += 2 #define HF_FDROP3 FP += 3 #endif /* HF_FTOSREG */ /* The basic pfe include. */ #include "}