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

📄 arc.h

📁 gcc-2.95.3 Linux下最常用的C编译器
💻 H
📖 第 1 页 / 共 5 页
字号:
/* Definitions of target machine for GNU compiler, Argonaut ARC cpu.   Copyright (C) 1994, 1995, 1997, 1998 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*//* ??? Create elf.h and have svr4.h include it.  */#include "svr4.h"#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/* 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 CPP_PREDEFINES "-Acpu(arc) -Amachine(arc) -D__arc__"/* Additional flags for the preprocessor.  */#define CPP_SPEC "\%{!mcpu=*:-D__base__} %{mcpu=base:-D__base__} \%{EB:-D__big_endian__} \"/* 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.  *//* Non-zero means the cpu has a barrel shifter.  */#define TARGET_SHIFTER 0/* This macro is similar to `TARGET_SWITCHES' but defines names of   command options that have values.  Its definition is an   initializer with a subgrouping for each command option.   Each subgrouping contains a string constant, that defines the   fixed part of the option name, and the address of a variable.    The variable, type `char *', is set to the variable part of the   given option if the fixed part matches.  The actual option name   is made by appending `-m' to the specified name.   Here is an example which defines `-mshort-data-NUMBER'.  If the   given option is `-mshort-data-512', the variable `m88k_short_data'   will be set to the string `"512"'.	extern char *m88k_short_data;	#define TARGET_OPTIONS { { "short-data-", &m88k_short_data } }  */extern char *arc_cpu_string;extern 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 non-zero 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.  */extern void arc_init ();#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 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 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/* 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/* 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/* 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/* 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 bitfield 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/* Define results of standard character escape sequences.  */#define TARGET_BELL 007#define TARGET_BS 010#define TARGET_TAB 011#define TARGET_NEWLINE 012#define TARGET_VT 013#define TARGET_FF 014#define TARGET_CR 015/* 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,

⌨️ 快捷键说明

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