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

📄 ns32k.h

📁 Mac OS X 10.4.9 for x86 Source Code gcc 实现源代码
💻 H
📖 第 1 页 / 共 4 页
字号:
/* Definitions of target machine for GNU compiler.  NS32000 version.   Copyright (C) 1988, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,   2001, 2002, 2004 Free Software Foundation, Inc.   Contributed by Michael Tiemann (tiemann@cygnus.com)This file is part of GCC.GCC 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.GCC 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 GCC; see the file COPYING.  If not, write tothe Free Software Foundation, 59 Temple Place - Suite 330,Boston, MA 02111-1307, USA.  */#define TARGET_CPU_CPP_BUILTINS()			\  do							\    {							\      builtin_define ("__ns32000__");			\							\      /* CPU type */					\      if (TARGET_32532)					\	builtin_define ("__ns32532__");			\      else if (TARGET_32332)				\	builtin_define ("__ns32332__");			\      else						\	builtin_define ("__ns32032__");			\							\      /* FPU type */					\      if (TARGET_32381)					\	builtin_define ("__ns32381__");			\      else if (TARGET_32081)				\	builtin_define ("__ns32081__");			\							\      /* Misc.  */					\      if (TARGET_RTD)					\	builtin_define ("__RTD__");			\							\      builtin_assert ("cpu=ns32k");			\      builtin_assert ("machine=ns32k");			\    }							\  while (0)/* Print subsidiary information on the compiler version in use.  */#define TARGET_VERSION fprintf (stderr, " (32000, GAS syntax)");/* ABSOLUTE PREFIX, IMMEDIATE_PREFIX and EXTERNAL_PREFIX can be defined   to cover most NS32k addressing syntax variations.  This way we don't   need to redefine long macros in all the tm.h files for just slight   variations in assembler syntax.  */#ifndef ABSOLUTE_PREFIX#define ABSOLUTE_PREFIX '@'#endif#if defined(IMMEDIATE_PREFIX) && IMMEDIATE_PREFIX#define PUT_IMMEDIATE_PREFIX(FILE) putc(IMMEDIATE_PREFIX, FILE)#else#define PUT_IMMEDIATE_PREFIX(FILE)#endif#if defined(ABSOLUTE_PREFIX) && ABSOLUTE_PREFIX#define PUT_ABSOLUTE_PREFIX(FILE) putc(ABSOLUTE_PREFIX, FILE)#else#define PUT_ABSOLUTE_PREFIX(FILE)#endif#if defined(EXTERNAL_PREFIX) && EXTERNAL_PREFIX#define PUT_EXTERNAL_PREFIX(FILE) putc(EXTERNAL_PREFIX, FILE)#else#define PUT_EXTERNAL_PREFIX(FILE)#endif/* Run-time compilation parameters selecting different hardware subsets.  */extern int target_flags;/* Masks for target_flags */#define MASK_32081		1#define MASK_RTD		2#define MASK_REGPARM		4#define MASK_32532		8#define MASK_32332		16#define MASK_NO_SB		32#define MASK_NO_BITFIELD	64#define MASK_HIMEM		128#define MASK_32381		256#define MASK_MULT_ADD		512#define MASK_SRC		1024#define MASK_IEEE_COMPARE 2048/* Macros used in the machine description to test the flags.  *//* Compile 32081 insns for floating point (not library calls). */#define TARGET_32081 (target_flags & MASK_32081)#define TARGET_32381 (target_flags & MASK_32381)/* The use of multiply-add instructions is optional because there may * be cases where it produces worse code. */#define TARGET_MULT_ADD (target_flags & MASK_MULT_ADD)/* Compile using rtd insn calling sequence.   This will not work unless you use prototypes at least   for all functions that can take varying numbers of args.  */#define TARGET_RTD (target_flags & MASK_RTD)/* Compile passing first two args in regs 0 and 1.  */#define TARGET_REGPARM (target_flags & MASK_REGPARM)/* Options to select type of CPU, for better optimization.   The output is correct for any kind of 32000 regardless of these options.  */#define TARGET_32532 (target_flags & MASK_32532)#define TARGET_32332 (target_flags & MASK_32332)/* Ok to use the static base register (and presume it's 0) */#define TARGET_SB    ((target_flags & MASK_NO_SB) == 0)#define TARGET_HIMEM (target_flags & MASK_HIMEM)/* Compile using bit-field insns.  */#define TARGET_BITFIELD ((target_flags & MASK_NO_BITFIELD) == 0)#define TARGET_IEEE_COMPARE (target_flags & MASK_IEEE_COMPARE)/* 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							\  { { "32081", MASK_32081, N_("Use hardware fp")},			\    { "soft-float", -(MASK_32081|MASK_32381),				\      N_("Don't use hardware fp")},					\    { "rtd", MASK_RTD, N_("Alternative calling convention")},		\    { "nortd", -MASK_RTD, N_("Use normal calling convention")},		\    { "regparm", MASK_REGPARM, N_("Pass some arguments in registers")},	\    { "noregparm", -MASK_REGPARM, N_("Pass all arguments on stack")},	\    { "32532", MASK_32532|MASK_32332, N_("Optimize for 32532 cpu")},	\    { "32332", MASK_32332, N_("Optimize for 32332 cpu")},		\    { "32332", -MASK_32532, 0},						\    { "32032", -(MASK_32532|MASK_32332), N_("Optimize for 32032")},	\    { "sb", -MASK_NO_SB,						\      N_("Register sb is zero. Use for absolute addressing")},		\    { "nosb", MASK_NO_SB, N_("Do not use register sb")},		\    { "bitfield", -MASK_NO_BITFIELD,					\      N_("Use bit-field instructions")},				\    { "nobitfield", MASK_NO_BITFIELD,					\      N_("Do not use bit-field instructions")},				\    { "himem", MASK_HIMEM, N_("Generate code for high memory")},	\    { "nohimem", -MASK_HIMEM, N_("Generate code for low memory")},	\    { "32381", MASK_32381, N_("32381 fpu")},				\    { "mult-add", MASK_MULT_ADD,					\      N_("Use multiply-accumulate fp instructions")},			\    { "nomult-add", -MASK_MULT_ADD,					\      N_("Do not use multiply-accumulate fp instructions") },		\    { "src", MASK_SRC, N_("\"Small register classes\" kludge")},	\    { "nosrc", -MASK_SRC, N_("No \"Small register classes\" kludge")},	\    { "ieee-compare", MASK_IEEE_COMPARE, N_("Use IEEE math for fp comparisons")},	\    { "noieee-compare", -MASK_IEEE_COMPARE,					\      N_("Do not use IEEE math for fp comparisons")},			\    { "", TARGET_DEFAULT, 0}}/* TARGET_DEFAULT is defined in encore.h, pc532.h, etc.  *//* When we are generating PIC, the sb is used as a pointer   to the GOT. 32381 is a superset of 32081  */#define OVERRIDE_OPTIONS			\{						\  if (target_flags & MASK_32532)		\    target_flags |= MASK_32332; 		\  if (flag_pic || TARGET_HIMEM)			\    target_flags |= MASK_NO_SB;			\  if (TARGET_32381)				\    target_flags |= MASK_32081;			\  else						\    target_flags &= ~MASK_MULT_ADD;		\  if (flag_unsafe_math_optimizations)		\     target_flags &= ~MASK_IEEE_COMPARE;		\}/* Zero or more C statements that may conditionally modify two   variables `fixed_regs' and `call_used_regs' (both of type `char   []') after they have been initialized from the two preceding   macros.   This is necessary in case the fixed or call-clobbered registers   depend on target flags.   You need not define this macro if it has no work to do.   If the usage of an entire class of registers depends on the target   flags, you may indicate this to GCC by using this macro to modify   `fixed_regs' and `call_used_regs' to 1 for each of the registers in   the classes which should not be used by GCC.  Also define the macro   `REG_CLASS_FROM_LETTER' to return `NO_REGS' if it is called with a   letter for a class that shouldn't be used.   (However, if this class is not included in `GENERAL_REGS' and all   of the insn patterns whose constraints permit this class are   controlled by target switches, then GCC will automatically avoid   using these registers when the target switches are opposed to   them.)  */#define CONDITIONAL_REGISTER_USAGE					\do									\  {									\    if (!TARGET_32081)						\      {									\	int regno;							\									\	for (regno = F0_REGNUM; regno <= F0_REGNUM + 8; regno++)	\	  fixed_regs[regno] = call_used_regs[regno] = 1;		\      }									\    if (!TARGET_32381)						\      {									\	int regno;							\									\	for (regno = L1_REGNUM; regno <= L1_REGNUM + 8; regno++)	\	  fixed_regs[regno] = call_used_regs[regno] = 1;		\      }									\  }									\while (0)/* target machine storage layout *//* Define this if most significant bit is lowest numbered   in instructions that operate on numbered bit-fields.   This is not true on the ns32k.  */#define BITS_BIG_ENDIAN 0/* Define this if most significant byte of a word is the lowest numbered.  *//* That is not true on the ns32k.  */#define BYTES_BIG_ENDIAN 0/* Define this if most significant word of a multiword number is lowest   numbered. This is not true on the ns32k.  */#define WORDS_BIG_ENDIAN 0/* Width of a word, in units (bytes).  */#define UNITS_PER_WORD 4/* 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.  */#define FUNCTION_BOUNDARY 16/* Alignment of field after `int : 0' in a structure.  */#define EMPTY_FIELD_BOUNDARY 32/* Every structure's size must be a multiple of this.  */#define STRUCTURE_SIZE_BOUNDARY 8/* No data type wants to be aligned rounder than this.  */#define BIGGEST_ALIGNMENT 32/* Set this nonzero if move instructions will actually fail to work   when given unaligned data.  National claims that the NS32032   works without strict alignment, but rumor has it that operands   crossing a page boundary cause unpredictable results.  */#define STRICT_ALIGNMENT 1/* If bit field type is int, don't let it cross an int,   and give entire struct the alignment of an int.  *//* Required on the 386 since it doesn't have a full set of bit-field insns.   (There is no signed extv insn.)  */#define PCC_BITFIELD_TYPE_MATTERS 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.  */#define FIRST_PSEUDO_REGISTER 26/* 1 for registers that have pervasive standard uses   and are not available for the register allocator.   On the ns32k, these are the FP, SP, (SB and PC are not included here).  */#define FIXED_REGISTERS {0, 0, 0, 0, 0, 0, 0, 0, \			 0, 0, 0, 0, 0, 0, 0, 0, \                         0, 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.  */#define CALL_USED_REGISTERS {1, 1, 1, 0, 0, 0, 0, 0, \			     1, 1, 1, 1, 0, 0, 0, 0, \			     1, 1, 0, 0, 0, 0, 0, 0, \			     1, 1}/* How to refer to registers in assembler output.   This sequence is indexed by compiler's hard-register-number (see above).  */#define REGISTER_NAMES \{"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ "l1", "l1h","l3", "l3h","l5", "l5h","l7", "l7h", \ "fp", "sp"}

⌨️ 快捷键说明

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