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

📄 arc.h

📁 gcc-you can use this code to learn something about gcc, and inquire further into linux,
💻 H
📖 第 1 页 / 共 4 页
字号:
/* Definitions of target machine for GNU compiler, Argonaut ARC cpu.   Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002   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 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.  *//* ??? This is an old port, and is undoubtedly suffering from bit rot.  *//* Things to do:   - PREDICATE_CODES   - incscc, decscc?   - print active compiler options in assembler output*/#undef ASM_SPEC#undef LINK_SPEC#undef STARTFILE_SPEC#undef ENDFILE_SPEC#undef SIZE_TYPE#undef PTRDIFF_TYPE#undef WCHAR_TYPE#undef WCHAR_TYPE_SIZE#undef ASM_OUTPUT_LABELREF/* Print subsidiary information on the compiler version in use.  */#define TARGET_VERSION fprintf (stderr, " (arc)")/* Names to predefine in the preprocessor for this target machine.  */#define TARGET_CPU_CPP_BUILTINS()		\  do						\    {						\	builtin_define ("__arc__");		\	if (TARGET_BIG_ENDIAN)			\	  builtin_define ("__big_endian__");	\	if (arc_cpu_type == 0)			\	  builtin_define ("__base__");		\	builtin_assert ("cpu=arc");		\	builtin_assert ("machine=arc");		\    } while (0)/* Pass -mmangle-cpu if we get -mcpu=*.   Doing it this way lets one have it on as default with -mcpu=*,   but also lets one turn it off with -mno-mangle-cpu.  */#define CC1_SPEC "\%{mcpu=*:-mmangle-cpu} \%{EB:%{EL:%emay not use both -EB and -EL}} \%{EB:-mbig-endian} %{EL:-mlittle-endian} \"#define ASM_SPEC "%{v} %{EB} %{EL}"#define LINK_SPEC "%{v} %{EB} %{EL}"#define STARTFILE_SPEC "%{!shared:crt0.o%s} crtinit.o%s"#define ENDFILE_SPEC "crtfini.o%s"/* Run-time compilation parameters selecting different hardware subsets.  */extern int target_flags;/* Mangle all user symbols for the specified cpu.   ARC's can be shipped in which a collection of cpus are coupled together.   Each CPU may be different in some way, and thus we may need to distinguish   code compiled for one to ensure it isn't linked with code compiled for   another.  */#define TARGET_MASK_MANGLE_CPU 1#define TARGET_MANGLE_CPU (target_flags & TARGET_MASK_MANGLE_CPU)#if 0/* Mangle libgcc symbols by adding a suffix for the specified cpu.  */#define TARGET_MASK_MANGLE_CPU_LIBGCC 2#define TARGET_MANGLE_CPU_LIBGCC (target_flags & TARGET_MASK_MANGLE_CPU_LIBGCC)#endif/* Align loops to 32 byte boundaries (cache line size).  */#define TARGET_MASK_ALIGN_LOOPS 4#define TARGET_ALIGN_LOOPS (target_flags & TARGET_MASK_ALIGN_LOOPS)/* Big Endian.  */#define TARGET_MASK_BIG_ENDIAN 8#define TARGET_BIG_ENDIAN (target_flags & TARGET_MASK_BIG_ENDIAN)/* Turn off conditional execution optimization,   so we can see how well it does, or in case it's buggy.  */#define TARGET_MASK_NO_COND_EXEC 0x10#define TARGET_NO_COND_EXEC (target_flags & TARGET_MASK_NO_COND_EXEC)/* 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 \{ \    { "mangle-cpu",		TARGET_MASK_MANGLE_CPU },		\    { "no-mangle-cpu",		-TARGET_MASK_MANGLE_CPU },		\/*  { "mangle-cpu-libgcc",	TARGET_MASK_MANGLE_CPU_LIBGCC }, */	\/*  { "no-mangle-cpu-libgcc",	-TARGET_MASK_MANGLE_CPU_LIBGCC }, */	\    { "align-loops",		TARGET_MASK_ALIGN_LOOPS },		\    { "no-align-loops",		-TARGET_MASK_ALIGN_LOOPS },		\    { "big-endian",		TARGET_MASK_BIG_ENDIAN },		\    { "little-endian",		-TARGET_MASK_BIG_ENDIAN },		\    { "no-cond-exec",		TARGET_MASK_NO_COND_EXEC },		\    SUBTARGET_SWITCHES							\    { "", TARGET_DEFAULT }						\}#define TARGET_DEFAULT (0)#define SUBTARGET_SWITCHES/* Instruction set characteristics.   These are internal macros, set by the appropriate -mcpu= option.  *//* Nonzero means the cpu has a barrel shifter.  */#define TARGET_SHIFTER 0extern const char *arc_cpu_string;extern const char *arc_text_string,*arc_data_string,*arc_rodata_string;#define TARGET_OPTIONS \{						\  { "cpu=",	&arc_cpu_string		},	\  { "text=",	&arc_text_string	},	\  { "data=",	&arc_data_string	},	\  { "rodata=",	&arc_rodata_string	},	\}/* Which cpu we're compiling for.  */extern int arc_cpu_type;/* Check if CPU is an extension and set `arc_cpu_type' and `arc_mangle_cpu'   appropriately.  The result should be nonzero if the cpu is recognized,   otherwise zero.  This is intended to be redefined in a cover file.   This is used by arc_init.  */#define ARC_EXTENSION_CPU(cpu) 0/* Sometimes certain combinations of command options do not make   sense on a particular target machine.  You can define a macro   `OVERRIDE_OPTIONS' to take account of this.  This macro, if   defined, is executed once just after all the command options have   been parsed.   Don't use this macro to turn on various extra optimizations for   `-O'.  That is what `OPTIMIZATION_OPTIONS' is for.  */#define OVERRIDE_OPTIONS \do {				\  /* These need to be done at start up.  It's convenient to do them here.  */ \  arc_init ();			\} while (0)/* Target machine storage layout.  *//* Define this if most significant bit is lowest numbered   in instructions that operate on numbered bit-fields.  */#define BITS_BIG_ENDIAN 1/* Define this if most significant byte of a word is the lowest numbered.  */#define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)/* Define this if most significant word of a multiword number is the lowest   numbered.  */#define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN)/* Define this to set the endianness to use in libgcc2.c, which can   not depend on target_flags.  */#ifdef __big_endian__#define LIBGCC2_WORDS_BIG_ENDIAN 1#else#define LIBGCC2_WORDS_BIG_ENDIAN 0#endif/* Width of a word, in units (bytes).  */#define UNITS_PER_WORD 4/* Define this macro if it is advisable 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) < UNITS_PER_WORD)	\{						\  (MODE) = SImode;				\}/* Define this macro if the promotion described by `PROMOTE_MODE'   should also be done for outgoing function arguments.  */#define PROMOTE_FUNCTION_ARGS/* Likewise, if the function return value is promoted.  */#define PROMOTE_FUNCTION_RETURN/* 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/* ALIGN FRAMES on word boundaries */#define ARC_STACK_ALIGN(LOC) (((LOC)+7) & ~7)/* Allocation boundary (in *bits*) for the code of a function.  */#define FUNCTION_BOUNDARY 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 bit-field declared as `int' forces `int' alignment for the struct.  */#define PCC_BITFIELD_TYPE_MATTERS 1/* No data type wants to be aligned rounder than this.  *//* This is bigger than currently necessary for the ARC.  If 8 byte floats are   ever added it's not clear whether they'll need such alignment or not.  For   now we assume they will.  We can always relax it if necessary but the   reverse isn't true.  */#define BIGGEST_ALIGNMENT 64/* 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))/* Set this nonzero if move instructions will actually fail to work   when given unaligned data.  *//* On the ARC the lower address bits are masked to 0 as necessary.  The chip   won't croak when given an unaligned address, but the insn will still fail   to produce the correct result.  */#define STRICT_ALIGNMENT 1/* Layout of source language data types.  */#define SHORT_TYPE_SIZE		16#define INT_TYPE_SIZE		32#define LONG_TYPE_SIZE		32#define LONG_LONG_TYPE_SIZE	64#define FLOAT_TYPE_SIZE		32#define DOUBLE_TYPE_SIZE	64#define LONG_DOUBLE_TYPE_SIZE	64/* Define this as 1 if `char' should by default be signed; else as 0.  */#define DEFAULT_SIGNED_CHAR 1#define SIZE_TYPE "long unsigned int"#define PTRDIFF_TYPE "long int"#define WCHAR_TYPE "short unsigned int"#define WCHAR_TYPE_SIZE 16/* 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.  *//* Registers 61, 62, and 63 are not really registers and we needn't treat   them as such.  We still need a register for the condition code.  */#define FIRST_PSEUDO_REGISTER 62/* 1 for registers that have pervasive standard uses   and are not available for the register allocator.   0-28  - general purpose registers   29    - ilink1 (interrupt link register)   30    - ilink2 (interrupt link register)   31    - blink (branch link register)   32-59 - reserved for extensions   60    - LP_COUNT   61    - condition code   For doc purposes:   61    - short immediate data indicator (setting flags)   62    - long immediate data indicator   63    - short immediate data indicator (not setting flags).   The general purpose registers are further broken down into:   0-7   - arguments/results   8-15  - call used   16-23 - call saved   24    - call used, static chain pointer   25    - call used, gptmp   26    - global pointer   27    - frame pointer   28    - stack pointer   By default, the extension registers are not available.  */#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,	\  0, 0, 0, 1, 1, 1, 1, 0,	\				\  1, 1, 1, 1, 1, 1, 1, 1,	\  1, 1, 1, 1, 1, 1, 1, 1,	\  1, 1, 1, 1, 1, 1, 1, 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,	\  1, 1, 1, 1, 1, 1, 1, 1,	\  0, 0, 0, 0, 0, 0, 0, 0,	\  1, 1, 1, 1, 1, 1, 1, 1,	\				\  1, 1, 1, 1, 1, 1, 1, 1,	\  1, 1, 1, 1, 1, 1, 1, 1,	\  1, 1, 1, 1, 1, 1, 1, 1,	\  1, 1, 1, 1, 1, 1 }

⌨️ 快捷键说明

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