Annotation of gforth/arch/386/machine.h, revision 1.25

1.1       anton       1: /*
                      2:   This is the machine-specific part for Intel 386 compatible processors
                      3: 
1.25    ! anton       4:   Copyright (C) 1995,1996,1997,1998,2000,2003 Free Software Foundation, Inc.
1.1       anton       5: 
                      6:   This file is part of Gforth.
                      7: 
                      8:   Gforth is free software; you can redistribute it and/or
                      9:   modify it under the terms of the GNU General Public License
                     10:   as published by the Free Software Foundation; either version 2
                     11:   of the License, or (at your option) any later version.
                     12: 
                     13:   This program is distributed in the hope that it will be useful,
                     14:   but WITHOUT ANY WARRANTY; without even the implied warranty of
                     15:   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     16:   GNU General Public License for more details.
                     17: 
                     18:   You should have received a copy of the GNU General Public License
                     19:   along with this program; if not, write to the Free Software
1.13      anton      20:   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
1.1       anton      21: */
                     22: 
1.4       pazsan     23: #ifdef HAVE_LIBKERNEL32
                     24: #ifdef i386
                     25: #define SYSCALL     __attribute__ ((stdcall))
                     26: #endif
                     27: #endif
                     28: 
1.6       anton      29: #ifndef THREADING_SCHEME
                     30: #define THREADING_SCHEME 8
                     31: #endif
1.7       anton      32: 
1.21      anton      33: #if (((__GNUC__==2 && defined(__GNUC_MINOR__) && __GNUC_MINOR__>=95) || (__GNUC__>2))) && defined(FORCE_REG)
1.8       pazsan     34: #if !defined(USE_TOS) && !defined(USE_NO_TOS)
                     35: #define USE_TOS
1.9       pazsan     36: #endif
                     37: #endif
1.8       pazsan     38: #define MEMCMP_AS_SUBROUTINE 1
                     39: 
1.11      anton      40: #ifndef USE_FTOS
                     41: #ifndef USE_NO_FTOS
                     42: /* gcc can't keep TOS in a register on the 386, so don't try */
                     43: #define USE_NO_FTOS
                     44: #endif
                     45: #endif
                     46: 
1.7       anton      47: #include "../generic/machine.h"
1.6       anton      48: 
1.1       anton      49: /* define this if the processor cannot exploit instruction-level
                     50:    parallelism (no pipelining or too few registers) */
                     51: #define CISC_NEXT
                     52: 
                     53: /* 386 and below have no cache, 486 has a shared cache, and the
1.18      anton      54:    Pentium and later employ hardware cache consistency, so
1.1       anton      55:    flush-icache is a noop */
                     56: #define FLUSH_ICACHE(addr,size)
                     57: 
1.20      anton      58: #if defined(FORCE_REG) && !defined(DOUBLY_INDIRECT)
1.1       anton      59: #if (__GNUC__==2 && defined(__GNUC_MINOR__) && __GNUC_MINOR__==5)
                     60: /* i.e. gcc-2.5.x */
                     61: /* this works with 2.5.7; nothing works with 2.5.8 */
                     62: #define IPREG asm("%esi")
                     63: #define SPREG asm("%edi")
1.17      anton      64: #if 0
1.1       anton      65: #ifdef USE_TOS
                     66: #define CFAREG asm("%ecx")
                     67: #else
                     68: #define CFAREG asm("%edx")
1.17      anton      69: #endif
1.1       anton      70: #endif
1.19      anton      71: #else /* !gcc-2.5.x */
1.1       anton      72: /* this works with 2.6.3 (and quite well, too) */
                     73: /* since this is not very demanding, it's the default for other gcc versions */
                     74: #if defined(USE_TOS) && !defined(CFA_NEXT)
1.8       pazsan     75: #if ((__GNUC__==2 && defined(__GNUC_MINOR__) && __GNUC_MINOR__>=95) || (__GNUC__>2))
                     76:      /* gcc 2.95 has a better register allocater */
                     77: #define SPREG asm("%esi")
1.15      anton      78: #define RPREG asm("%edi")
                     79: #define IPREG asm("%ebx")
1.19      anton      80: /* ebp leads to broken code (gcc-3.0); eax, ecx, edx produce compile errors */
1.15      anton      81: #define TOSREG asm("%ecx")
1.19      anton      82: /* ecx works only for TOS, and eax, edx don't work for anything (gcc-3.0) */
                     83: #else /* !(gcc-2.95 or later) */
1.1       anton      84: #define IPREG asm("%ebx")
1.19      anton      85: #endif /* !(gcc-2.95 or later) */
                     86: #else /* !defined(USE_TOS) || defined(CFA_NEXT) */
1.9       pazsan     87: #if ((__GNUC__==2 && defined(__GNUC_MINOR__) && __GNUC_MINOR__>=95) || (__GNUC__>2))
                     88: #define SPREG asm("%esi")
                     89: #define RPREG asm("%edi")
1.14      anton      90: #define IPREG asm("%ebx")
1.19      anton      91: #else /* !(gcc-2.95 or later) */
1.1       anton      92: #define SPREG asm("%ebx")
1.19      anton      93: #endif  /* !(gcc-2.95 or later) */
                     94: #endif /* !defined(USE_TOS) || defined(CFA_NEXT) */
                     95: #endif /* !gcc-2.5.x */
1.20      anton      96: #endif /* defined(FORCE_REG) && !defined(DOUBLY_INDIRECT) */
1.2       pazsan     97: 
                     98: /* #define ALIGNMENT_CHECK 1 */

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>