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

📄 rs6000.h

📁 早期freebsd实现
💻 H
📖 第 1 页 / 共 5 页
字号:
/* Definitions of target machine for GNU compiler, for IBM RS/6000.   Copyright (C) 1992 Free Software Foundation, Inc.   Contributed by Richard Kenner (kenner@nyu.edu)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, 675 Mass Ave, Cambridge, MA 02139, USA.  *//* Note that some other tm.h files include this one and then override   many of the definitions that relate to assembler syntax.  *//* Names to predefine in the preprocessor for this target machine.  */#define CPP_PREDEFINES "-D_IBMR2 -D_AIX"/* Print subsidiary information on the compiler version in use.  */#define TARGET_VERSION ;/* Tell the assembler to assume that all undefined names are external.   Don't do this until the fixed IBM assembler is more generally available.   When this becomes permanently defined, the ASM_OUTPUT_EXTERNAL,   ASM_OUTPUT_EXTERNAL_LIBCALL, and RS6000_OUTPUT_BASENAME macros will no   longer be needed.  *//* #define ASM_SPEC "-u" *//* Define the options for the binder: Start text at 512, align all segments   to 512 bytes, and warn if there is text relocation.   The -bhalt:4 option supposedly changes the level at which ld will abort,   but it also suppresses warnings about multiply defined symbols and is   used by the AIX cc command.  So we use it here.   -bnodelcsect undoes a poor choice of default relating to multiply-defined   csects.  See AIX documentation for more information about this.  */#define LINK_SPEC "-T512 -H512 -btextro -bhalt:4 -bnodelcsect\   %{static:-bnso -bI:/lib/syscalls.exp}"/* Profiled library versions are used by linking with special directories.  */#define LIB_SPEC "%{pg:-L/lib/profiled -L/usr/lib/profiled}\   %{p:-L/lib/profiled -L/usr/lib/profiled} %{g*:-lg} -lc"/* gcc must do the search itself to find libgcc.a, not use -l.  */#define LINK_LIBGCC_SPECIAL_1/* Don't turn -B into -L if the argument specifies a relative file name.  */#define RELATIVE_PREFIX_NOT_LINKDIR/* Run-time compilation parameters selecting different hardware subsets.  *//* Flag to allow putting fp constants in the TOC; can be turned off when   the TOC overflows.  */#define TARGET_FP_IN_TOC  (target_flags & 1)extern int target_flags;/* 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		\  {{"fp-in-toc", 1},		\   {"no-fp-in-toc", -1},	\   { "", TARGET_DEFAULT}}#define TARGET_DEFAULT 1/* On the RS/6000, we turn on various flags if optimization is selected.  */#define OPTIMIZATION_OPTIONS(LEVEL)	\{					\  if ((LEVEL) > 0)			\    {					\      flag_force_mem = 1;		\      flag_omit_frame_pointer = 1;	\    }					\}/* Define this to modify the options specified by the user.  */#define OVERRIDE_OPTIONS		\{					\   profile_block_flag = 0;		\}/* target machine storage layout *//* Define this macro if it is advisible to hold scalars in registers   in a wider mode than that declared by the program.  In such cases,    the value is constrained to be within the bounds of the declared   type, but kept valid in the wider mode.  The signedness of the   extension may differ from that of the type.  */#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE)  \  if (GET_MODE_CLASS (MODE) == MODE_INT	\      && GET_MODE_SIZE (MODE) < 4)  	\    (MODE) == SImode;/* Define this if most significant bit is lowest numbered   in instructions that operate on numbered bit-fields. *//* That is true on RS/6000. */#define BITS_BIG_ENDIAN 1/* Define this if most significant byte of a word is the lowest numbered.  *//* That is true on RS/6000.  */#define BYTES_BIG_ENDIAN 1/* Define this if most significant word of a multiword number is lowest   numbered.    For RS/6000 we can decide arbitrarily since there are no machine   instructions for them.  Might as well be consistent with bits and bytes. */#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 32/* Width of a word, in units (bytes).  */#define UNITS_PER_WORD 4/* Type used for ptrdiff_t, as a string used in a declaration.  */#define PTRDIFF_TYPE "int"/* Type used for wchar_t, as a string used in a declaration.  */#define WCHAR_TYPE "short unsigned int"/* Width of wchar_t in bits.  */#define WCHAR_TYPE_SIZE 16/* 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 64/* Allocation boundary (in *bits*) for the code of a function.  */#define FUNCTION_BOUNDARY 32/* No data type wants to be aligned rounder than this.  */#define BIGGEST_ALIGNMENT 32/* 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/* A bitfield declared as `int' forces `int' alignment for the struct.  */#define PCC_BITFIELD_TYPE_MATTERS 1/* Make strings word-aligned so strcpy from constants will be faster.  */#define CONSTANT_ALIGNMENT(EXP, ALIGN)  \  (TREE_CODE (EXP) == STRING_CST	\   && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (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) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN))/* Non-zero if move instructions will actually fail to work   when given unaligned data.  */#define STRICT_ALIGNMENT 0/* 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.   RS/6000 has 32 fixed-point registers, 32 floating-point registers,   an MQ register, a count register, a link register, and 8 condition   register fields, which we view here as separate registers.   In addition, the difference between the frame and argument pointers is   a function of the number of registers saved, so we need to have a   register for AP that will later be eliminated in favor of SP or FP.   This is a normal register, but it is fixed.  */#define FIRST_PSEUDO_REGISTER 76/* 1 for registers that have pervasive standard uses   and are not available for the register allocator.   On RS/6000, r1 is used for the stack and r2 is used as the TOC pointer.     cr5 is not supposed to be used.  */#define FIXED_REGISTERS  \  {0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 1, 0, 0}/* 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, 1, 1, 1, 1, 1, 0, 0, 0, \   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, \   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \   1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1}/* List the order in which to allocate registers.  Each register must be   listed once, even those in FIXED_REGISTERS.   We allocate in the following order:	fp0		(not saved or used for anything)	fp13 - fp2	(not saved; incoming fp arg registers)	fp1		(not saved; return value) 	fp31 - fp14	(saved; order given to save least number)	cr1, cr6, cr7	(not saved or special)	cr0		(not saved, but used for arithmetic operations)	cr2, cr3, cr4	(saved)        r0		(not saved; cannot be base reg)	r9		(not saved; best for TImode)	r11, r10, r8-r4	(not saved; highest used first to make less conflict)	r3     		(not saved; return value register)	r31 - r13	(saved; order given to save least number)	r12		(not saved; if used for DImode or DFmode would use r13)	mq		(not saved; best to use it if we can)	ctr		(not saved; when we have the choice ctr is better)	lr		(saved)        cr5, r1, r2, ap	(fixed)  */#define REG_ALLOC_ORDER					\  {32, 							\   45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34,	\   33,							\   63, 62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51,	\   50, 49, 48, 47, 46, 					\   69, 74, 75, 68, 70, 71, 72,				\   0,							\   9, 11, 10, 8, 7, 6, 5, 4,				\   3,							\   31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19,	\   18, 17, 16, 15, 14, 13, 12,				\   64, 66, 65, 						\   73, 1, 2, 67}/* True if register is floating-point.  */#define FP_REGNO_P(N) ((N) >= 32 && (N) <= 63)/* True if register is a condition register.  */#define CR_REGNO_P(N) ((N) >= 68 && (N) <= 75)/* True if register is an integer register.  */#define INT_REGNO_P(N) ((N) <= 31 || (N) == 67)/* 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 RS/6000, ordinary registers hold 32 bits worth;   a single floating point register holds 64 bits worth.  */#define HARD_REGNO_NREGS(REGNO, MODE)   \  (FP_REGNO_P (REGNO)			\   ? ((GET_MODE_SIZE (MODE) + 2 * UNITS_PER_WORD - 1) / (2 * UNITS_PER_WORD)) \   : ((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.   On RS/6000, the cpu registers can hold any mode but the float registers   can hold only floating modes and CR register can only hold CC modes.  We   cannot put DImode or TImode anywhere except general register and they   must be able to fit within the register set.  */#define HARD_REGNO_MODE_OK(REGNO, MODE) \  (FP_REGNO_P (REGNO) ? GET_MODE_CLASS (MODE) == MODE_FLOAT	\   : CR_REGNO_P (REGNO) ? GET_MODE_CLASS (MODE) == MODE_CC	\   : ! INT_REGNO_P (REGNO) ? GET_MODE_CLASS (MODE) == MODE_INT	\   : 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) \  (GET_MODE_CLASS (MODE1) == MODE_FLOAT		\   ? GET_MODE_CLASS (MODE2) == MODE_FLOAT	\   : GET_MODE_CLASS (MODE2) == MODE_FLOAT	\   ? GET_MODE_CLASS (MODE1) == MODE_FLOAT	\   : GET_MODE_CLASS (MODE1) == MODE_CC		\   ? GET_MODE_CLASS (MODE2) == MODE_CC		\   : GET_MODE_CLASS (MODE2) == MODE_CC		\   ? GET_MODE_CLASS (MODE1) == MODE_CC		\   : 1)/* A C expression returning the cost of moving data from a register of class   CLASS1 to one of CLASS2.   On the RS/6000, copying between floating-point and fixed-point   registers is expensive.  */#define REGISTER_MOVE_COST(CLASS1, CLASS2)			\  ((CLASS1) == FLOAT_REGS && (CLASS2) == FLOAT_REGS ? 2		\   : (CLASS1) == FLOAT_REGS && (CLASS2) != FLOAT_REGS ? 10	\   : (CLASS1) != FLOAT_REGS && (CLASS2) == FLOAT_REGS ? 10	\   : 2)/* A C expressions returning the cost of moving data of MODE from a register to   or from memory.   On the RS/6000, bump this up a bit.  */#define MEMORY_MOVE_COST(MODE)  6/* Specify the cost of a branch insn; roughly the number of extra insns that   should be added to avoid a branch.   Set this to 3 on the RS/6000 since that is roughly the average cost of an   unscheduled conditional branch.  */#define BRANCH_COST 3/* Specify the registers used for certain standard purposes.

⌨️ 快捷键说明

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