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

📄 sh.h

📁 GUN开源阻止下的编译器GCC
💻 H
📖 第 1 页 / 共 4 页
字号:
/* Definitions of target machine for GNU compiler for Hitachi Super-H.   Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.   Contributed by Steve Chamberlain (sac@cygnus.com).   Improved by Jim Wilson (wilson@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.  */#define TARGET_VERSION \  fputs (" (Hitachi SH)", stderr);/* Generate SDB debugging information.  */#define SDB_DEBUGGING_INFO/* Output DBX (stabs) debugging information if doing -gstabs.  */#define DBX_DEBUGGING_INFO/* Generate SDB debugging information by default.  */#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG#define SDB_DELIM ";"#define CPP_SPEC "%{ml:-D__LITTLE_ENDIAN__}"#define CPP_PREDEFINES "-D__sh__ -Acpu(sh) -Amachine(sh)"#define ASM_SPEC  "%{ml:-little}"#define LINK_SPEC "%{ml:-m shl}"/* We can not debug without a frame pointer.  *//* #define CAN_DEBUG_WITHOUT_FP */#define CONDITIONAL_REGISTER_USAGE				\  /* Hitachi saves and restores mac registers on call.  */	\  if (TARGET_HITACHI)						\   {								\     call_used_regs[MACH_REG] = 0;				\     call_used_regs[MACL_REG] = 0;				\  }/* ??? Need to write documentation for all SH options and add it to the   invoke.texi file.  *//* Run-time compilation parameters selecting different hardware subsets.  */extern int target_flags;#define ISIZE_BIT      	(1<<1)#define DALIGN_BIT     	(1<<6)#define SH0_BIT	       	(1<<7)#define SH1_BIT	       	(1<<8)#define SH2_BIT	       	(1<<9)#define SH3_BIT	       	(1<<10)#define SPACE_BIT 	(1<<13)#define BIGTABLE_BIT  	(1<<14)#define HITACHI_BIT     (1<<22)#define PADSTRUCT_BIT  (1<<28)#define LITTLE_ENDIAN_BIT (1<<29)/* Nonzero if we should dump out instruction size info.  */#define TARGET_DUMPISIZE  (target_flags & ISIZE_BIT)/* Nonzero to align doubles on 64 bit boundaries.  */#define TARGET_ALIGN_DOUBLE (target_flags & DALIGN_BIT)/* Nonzero if we should generate code using type 0 insns.  *//* ??? Is there such a thing as SH0?  If not, we should delete all   references to it.  */#define TARGET_SH0 (target_flags & SH0_BIT)/* Nonzero if we should generate code using type 1 insns.  */#define TARGET_SH1 (target_flags & SH1_BIT)/* Nonzero if we should generate code using type 2 insns.  */#define TARGET_SH2 (target_flags & SH2_BIT)/* Nonzero if we should generate code using type 3 insns.  */#define TARGET_SH3 (target_flags & SH3_BIT)/* Nonzero if we should generate smaller code rather than faster code.  */#define TARGET_SMALLCODE   (target_flags & SPACE_BIT)/* Nonzero to use long jump tables.  */#define TARGET_BIGTABLE     (target_flags & BIGTABLE_BIT)/* Nonzero if using Hitachi's calling convention.  */#define TARGET_HITACHI 		(target_flags & HITACHI_BIT)/* Nonzero if padding structures to a multiple of 4 bytes.  This is   incompatible with Hitachi's compiler, and gives unusual structure layouts   which confuse programmers.   ??? This option is not useful, but is retained in case there are people   who are still relying on it.  It may be deleted in the future.  */#define TARGET_PADSTRUCT       (target_flags & PADSTRUCT_BIT)/* Nonzero if generating code for a little endian SH.  */#define TARGET_LITTLE_ENDIAN     (target_flags & LITTLE_ENDIAN_BIT)#define TARGET_SWITCHES  			\{ {"0",	        SH0_BIT},			\  {"1",	        SH1_BIT},			\  {"2",	        SH2_BIT},			\  {"3",	        SH3_BIT|SH2_BIT},		\  {"3l",        SH3_BIT|SH2_BIT|LITTLE_ENDIAN_BIT},	\  {"b",		-LITTLE_ENDIAN_BIT},  		\  {"bigtable", 	BIGTABLE_BIT},			\  {"dalign",  	DALIGN_BIT},			\  {"hitachi",	HITACHI_BIT},			\  {"isize", 	ISIZE_BIT},			\  {"l",		LITTLE_ENDIAN_BIT},  		\  {"padstruct", PADSTRUCT_BIT},    		\  {"space", 	SPACE_BIT},			\  {"",   	TARGET_DEFAULT} 		\}#define TARGET_DEFAULT  (0)#define OVERRIDE_OPTIONS 					\do {								\  sh_cpu = CPU_SH0;						\  if (TARGET_SH1)						\    sh_cpu = CPU_SH1;						\  if (TARGET_SH2)						\    sh_cpu = CPU_SH2;						\  if (TARGET_SH3)						\    sh_cpu = CPU_SH3;						\								\  /* We *MUST* always define optimize since we *HAVE* to run	\     shorten branches to get correct code.  */			\  /* ??? This is obsolete, since now shorten branches is no	\     longer required by the SH, and is always run once even	\     when not optimizing.  Changing this now might be		\     confusing though.  */					\  optimize = 1;							\  flag_delayed_branch = 1;					\								\  /* But never run scheduling before reload, since that can	\     break global alloc, and generates slower code anyway due	\     to the pressure on R0.  */					\  flag_schedule_insns = 0;					\} while (0)/* 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.  */#define BITS_BIG_ENDIAN  0/* Define this if most significant byte of a word is the lowest numbered.  */#define BYTES_BIG_ENDIAN (TARGET_LITTLE_ENDIAN == 0)/* Define this if most significant word of a multiword number is the lowest   numbered.  */#define WORDS_BIG_ENDIAN (TARGET_LITTLE_ENDIAN == 0)/* Define this to set the endianness to use in libgcc2.c, which can   not depend on target_flags.  */#if defined(__LITTLE_ENDIAN__)#define LIBGCC2_WORDS_BIG_ENDIAN 0#else#define LIBGCC2_WORDS_BIG_ENDIAN 1#endif/* 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  32#define MAX_BITS_PER_WORD 32/* Width of a word, in units (bytes).  */#define UNITS_PER_WORD	4/* Width in bits of a pointer.   See also the macro `Pmode' defined below.  */#define POINTER_SIZE  32/* Allocation boundary (in *bits*) for storing arguments in argument list.  */#define PARM_BOUNDARY  	32/* Boundary (in *bits*) on which stack pointer should be aligned.  */#define STACK_BOUNDARY  32/* Allocation boundary (in *bits*) for the code of a function.   32 bit alignment is faster, because instructions are always fetched as a   pair from a longword boundary.  *//* ??? Perhaps also define ASM_OUTPUT_ALIGN_CODE and/or ASM_OUTPUT_LOOP_ALIGN   so as to align jump targets and/or loops to 4 byte boundaries when not   optimizing for space?  */#define FUNCTION_BOUNDARY  (TARGET_SMALLCODE ? 16 : 32)/* Alignment of field after `int : 0' in a structure.  */#define EMPTY_FIELD_BOUNDARY  32/* No data type wants to be aligned rounder than this.  */#define BIGGEST_ALIGNMENT  (TARGET_ALIGN_DOUBLE ? 64 : 32)/* The best alignment to use in cases where we have a choice.  */#define FASTEST_ALIGNMENT 32/* Make strings word-aligned so strcpy from constants will be faster.  */#define CONSTANT_ALIGNMENT(EXP, ALIGN)	\  ((TREE_CODE (EXP) == STRING_CST	\    && (ALIGN) < FASTEST_ALIGNMENT)	\    ? FASTEST_ALIGNMENT : (ALIGN))/* Make arrays of chars word-aligned for the same reasons.  */#define DATA_ALIGNMENT(TYPE, ALIGN)		\  (TREE_CODE (TYPE) == ARRAY_TYPE		\   && TYPE_MODE (TREE_TYPE (TYPE)) == QImode	\   && (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN))/* Number of bits which any structure or union's size must be a   multiple of.  Each structure or union's size is rounded up to a   multiple of this.  */#define STRUCTURE_SIZE_BOUNDARY (TARGET_PADSTRUCT ? 32 : 8)/* Set this nonzero if move instructions will actually fail to work   when given unaligned data.  */#define STRICT_ALIGNMENT 1/* Standard register usage.  *//* Register allocation for the Hitachi calling convention:        r0		arg return	r1..r3          scratch	r4..r7		args in	r8..r13		call saved	r14		frame pointer/call saved	r15		stack pointer	ap		arg pointer (doesn't really exist, always eliminated)	pr		subroutine return address	t               t bit	mach		multiply/accumulate result, high part	macl		multiply/accumulate result, low part.  *//* 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.  */#define AP_REG   16#define PR_REG   17#define T_REG    18#define GBR_REG  19#define MACH_REG 20#define MACL_REG 21#define SPECIAL_REG(REGNO) ((REGNO) >= 18 && (REGNO) <= 21)#define FIRST_PSEUDO_REGISTER 22/* 1 for registers that have pervasive standard uses   and are not available for the register allocator.   Mach register is fixed 'cause it's only 10 bits wide for SH1.   It is 32 bits wide for SH2.  */#define FIXED_REGISTERS  	\  { 0,  0,  0,  0, 		\    0,  0,  0,  0, 		\    0,  0,  0,  0, 		\    0,  0,  0,  1, 		\    1,  1,  1,  1, 		\    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.  */#define CALL_USED_REGISTERS 	\   { 1,  1,  1,  1,		\     1,  1,  1,  1, 		\     0,  0,  0,  0,		\     0,  0,  0,  1,		\     1,  0,  1,  1,		\     1,  1}/* 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.   On the SH regs are UNITS_PER_WORD bits wide.  */#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.   We can allow any mode in any general register.  The special registers   only allow SImode.  Don't allow any mode in the PR.  */#define HARD_REGNO_MODE_OK(REGNO, MODE)		\  (SPECIAL_REG (REGNO) ? (MODE) == SImode	\   : (REGNO) == PR_REG ? 0			\   : 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) || GET_MODE_CLASS (MODE1) == GET_MODE_CLASS (MODE2))/* Specify the registers used for certain standard purposes.   The values of these macros are register numbers.  *//* Define this if the program counter is overloaded on a register.  *//* #define PC_REGNUM		15*//* Register to use for pushing function arguments.  */#define STACK_POINTER_REGNUM	15/* Base register for access to local variables of the function.  */#define FRAME_POINTER_REGNUM	14/* 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.  */#define FRAME_POINTER_REQUIRED	0/* Definitions for register eliminations.   We have two registers that can be eliminated on the SH.  First, the   frame pointer register can often be eliminated in favor of the stack   pointer register.  Secondly, the argument pointer register can always be   eliminated; it is replaced with either the stack or frame pointer.  *//* This is an array of structures.  Each structure initializes one pair   of eliminable registers.  The "from" register number is given first,   followed by "to".  Eliminations of the same "from" register are listed

⌨️ 快捷键说明

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