"I am a person who works hard and plays hard."

Yuan Wei
Second Year Graduate Student Department of Computer Science
University of Virginia Charlottesville, VA 22903
Email: yw3f@cs.virginia.edu


Source Code Analysis

Main Page   Compound List   File List   Compound Members   File Members  

host.h

Go to the documentation of this file.
00001 /*
00002  * host.h - host-dependent definitions and interfaces
00003  *
00004  * This file is a part of the SimpleScalar tool suite written by
00005  * Todd M. Austin as a part of the Multiscalar Research Project.
00006  *  
00007  * The tool suite is currently maintained by Doug Burger and Todd M. Austin.
00008  * 
00009  * Copyright (C) 1998 by Todd M. Austin
00010  *
00011  * This source file is distributed "as is" in the hope that it will be
00012  * useful.  The tool set comes with no warranty, and no author or
00013  * distributor accepts any responsibility for the consequences of its
00014  * use. 
00015  * 
00016  * Everyone is granted permission to copy, modify and redistribute
00017  * this tool set under the following conditions:
00018  * 
00019  *    This source code is distributed for non-commercial use only. 
00020  *    Please contact the maintainer for restrictions applying to 
00021  *    commercial use.
00022  *
00023  *    Permission is granted to anyone to make or distribute copies
00024  *    of this source code, either as received or modified, in any
00025  *    medium, provided that all copyright notices, permission and
00026  *    nonwarranty notices are preserved, and that the distributor
00027  *    grants the recipient permission for further redistribution as
00028  *    permitted by this document.
00029  *
00030  *    Permission is granted to distribute this file in compiled
00031  *    or executable form under the same conditions that apply for
00032  *    source code, provided that either:
00033  *
00034  *    A. it is accompanied by the corresponding machine-readable
00035  *       source code,
00036  *    B. it is accompanied by a written offer, with no time limit,
00037  *       to give anyone a machine-readable copy of the corresponding
00038  *       source code in return for reimbursement of the cost of
00039  *       distribution.  This written offer must permit verbatim
00040  *       duplication by anyone, or
00041  *    C. it is distributed by someone who received only the
00042  *       executable form, and is accompanied by a copy of the
00043  *       written offer of source code that they received concurrently.
00044  *
00045  * In other words, you are welcome to use, share and improve this
00046 
00047  * source file.  You are forbidden to forbid anyone else to use, share
00048  * and improve what you give them.
00049  *
00050  * INTERNET: dburger@cs.wisc.edu
00051  * US Mail:  1210 W. Dayton Street, Madison, WI 53706
00052  *
00053  * $Id: host.h,v 1.1.1.1 2000/05/26 15:18:57 taustin Exp $
00054  *
00055  * $Log: host.h,v $
00056  * Revision 1.1.1.1  2000/05/26 15:18:57  taustin
00057  * SimpleScalar Tool Set
00058  *
00059  *
00060  * Revision 1.3  1999/12/31 18:36:58  taustin
00061  * cross-endian execution support added
00062  * quad_t naming conflicts removed
00063  *
00064  * Revision 1.2  1999/03/08 06:33:49  taustin
00065  * added SVR4 host support
00066  *
00067  * Revision 1.1  1998/08/27 08:28:46  taustin
00068  * Initial revision
00069  *
00070  *
00071  */
00072 
00073 #ifndef HOST_H
00074 #define HOST_H
00075 
00076 /* make sure host compiler supports ANSI-C */
00077 #ifndef __STDC__ /* an ansi C compiler is required */
00078 #error The SimpleScalar simulators must be compiled with an ANSI C compiler.
00079 #endif /* __STDC__ */
00080 
00081 /* enable inlining here, if supported by host compiler */
00082 #undef INLINE
00083 #if defined(__GNUC__)
00084 #define INLINE          inline
00085 #else
00086 #define INLINE
00087 #endif
00088 
00089 /* bind together two symbols, at preprocess time */
00090 #ifdef __GNUC__
00091 /* this works on all GNU GCC targets (that I've seen...) */
00092 #define SYMCAT(X,Y)     X##Y
00093 #define ANSI_SYMCAT
00094 #else /* !__GNUC__ */
00095 #ifdef OLD_SYMCAT
00096 #define SYMCAT(X,Y)     XY
00097 #else /* !OLD_SYMCAT */
00098 #define SYMCAT(X,Y)     X##Y
00099 #define ANSI_SYMCAT
00100 #endif /* OLD_SYMCAT */
00101 #endif /* __GNUC__ */
00102 
00103 /* host-dependent canonical type definitions */
00104 typedef int bool_t;                     /* generic boolean type */
00105 typedef unsigned char byte_t;           /* byte - 8 bits */
00106 typedef signed char sbyte_t;
00107 typedef unsigned short half_t;          /* half - 16 bits */
00108 typedef signed short shalf_t;
00109 typedef unsigned int word_t;            /* word - 32 bits */
00110 typedef signed int sword_t;
00111 typedef float sfloat_t;                 /* single-precision float - 32 bits */
00112 typedef double dfloat_t;                /* double-precision float - 64 bits */
00113 
00114 /* qword defs, note: not all targets support qword types */
00115 #if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__CC_C89) || defined(__CC_XLC)
00116 #define HOST_HAS_QWORD
00117 typedef unsigned long long qword_t;     /* qword - 64 bits */
00118 typedef signed long long sqword_t;
00119 #ifdef ANSI_SYMCAT
00120 #define ULL(N)          N##ULL          /* qword_t constant */
00121 #define LL(N)           N##LL           /* sqword_t constant */
00122 #else /* OLD_SYMCAT */
00123 #define ULL(N)          NULL    /* qword_t constant */
00124 #define LL(N)           NLL             /* sqword_t constant */
00125 #endif
00126 #elif defined(__alpha)
00127 #define HOST_HAS_QWORD
00128 typedef unsigned long qword_t;          /* qword - 64 bits */
00129 typedef signed long sqword_t;
00130 #ifdef ANSI_SYMCAT
00131 #define ULL(N)          N##UL           /* qword_t constant */
00132 #define LL(N)           N##L            /* sqword_t constant */
00133 #else /* OLD_SYMCAT */
00134 #define ULL(N)          NUL             /* qword_t constant */
00135 #define LL(N)           NL              /* sqword_t constant */
00136 #endif
00137 #elif defined(_MSC_VER)
00138 #define HOST_HAS_QWORD
00139 typedef unsigned __int64 qword_t;       /* qword - 64 bits */
00140 typedef signed __int64 sqword_t;
00141 #define ULL(N)          ((qword_t)(N))
00142 #define LL(N)           ((sqword_t)(N))
00143 #else /* !__GNUC__ && !__alpha */
00144 #undef HOST_HAS_QWORD
00145 #endif
00146 
00147 /* statistical counter types, use largest counter type available */
00148 #ifdef HOST_HAS_QWORD
00149 typedef sqword_t counter_t;
00150 typedef sqword_t tick_t;                /* NOTE: unsigned breaks caches */
00151 #else /* !HOST_HAS_QWORD */
00152 typedef dfloat_t counter_t;
00153 typedef dfloat_t tick_t;
00154 #endif /* HOST_HAS_QWORD */
00155 
00156 #ifdef __svr4__
00157 #define setjmp  _setjmp
00158 #define longjmp _longjmp
00159 #endif
00160 
00161 #endif /* HOST_H */


UVa CS Department of Computer Science
School of Engineering, University of Virginia
151 Engineer's Way, P.O. Box 400740
Charlottesville, Virginia 22904-4740

(434) 982-2200  Fax: (434) 982-2214