⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tm-tahoe.h

📁 这是完整的gcc源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/* Definitions of target machine for GNU compiler.  Tahoe version.   Copyright (C) 1989 Free Software Foundation, Inc.This file is part of GNU CC.GNU CC is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 1, or (at your option)any later version.GNU CC is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU CC; see the file COPYING.  If not, write tothe Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  *//* * File: tm-tahoe.h * * This port made at the University of Buffalo by Devon Bowen, * Dale Wiles and Kevin Zachmann. * * Mail bugs reports or fixes to:	gcc@cs.buffalo.edu *//* * Run-time Target Specification *//* we want "tahoe" and "unix" auto-defined for all future compilations */#define CPP_PREDEFINES "-Dtahoe -Dunix"/* have cc1 print that this is the tahoe version */#define TARGET_VERSION printf (" (tahoe)");/* this is required in all tm files to hold flags */extern int target_flags;/* Zero if it is safe to output .dfloat and .float pseudos.  */#define TARGET_HEX_FLOAT (target_flags & 1)#define TARGET_DEFAULT 1#define TARGET_SWITCHES		\  { {"hex-float", 1},		\    {"no-hex-float", -1},	\    { "", TARGET_DEFAULT} }/* * Storage Layout *//* tahoe uses a big endian byte order */#define BYTES_BIG_ENDIAN/* tahoe uses a big endian word order */#define WORDS_BIG_ENDIAN/* standard byte size is usable on tahoe */#define BITS_PER_UNIT 8/* longs on the tahoe are 4 byte groups */#define BITS_PER_WORD 32/* from the last two params we get 4 bytes per word */#define UNITS_PER_WORD 4/* addresses are 32 bits (one word) */#define POINTER_SIZE 32/* pointers should align every 32 bits */#define POINTER_BOUNDARY 32/* all parameters line up on 32 boundaries */#define PARM_BOUNDARY 32/* stack should line up on 32 boundaries */#define STACK_BOUNDARY 32/* line functions up on 32 bits */#define FUNCTION_BOUNDARY 32/* the biggest alignment the tahoe needs in 32 bits */#define BIGGEST_ALIGNMENT 32/* we have to align after an 'int : 0' in a structure */#define EMPTY_FIELD_BOUNDARY 32/* structures must be made of full bytes */#define STRUCTURE_SIZE_BOUNDARY 8/* tahoe is picky about data alignment */#define STRICT_ALIGNMENT/* keep things standard with pcc */#define PCC_BITFIELD_TYPE_MATTERS 1/* this section is borrowed from the vax version since the *//* formats are the same in both of the architectures	   */#define CHECK_FLOAT_VALUE(mode, d) \  if ((mode) == SFmode) \    { \      if ((d) > 1.7014117331926443e+38) \	{ error ("magnitude of constant too large for `float'"); \	  (d) = 1.7014117331926443e+38; } \      else if ((d) < -1.7014117331926443e+38) \	{ error ("magnitude of constant too large for `float'"); \	  (d) = -1.7014117331926443e+38; } \      else if (((d) > 0) && ((d) < 2.9387358770557188e-39)) \	{ warning ("`float' constant truncated to zero"); \	  (d) = 0.0; } \      else if (((d) < 0) && ((d) > -2.9387358770557188e-39)) \	{ warning ("`float' constant truncated to zero"); \	  (d) = 0.0; } \    }/* * Register Usage *//* define 15 general regs plus one for the floating point reg (FPP) */#define FIRST_PSEUDO_REGISTER 17/* let the compiler know what the fp, sp and pc are */#define FIXED_REGISTERS {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0}/* lots of regs aren't guarenteed to return from a call. The FPP reg *//* must be included in these since it can't be saved by the reg mask */#define CALL_USED_REGISTERS {1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1}/* The FPP can handle any type, but the others may require as many as *//* two regs depending on the mode needed 			      */#define HARD_REGNO_NREGS(REGNO, MODE) \ (REGNO != 16 ? ((GET_MODE_SIZE(MODE)+UNITS_PER_WORD-1) / UNITS_PER_WORD) : 1)/* any mode greater than 4 bytes (doubles) can only go in an even regs *//* and the FPP can only hold SFmode and DFmode 			       */#define HARD_REGNO_MODE_OK(REGNO, MODE) \ (REGNO != 16 ? (GET_MODE_SIZE (MODE) <= 4 ? 1 : (REGNO % 2 - 1)) : \	(MODE == SFmode || MODE == DFmode))/* if mode1 or mode2, but not both, are doubles then modes cannot be tied */#define MODES_TIEABLE_P(MODE1, MODE2) \ ((MODE1 == DFmode) == (MODE2 == DFmode))/* the program counter is reg 15 */#define PC_REGNUM 15/* the stack pointer is reg 14 */#define STACK_POINTER_REGNUM 14/* the frame pointer is reg 13 */#define FRAME_POINTER_REGNUM 13/* tahoe does require an fp */#define FRAME_POINTER_REQUIRED 1/* since tahoe doesn't have a argument pointer, make it the fp */#define ARG_POINTER_REGNUM 13/* this isn't currently used since C doesn't support this feature */#define STATIC_CHAIN_REGNUM 0/* we'll use reg 1 for structure passing cause the destination *//* of the eventual movblk requires it to be there anyway.      */#define STRUCT_VALUE_REGNUM 1/* * Register Classes *//* tahoe has two types of regs. GENERALY_REGS are all the regs up *//* to number 15. FPP_REG is the special floating point processor  *//* register class (only one reg).				  */enum reg_class {NO_REGS,GENERAL_REGS,FPP_REG,ALL_REGS,LIM_REG_CLASSES};/* defines the number of reg classes.				    */#define N_REG_CLASSES (int) LIM_REG_CLASSES/* this defines what the classes are officially named for debugging */#define REG_CLASS_NAMES \ {"NO_REGS","GENERAL_REGS","FPP_REG","ALL_REGS"}/* set general regs to be the first 16 regs and the fpp reg to be 17th */#define REG_CLASS_CONTENTS {0,0xffff,0x10000,0x1ffff}/* register class for the fpp reg is FPP_REG, all others are GENERAL_REGS */#define REGNO_REG_CLASS(REGNO) (REGNO == 16 ? FPP_REG : GENERAL_REGS)/* only gereral registers can be used as a base reg */#define BASE_REG_CLASS GENERAL_REGS/* only gereral registers can be used to index */#define INDEX_REG_CLASS GENERAL_REGS/* 'a' as a contraint in the md file means the FFP_REG class */#define REG_CLASS_FROM_LETTER(C) (C == 'a' ? FPP_REG : NO_REGS)/* any general reg but the fpp can be a base reg */#define REGNO_OK_FOR_BASE_P(regno) \((regno) < FIRST_PSEUDO_REGISTER - 1 || reg_renumber[regno] >= 0)/* any general reg except the pc and fpp can be an index reg */#define REGNO_OK_FOR_INDEX_P(regno)  \((regno) < FIRST_PSEUDO_REGISTER - 2 || reg_renumber[regno] >= 0)/* if your loading a floating point constant, it can't be done *//* through a register. Force it to be a memory constant.       */#define PREFERRED_RELOAD_CLASS(X,CLASS) \	((GET_CODE (X) == CONST_DOUBLE) ? NO_REGS : CLASS)/* for the fpp reg, all modes fit; for any others, you need two for doubles */#define CLASS_MAX_NREGS(CLASS, MODE)	\ (CLASS != FPP_REG ? ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) : 1)/* we don't define any special constant sizes so all should fail */#define CONST_OK_FOR_LETTER_P(VALUE, C)  0/* we don't define any special double sizes so all should fail */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 0/* * Describing Stack Layout *//* tahoe stack grows from high to low memory */#define STACK_GROWS_DOWNWARD/* Define this if longjmp restores from saved registers   rather than from what setjmp saved.  */#define LONGJMP_RESTORE_FROM_STACK/* tahoe call frames grow from high to low memory on the stack */#define FRAME_GROWS_DOWNWARD/* the tahoe fp points to the *top* of the frame instead of the   *//* bottom, so we have to make this offset a constant large enough *//* to jump over the biggest frame possible.			  */#define STARTING_FRAME_OFFSET -52/* tahoe always pushes 4 bytes unless it's a double in which case *//* it pushes a full 8 bytes.					  */#define PUSH_ROUNDING(BYTES) (BYTES <= 4 ? 4 : 8)/* the first parameter in a function is at the fp + 4 */#define FIRST_PARM_OFFSET(FNDECL) 4/* the tahoe return function takes care of everything on the stack */#define RETURN_POPS_ARGS(FUNTYPE) 1/* function values for all types are returned in register 0 */#define FUNCTION_VALUE(VALTYPE, FUNC)  \  gen_rtx (REG, TYPE_MODE (VALTYPE), 0)/* libarary routines also return things in reg 0 */#define LIBCALL_VALUE(MODE)  gen_rtx (REG, MODE, 0)/* Tahoe doesn't return structures in a reentrant way */#define PCC_STATIC_STRUCT_RETURN/* we only return values from a function in reg 0 */#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)/* we never pass args through a register */#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) 0/* int is fine to hold the argument summary in FUNCTION_ARG */#define CUMULATIVE_ARGS int/* we just set CUM to 0 before the FUNCTION_ARG call. No matter what *//* we make it, FUNCTION_ARG will return 0 anyway		     */#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE)	\ ((CUM) = 0)/* all modes push their size rounded to the nearest word boundary *//* except block which is the size of the block rounded up	  */#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED)	\ ((CUM) += ((MODE) != BLKmode			\	    ? (GET_MODE_SIZE (MODE) + 3) & ~3	\	    : (int_size_in_bytes (TYPE) + 3) & ~3))/* this is always false since we never pass params in regs */#define FUNCTION_ARG_REGNO_P(N) 0/* this code calculates the register entry mask and sets up    *//* the stack pointer for the function. The stack is set down   *//* far enough from the fp to jump over any push regs and local *//* vars. This is a problem since the tahoe has the fp pointing *//* to the top of the frame and the compiler must know the off- *//* set off the fp to the local vars.			       */#define FUNCTION_PROLOGUE(FILE, SIZE)     \{ register int regno;						\  register int mask = 0;					\  extern char call_used_regs[];					\  for (regno = 0; regno < FIRST_PSEUDO_REGISTER-1; regno++)	\    if (regs_ever_live[regno] && !call_used_regs[regno])	\       mask |= 1 << regno;					\  fprintf (FILE, "\t.word 0x%x\n", mask);			\  if (SIZE != 0) fprintf (FILE, "\tsubl3 $%d,fp,sp\n", (SIZE) - STARTING_FRAME_OFFSET); }/* to call the profiler, push the variable value onto the stack *//* and call mcount like a regular function.			*/#define FUNCTION_PROFILER(FILE, LABELNO)  \   fprintf (FILE, "\tpushl $LP%d\n\tcallf $8,mcount\n", (LABELNO));/* all stack handling at the end of a function is handled by the *//* return command.						 */#define EXIT_IGNORE_STACK 1/* this never gets executed since the system knows it always gets  *//* an fp to work with. It just prints a friendly message since the *//* person must be playing with the tm file defs 		   */#define FIX_FRAME_POINTER_ADDRESS(ADDR,DEPTH) \ { abort(); }/* * Library Subroutine Names *//* udiv is a valid C library routine in libc.a, so we call that */#define UDIVSI3_LIBCALL "*udiv"/* urem is a valid C library routine in libc.a, so we call that */#define UMODSI3_LIBCALL "*urem"/* * Addressing Modes *//* constant addresses can be treated exactly the same as normal constants */#define CONSTANT_ADDRESS_P(X) CONSTANT_P (X)/* we can have as many as two regs in any given address */#define MAX_REGS_PER_ADDRESS 2/* The following is all the code for GO_IF_LEGITIMATE_ADDRESS *//* most of this taken directly from the vax tm file since the *//* tahoe and vax addressing modes are nearly identicle.	      *//* Is x an indirectable address? */#define INDIRECTABLE_ADDRESS_P(X)  \  (CONSTANT_ADDRESS_P (X)						\   || (GET_CODE (X) == REG && REG_OK_FOR_BASE_P (X))			\   || (GET_CODE (X) == PLUS						\       && GET_CODE (XEXP (X, 0)) == REG					\       && REG_OK_FOR_BASE_P (XEXP (X, 0))				\

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -