|
|
1.1 ! root 1: /* ! 2: * h/i386/mch.h ! 3: * Machine specific header for the i386 compiler. ! 4: * Typedefs, register names and macros for all compiler phases. ! 5: * This one builds a TINY i386 COHERENT compiler with memory tempfiles. ! 6: */ ! 7: ! 8: #define DATE "7/18/93" /* Date */ ! 9: #define VERSMWC "V4.3.4" /* MWC version number */ ! 10: #define VERSINT "X324" /* Intel version number */ ! 11: ! 12: #define EATDOL 0 /* Eat '$' in identifiers? */ ! 13: #define APPENDBAR 0 /* Append '_' to identifiers? */ ! 14: #define IEEE 1 /* IEEE format? */ ! 15: #define DECVAX 0 /* DECVAX format? */ ! 16: #define NATIVEFP 0 /* Host fp == target fp? */ ! 17: #define FOLD_DOUBLES 1 /* Fold doubles? Assumes host fp == target fp! */ ! 18: #define MCFFP 0 /* Motorola fast floating point? */ ! 19: #define TINY 1 /* No code gen debug info? */ ! 20: #ifndef YATC ! 21: #define YATC 0 /* Not code table compile */ ! 22: #endif ! 23: #define SIZEOF_LARGE 0 /* sizeof_t == ival_t */ ! 24: #define SPLIT_CC1 0 /* CC1A-CC1B? */ ! 25: #define AS_FORMAT 1 /* Coherent/Rainbow .s format? */ ! 26: #define INTEL 0 /* Intel copyright? */ ! 27: #define OMF286 0 /* 286 object format? */ ! 28: #define TEMPBUF 1 /* Memory tempfile buffers? */ ! 29: ! 30: #define EMUFIXUPS 0 /* M: 8087 emulation fixups? */ ! 31: ! 32: /* ! 33: * Types. ! 34: * Cf. common/i386/tyname.c. ! 35: */ ! 36: #define S8 0 /* Signed byte */ ! 37: #define U8 1 /* Unsigned byte */ ! 38: #define S16 2 /* Signed word */ ! 39: #define U16 3 /* Unsigned word */ ! 40: #define S32 4 /* Signed long */ ! 41: #define U32 5 /* Unsigned long */ ! 42: #define F32 6 /* Short floating point */ ! 43: #define F64 7 /* Long floating point */ ! 44: #define BLK 8 /* Block of bytes */ ! 45: #define FLD8 9 /* Field, byte wide */ ! 46: #define FLD16 10 /* Field, word wide */ ! 47: #define FLD32 11 /* Field, dword wide */ ! 48: #define PTR 12 /* Pointer */ ! 49: #define PTB 13 /* Pointer to BLK */ ! 50: ! 51: #define TRUTH S32 /* Type used for truth values */ ! 52: #define OFFS PTR /* Offset LEAF type */ ! 53: #define IVAL_T S32 /* Type for ival_t con */ ! 54: #define LVAL_T S32 /* Type for lval_t con */ ! 55: #define DVAL_T F64 /* Type for dval_t con */ ! 56: #define I_FMT "%ld" /* printf format for ival_t con */ ! 57: #define I_FMTX "%lx" /* printf format for ival_t con */ ! 58: #define NBPBYTE 8 /* # of bits in a "byte" */ ! 59: ! 60: /* ! 61: * Flag bit type for each machine type. ! 62: */ ! 63: #define FS8 0x0001 ! 64: #define FU8 0x0002 ! 65: #define FS16 0x0004 ! 66: #define FU16 0x0008 ! 67: #define FS32 0x0010 ! 68: #define FU32 0x0020 ! 69: #define FF32 0x0040 ! 70: #define FF64 0x0080 ! 71: #define FBLK 0x0100 ! 72: #define FFLD8 0x0200 ! 73: #define FFLD16 0x0400 ! 74: #define FFLD32 0x0800 ! 75: #define FPTR 0x1000 ! 76: #define FPTB 0x2000 ! 77: ! 78: /* ! 79: * Allocation types. ! 80: */ ! 81: #ifdef vax ! 82: typedef int ival_t; /* 32 bit ints */ ! 83: typedef unsigned int uival_t; /* 32 bit uints */ ! 84: typedef int lval_t; /* 32 bit longs */ ! 85: typedef unsigned int ulval_t; /* 32 bit ulongs */ ! 86: typedef int sizeof_t; /* 32 bit sizeof constants */ ! 87: #else ! 88: typedef long ival_t; /* 32 bit ints */ ! 89: typedef unsigned long uival_t; /* 32 bit uints */ ! 90: typedef long lval_t; /* 32 bit longs */ ! 91: typedef unsigned long ulval_t; /* 32 bit ulongs */ ! 92: typedef long sizeof_t; /* 32 bit sizeof constants */ ! 93: #endif ! 94: typedef char dval_t[8]; /* doubles */ ! 95: ! 96: /* ! 97: * Types used in several phases. ! 98: */ ! 99: typedef int PREGSET; ! 100: typedef unsigned long ADDRESS; ! 101: typedef long SIGNEDADDRESS; ! 102: ! 103: /* ! 104: * Limits. ! 105: */ ! 106: #define MAXIV 0x7FFFFFFFL /* Max integer */ ! 107: #define MAXUV 0xFFFFFFFFL /* Max unsigned integer */ ! 108: #define MAXUCE 255 /* Max unsigned char enumeration */ ! 109: #define UIMASK 0x00000000L /* Unsigned int check mask */ ! 110: #define SIMASK 0x80000000L /* Signed int check mask */ ! 111: #define SLMASK 0x80000000L /* Signed long check mask */ ! 112: #define ASMASK 0xFFFFFFFFL /* Address space mask */ ! 113: #define MAXMEMB MAXIV /* Max struct/union member offset */ ! 114: #define MAXESIZE MAXUV /* Max struct/union/array size */ ! 115: ! 116: /* ! 117: * Registers. ! 118: * This list includes the machine's actual registers, ! 119: * registers that are given names for the benefit of the code output routines, ! 120: * and the pseudo registers used by the code generator. ! 121: * Cf. common/i386/regnam.c, n1/i386/gen1.c, n1/i386/table1.c. ! 122: */ ! 123: /* 32-bit general registers. */ ! 124: #define EAX 0 ! 125: #define EDX 1 ! 126: #define EBX 2 ! 127: #define ECX 3 ! 128: #define ESI 4 ! 129: #define EDI 5 ! 130: #define ESP 6 ! 131: #define EBP 7 ! 132: ! 133: /* Quad-word register for multiplication, division, floating point. */ ! 134: #define EDXEAX 8 ! 135: ! 136: /* 16-bit i8086 registers. */ ! 137: #define AX 9 ! 138: #define DX 10 ! 139: #define BX 11 ! 140: #define CX 12 ! 141: #define SI 13 ! 142: #define DI 14 ! 143: #define SP 15 ! 144: #define BP 16 ! 145: ! 146: /* Eight-bit parts of i8086 registers. */ ! 147: #define AL 17 ! 148: #define BL 18 ! 149: #define CL 19 ! 150: #define DL 20 ! 151: #define AH 21 ! 152: #define BH 22 ! 153: #define CH 23 ! 154: #define DH 24 ! 155: ! 156: /* Floating point register (NDP stacktop %st0), used by NDP version only. */ ! 157: #define FPAC 25 ! 158: ! 159: /* Pseudoregisters. */ ! 160: #define NONE 26 ! 161: #define ANYR 27 ! 162: #define ANYL 28 ! 163: #define PAIR 29 ! 164: #define TEMP 30 ! 165: #define LOTEMP 31 ! 166: #define HITEMP 32 ! 167: ! 168: #define FRREG EAX /* First real reg */ ! 169: #define NFBREG 7 /* Number of last flag bit reg */ ! 170: #define NRREG 26 /* Number of real regs, incl. FPAC */ ! 171: #define NREG 31 /* Number of last reg */ ! 172: ! 173: /* Flag bits, same order as register numbers above. */ ! 174: #define BEAX 0x0001 ! 175: #define BEDX 0x0002 ! 176: #define BEBX 0x0004 ! 177: #define BECX 0x0008 ! 178: #define BESI 0x0010 ! 179: #define BEDI 0x0020 ! 180: #define BESP 0x0040 ! 181: #define BEBP 0x0080 ! 182: #define BFPAC 0x0100 ! 183: ! 184: /* ! 185: * Machine registers. ! 186: * The processor uses these codes in the REGM field of an instruction. ! 187: * This makes it easier to get the register code from an AFIELD ! 188: * and to find the indexing mode associated with a register. ! 189: * Unless Intel changes the chip, do not change the values here. ! 190: */ ! 191: #define MEAX 0 ! 192: #define MECX 1 ! 193: #define MEDX 2 ! 194: #define MEBX 3 ! 195: #define MESP 4 ! 196: #define MEBP 5 ! 197: #define MESI 6 ! 198: #define MEDI 7 ! 199: ! 200: #define NMREG 8 ! 201: ! 202: /* ! 203: * Definitions for the "a_mode" field of an AFIELD object (cc1, cc2). ! 204: * Some bits are used only by the peephole optimizer in the "regstate" table. ! 205: * The indexing mode bits are packed efficiently but not very intuitively. ! 206: */ ! 207: #define A_NONE 0 /* General "none" value */ ! 208: #define A_REGM 0x0007 /* Register code, etc. */ ! 209: #define A_IREG 0x0038 /* Scaled index register code */ ! 210: #define A_ISS 0x00C0 /* Scale factor, [0123] for [1248] */ ! 211: #define A_AMOD 0x0F00 /* Address mode */ ! 212: #define A_X 0x0800 /* Flag for indexed address modes */ ! 213: #define A_FLAGS 0xF000 /* Flag bit mask */ ! 214: #define A_EA 0x1000 /* Flag for peephole; effective address */ ! 215: #define A_OFFS 0x2000 /* Flag for getfield; offset present */ ! 216: #define A_LID 0x4000 /* Flag for getfield; local id present */ ! 217: #define A_GID 0x8000 /* Flag for getfield; global id present */ ! 218: ! 219: #define NOBASE -1 /* No SIB base present */ ! 220: #define SIB(m) ((m) & 0xFF) /* Extract SIB */ ! 221: #define IREG(m) (((m) & A_IREG) >> 3) /* Extract index reg */ ! 222: #define SCALE(m) (((m) & A_ISS) >> 6) /* Extract scale factor */ ! 223: ! 224: /* A_AMOD values. */ ! 225: #define A_BR (1<<8) /* Byte register */ ! 226: #define A_WR (2<<8) /* Word register */ ! 227: #define A_DR (3<<8) /* Dword register */ ! 228: #define A_IMM (4<<8) /* Immediate */ ! 229: #define A_DIR (5<<8) /* Direct */ ! 230: #define A_XB (A_X|(6<<8)) /* Indexed using base register only */ ! 231: #define A_XSIB (A_X|(7<<8)) /* Indexed using SIB */ ! 232: ! 233: #define A_REAX (A_DR|MEAX) /* eax */ ! 234: #define A_RECX (A_DR|MECX) /* ecx */ ! 235: #define A_REDX (A_DR|MEDX) /* edx */ ! 236: #define A_REBX (A_DR|MEBX) /* ebx */ ! 237: #define A_RESP (A_DR|MESP) /* esp */ ! 238: #define A_REBP (A_DR|MEBP) /* ebp */ ! 239: #define A_RESI (A_DR|MESI) /* esi */ ! 240: #define A_REDI (A_DR|MEDI) /* edi */ ! 241: ! 242: #define A_RAX (A_WR|MEAX) /* ax */ ! 243: #define A_RCX (A_WR|MECX) /* cx */ ! 244: #define A_RDX (A_WR|MEDX) /* dx */ ! 245: #define A_RBX (A_WR|MEBX) /* bx */ ! 246: #define A_RSP (A_WR|MESP) /* sp */ ! 247: #define A_RBP (A_WR|MEBP) /* bp */ ! 248: #define A_RSI (A_WR|MESI) /* si */ ! 249: #define A_RDI (A_WR|MEDI) /* di */ ! 250: ! 251: #define A_RAL (A_BR|MEAX) /* al */ ! 252: #define A_RCL (A_BR|MECX) /* cl */ ! 253: #define A_RDL (A_BR|MEDX) /* dl */ ! 254: #define A_RBL (A_BR|MEBX) /* bl */ ! 255: #define A_RAH (A_BR|MEAX|4) /* ah */ ! 256: #define A_RCH (A_BR|MECX|4) /* ch */ ! 257: #define A_RDH (A_BR|MEDX|4) /* dh */ ! 258: #define A_RBH (A_BR|MEBX|4) /* bh */ ! 259: ! 260: #define A_XEAX (A_XB|MEAX) /* [eax] */ ! 261: #define A_XECX (A_XB|MECX) /* [ecx] */ ! 262: #define A_XEDX (A_XB|MEDX) /* [edx] */ ! 263: #define A_XEBX (A_XB|MEBX) /* [ebx] */ ! 264: #define A_XEBP (A_XB|MEBP) /* [ebp] */ ! 265: #define A_XESI (A_XB|MESI) /* [esi] */ ! 266: #define A_XEDI (A_XB|MEDI) /* [edi] */ ! 267: ! 268: /* end of h/i386/mch.h */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.