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

📄 h8300.h

📁 GUN开源阻止下的编译器GCC
💻 H
📖 第 1 页 / 共 3 页
字号:
/* Definitions of target machine for GNU compiler.    Hitachi H8/300 version generating coff    Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.   Contributed by Steve Chamberlain (sac@cygnus.com),   Jim Wilson (wilson@cygnus.com), and Doug Evans (dje@cygnus.com).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 2, 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, 59 Temple Place - Suite 330,Boston, MA 02111-1307, USA.  *//* Which cpu to compile for.   We use int for CPU_TYPE to avoid lots of casts.  */#if 0 /* defined in insn-attr.h, here for documentation */enum attr_cpu { CPU_H8300, CPU_H8300H };#endifextern int cpu_type;/* Various globals defined in h8300.c.  */extern char *h8_push_op,*h8_pop_op,*h8_mov_op;extern char **h8_reg_names;/* Names to predefine in the preprocessor for this target machine.  */#define CPP_PREDEFINES \"-D__LONG_MAX__=2147483647L -D__LONG_LONG_MAX__=2147483647L -D_DOUBLE_IS_32BITS"#define CPP_SPEC \  "%{!mh:-D__H8300__} %{mh:-D__H8300H__} \   %{!mh:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \   %{mh:-D__SIZE_TYPE__=unsigned\\ long -D__PTRDIFF_TYPE__=long} \   %{!mh:-Acpu(h8300) -Amachine(h8300)} %{mh:-Acpu(h8300h) -Amachine(h8300h)} \   %{!mint32:-D__INT_MAX__=32767} %{mint32:-D__INT_MAX__=2147483647}"#define LINK_SPEC "%{mh:-m h8300h}"#define LIB_SPEC "%{mrelax:-relax} %{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"/* Print subsidiary information on the compiler version in use.  */#define TARGET_VERSION fprintf (stderr, " (Hitachi H8/300)");/* Run-time compilation parameters selecting different hardware subsets.  */extern int target_flags;/* Macros used in the machine description to test the flags.  *//* Make int's 32 bits.  */#define TARGET_INT32 (target_flags & 8)/* Dump recorded insn lengths into the output file.  This helps debug the   md file.  */#define TARGET_ADDRESSES (target_flags & 64)/* Pass the first few arguments in registers.  */#define TARGET_QUICKCALL (target_flags & 128)/* Pretend byte accesses are slow.  */#define TARGET_SLOWBYTE (target_flags & 256)/* Dump each assembler insn's rtl into the output file.   This is for debugging the compiler only.  */#define TARGET_RTL_DUMP	(target_flags & 2048)/* Select between the h8/300 and h8/300h cpus.  */#define TARGET_H8300	(! TARGET_H8300H)#define TARGET_H8300H	(target_flags & 4096)/* Macro to define tables used to set the flags.   This is a list in braces of pairs in braces,   each pair being { "NAME", VALUE }   where VALUE is the bits to set or minus the bits to clear.   An empty string NAME is used to identify the default VALUE.  */#define TARGET_SWITCHES  \  { {"int32",8},		\    {"addresses",64 },		\    {"quickcall",128},  	\    {"no-quickcall",-128},	\    {"slowbyte",256},		\    {"relax",1024},		\    {"rtl-dump",2048},		\    {"h",4096},			\    {"no-h",-4096},		\    {"exp",8192},		\    { "", TARGET_DEFAULT}}/* Merge the meaning of -mdouble64 and -fshort-double.   ??? Unfortunately, there's no way to detect -fno-short-double   (our default is the opposite of theirs).   Also do other things that must be done once at start up.  */#define OVERRIDE_OPTIONS \{				\  /*extern int flag_short_double; \  flag_short_double = TARGET_DOUBLE32;*/ \  h8300_init_once ();		\}/* Default target_flags if no switches specified.  */#ifndef TARGET_DEFAULT#define TARGET_DEFAULT (128)	/* quickcall */#endif/* Show we can debug even without a frame pointer.  *//* #define CAN_DEBUG_WITHOUT_FP *//* Define this if addresses of constant functions   shouldn't be put through pseudo regs where they can be cse'd.   Desirable on machines where ordinary constants are expensive   but a CALL with constant address is cheap.  */#define NO_FUNCTION_CSE/* Target machine storage layout *//* Define to use software floating point emulator for REAL_ARITHMETIC and   decimal <-> binary conversion. */#define REAL_ARITHMETIC/* Define this if most significant bit is lowest numbered   in instructions that operate on numbered bit-fields.   This is not true on the H8/300.  */#define BITS_BIG_ENDIAN 0/* Define this if most significant byte of a word is the lowest numbered.  *//* That is true on the H8/300.  */#define BYTES_BIG_ENDIAN 1/* Define this if most significant word of a multiword number is lowest   numbered.     This is true on an H8/300 (actually we can make it up, but we choose to   be consistent.  */ #define WORDS_BIG_ENDIAN 1/* Number of bits in an addressable storage unit */#define BITS_PER_UNIT 8/* Width in bits of a "word", which is the contents of a machine register.   Note that this is not necessarily the width of data type `int';   if using 16-bit ints on a 68000, this would still be 32.   But on a machine with 16-bit registers, this would be 16.  */#define BITS_PER_WORD		(TARGET_H8300H ? 32 : 16)#define MAX_BITS_PER_WORD	32/* Width of a word, in units (bytes).  */#define UNITS_PER_WORD		(TARGET_H8300H ? 4 : 2)#define MIN_UNITS_PER_WORD	2/* Width in bits of a pointer.   See also the macro `Pmode' defined below.  */#define POINTER_SIZE (TARGET_H8300H ? 32 : 16)#define SHORT_TYPE_SIZE 	16#define INT_TYPE_SIZE 		(TARGET_INT32 ? 32 : 16)#define LONG_TYPE_SIZE 		32#define LONG_LONG_TYPE_SIZE 	32#define FLOAT_TYPE_SIZE 	32#define DOUBLE_TYPE_SIZE 	32#define LONG_DOUBLE_TYPE_SIZE 	DOUBLE_TYPE_SIZE#define MAX_FIXED_MODE_SIZE 	32/* Allocation boundary (in *bits*) for storing arguments in argument list.  */#define PARM_BOUNDARY (TARGET_H8300H ? 32 : 16)/* Allocation boundary (in *bits*) for the code of a function.  */#define FUNCTION_BOUNDARY 16/* Alignment of field after `int : 0' in a structure.  */#define EMPTY_FIELD_BOUNDARY 16/* A bitfield declared as `int' forces `int' alignment for the struct.  */#define PCC_BITFIELD_TYPE_MATTERS  0/* No data type wants to be aligned rounder than this.  */#define BIGGEST_ALIGNMENT (TARGET_H8300H ? 32 : 16)/* No structure field wants to be aligned rounder than this.  */#define BIGGEST_FIELD_ALIGNMENT (TARGET_H8300H ? 32 : 16)/* The stack goes in 16/32 bit lumps.  */#define STACK_BOUNDARY (TARGET_H8300 ? 16 : 32)/* Define this if move instructions will actually fail to work   when given unaligned data.  *//* On the H8/300, longs can be aligned on halfword boundaries, but not   byte boundaries.  */#define STRICT_ALIGNMENT 1/* Standard register usage.  *//* Number of actual hardware registers.   The hardware registers are assigned numbers for the compiler   from 0 to just below FIRST_PSEUDO_REGISTER.   All registers that the compiler knows about must be given numbers,   even those that are not normally considered general registers.     Reg 8 does not correspond to any hardware register, but instead   appears in the RTL as an argument pointer prior to reload, and is   eliminated during reloading in favor of either the stack or frame   pointer.  */#define FIRST_PSEUDO_REGISTER 9/* 1 for registers that have pervasive standard uses   and are not available for the register allocator.  */#define FIXED_REGISTERS \  { 0, 0, 0, 0, 0, 0, 0, 1, 1}/* 1 for registers not available across function calls.   These must include the FIXED_REGISTERS and also any   registers that can be used without being saved.   The latter must include the registers where values are returned   and the register where structure-value addresses are passed.   Aside from that, you can include as many other registers as you   like.     h8 destroys r0,r1,r2,r3.  */#define CALL_USED_REGISTERS \  { 1, 1, 1, 1, 0, 0, 0, 1, 1 }#define REG_ALLOC_ORDER \  { 2, 3, 0, 1, 4, 5, 6, 7, 8}/* Return number of consecutive hard regs needed starting at reg REGNO   to hold something of mode MODE.   This is ordinarily the length in words of a value of mode MODE   but can be less for certain modes in special long registers.  */#define HARD_REGNO_NREGS(REGNO, MODE)   \  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* Value is 1 if hard register REGNO can hold a value of machine-mode   MODE.   H8/300: If an even reg, then anything goes. Otherwise the mode must be QI           or HI.   H8/300H: Anything goes.  */#define HARD_REGNO_MODE_OK(REGNO, MODE) \ (TARGET_H8300 ? (((REGNO)&1)==0) || (MODE==HImode) || (MODE==QImode) \  : 1)/* Value is 1 if it is a good idea to tie two pseudo registers   when one has mode MODE1 and one has mode MODE2.   If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,   for any hard reg, then this must be 0 for correct output.  */#define MODES_TIEABLE_P(MODE1, MODE2)  ((MODE1) == (MODE2))/* Specify the registers used for certain standard purposes.   The values of these macros are register numbers.  *//* H8/300 pc is not overloaded on a register.  *//*#define PC_REGNUM 15*//* Register to use for pushing function arguments.  */#define STACK_POINTER_REGNUM 7/* Base register for access to local variables of the function.  */#define FRAME_POINTER_REGNUM 6/* Value should be nonzero if functions must have frame pointers.   Zero means the frame pointer need not be set up (and parms   may be accessed via the stack pointer) in functions that seem suitable.   This is computed in `reload', in reload1.c.  */#define FRAME_POINTER_REQUIRED 0/* Base register for access to arguments of the function.  */#define ARG_POINTER_REGNUM 8/* Register in which static-chain is passed to a function.  */#define STATIC_CHAIN_REGNUM 3/* Define the classes of registers for register constraints in the   machine description.  Also define ranges of constants.   One of the classes must always be named ALL_REGS and include all hard regs.   If there is more than one class, another class must be named NO_REGS   and contain no registers.   The name GENERAL_REGS must be the name of a class (or an alias for   another name such as ALL_REGS).  This is the class of registers   that is allowed by "g" or "r" in a register constraint.   Also, registers outside this class are allocated only when   instructions express preferences for them.   The classes must be numbered in nondecreasing order; that is,   a larger-numbered class must never be contained completely   in a smaller-numbered class.   For any two classes, it is very desirable that there be another   class that represents their union.  */   /* The h8 has only one kind of register, but we mustn't do byte by   byte operations on the sp, so we keep it as a different class */enum reg_class { NO_REGS,  LONG_REGS, GENERAL_REGS, SP_REG, SP_AND_G_REG, ALL_REGS, LIM_REG_CLASSES };#define N_REG_CLASSES (int) LIM_REG_CLASSES/* Give names of register classes as strings for dump file.   */#define REG_CLASS_NAMES \ {"NO_REGS",  "LONG_REGS",  "GENERAL_REGS", "SP_REG", "SP_AND_G_REG", "ALL_REGS", "LIM_REGS" }/* Define which registers fit in which classes.   This is an initializer for a vector of HARD_REG_SET   of length N_REG_CLASSES.  */#define REG_CLASS_CONTENTS  			\{      0,		/* No regs      */	\   0x07f,               /* LONG_REGS    */      \   0x07f,		/* GENERAL_REGS */	\   0x080,		/* SP_REG       */     	\   0x0ff,		/* SP_AND_G_REG */     	\   0x1ff,		/* ALL_REGS 	*/	\}/* The same information, inverted:   Return the class number of the smallest class containing   reg number REGNO.  This could be a conditional expression   or could index an array.  */#define REGNO_REG_CLASS(REGNO)  \   ((REGNO) < 7  ? LONG_REGS  : \    (REGNO) == 7 ? SP_REG     : \    GENERAL_REGS)/* The class value for index registers, and the one for base regs.  */#define INDEX_REG_CLASS NO_REGS#define BASE_REG_CLASS  GENERAL_REGS/* Get reg_class from a letter such as appears in the machine description.  */#define REG_CLASS_FROM_LETTER(C) \  ((C) == 'a' ? (SP_REG) : (C) == 'l' ? (LONG_REGS) : (NO_REGS))/* The letters I, J, K, L, M, N, O, P in a register constraint string   can be used to stand for particular ranges of immediate operands.   This macro defines what the ranges are.   C is the letter, and VALUE is a constant value.   Return 1 if VALUE is in the range specified by C.  */#define CONST_OK_FOR_I(VALUE) ((VALUE) == 0)#define CONST_OK_FOR_J(VALUE) ((unsigned) (VALUE) < 256)#define CONST_OK_FOR_K(VALUE) (((VALUE) == 1) || (VALUE) == 2)#define CONST_OK_FOR_L(VALUE) (((VALUE) == -1) || (VALUE) == -2)#define CONST_OK_FOR_M(VALUE) (((VALUE) == 3) || (VALUE) == 4)#define CONST_OK_FOR_N(VALUE) (((VALUE) == -3) || (VALUE) == -4)#define CONST_OK_FOR_O(VALUE) (ok_for_bclr (VALUE))#define CONST_OK_FOR_P(VALUE) (small_power_of_two (VALUE))#define CONST_OK_FOR_LETTER_P(VALUE, C) \  ((C) == 'I' ? CONST_OK_FOR_I (VALUE) : \   (C) == 'J' ? CONST_OK_FOR_J (VALUE) : \   (C) == 'K' ? CONST_OK_FOR_K (VALUE) : \   (C) == 'L' ? CONST_OK_FOR_L (VALUE) : \   (C) == 'M' ? CONST_OK_FOR_M (VALUE) : \   (C) == 'N' ? CONST_OK_FOR_N (VALUE) : \   (C) == 'O' ? CONST_OK_FOR_O (VALUE) : \   (C) == 'P' ? CONST_OK_FOR_P(VALUE) : \   0)/* Similar, but for floating constants, and defining letters G and H.   Here VALUE is the CONST_DOUBLE rtx itself.        `G' is a floating-point zero.  */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \  ((C) == 'G' ? (VALUE) == CONST0_RTX (DFmode)	\   : 0)/* Given an rtx X being reloaded into a reg required to be   in class CLASS, return the class of reg to actually use.   In general this is just CLASS; but on some machines   in some cases it is preferable to use a more restrictive class.  */#define PREFERRED_RELOAD_CLASS(X,CLASS)  (CLASS)/* Return the maximum number of consecutive registers   needed to represent mode MODE in a register of class CLASS.  *//* On the H8, this is the size of MODE in words.  */#define CLASS_MAX_NREGS(CLASS, MODE)	\  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* Any SI register to register move may need to be reloaded,    so define REGISTER_MOVE_COST to be > 2 so that reload never   shortcuts.  */#define REGISTER_MOVE_COST(CLASS1, CLASS2) 3/* Stack layout; function entry, exit and calling.  *//* Define this if pushing a word on the stack   makes the stack pointer a smaller address.  */#define STACK_GROWS_DOWNWARD/* Define this if the nominal address of the stack frame   is at the high-address end of the local variables;   that is, each additional local variable allocated   goes at a more negative offset in the frame.  */#define FRAME_GROWS_DOWNWARD/* Offset within stack frame to start allocating local variables at.   If FRAME_GROWS_DOWNWARD, this is the offset to the END of the   first local allocated.  Otherwise, it is the offset to the BEGINNING   of the first local allocated.  */#define STARTING_FRAME_OFFSET 0/* If we generate an insn to push BYTES bytes,

⌨️ 快捷键说明

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