📄 sysv4.h
字号:
/* Target definitions for GNU compiler for PowerPC running System V.4 Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. Contributed by Cygnus Support.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. *//* Small data support types */enum rs6000_sdata_type { SDATA_NONE, /* no small data support */ SDATA_DATA, /* just put data in .sbss/.sdata, don't use relocs */ SDATA_SYSV, /* Use r13 to point to .sdata/.sbss */ SDATA_EABI /* Use r13 like above, r2 points to .sdata2/.sbss2 */};extern enum rs6000_sdata_type rs6000_sdata;/* V.4/eabi switches */#define MASK_NO_BITFIELD_TYPE 0x40000000 /* Set PCC_BITFIELD_TYPE_MATTERS to 0 */#define MASK_STRICT_ALIGN 0x20000000 /* Set STRICT_ALIGNMENT to 1. */#define MASK_RELOCATABLE 0x10000000 /* GOT pointers are PC relative */#define MASK_EABI 0x08000000 /* Adhere to eabi, not System V spec */#define MASK_LITTLE_ENDIAN 0x04000000 /* target is little endian */#define MASK_REGNAMES 0x02000000 /* use alternate register names. */#define MASK_PROTOTYPE 0x01000000 /* Only prototyped fcns pass variable args */#define TARGET_NO_BITFIELD_TYPE (target_flags & MASK_NO_BITFIELD_TYPE)#define TARGET_STRICT_ALIGN (target_flags & MASK_STRICT_ALIGN)#define TARGET_RELOCATABLE (target_flags & MASK_RELOCATABLE)#define TARGET_EABI (target_flags & MASK_EABI)#define TARGET_LITTLE_ENDIAN (target_flags & MASK_LITTLE_ENDIAN)#define TARGET_REGNAMES (target_flags & MASK_REGNAMES)#define TARGET_PROTOTYPE (target_flags & MASK_PROTOTYPE)#define TARGET_TOC ((target_flags & MASK_64BIT) \ || ((target_flags & (MASK_RELOCATABLE \ | MASK_MINIMAL_TOC)) \ && flag_pic > 1) \ || DEFAULT_ABI == ABI_AIX \ || DEFAULT_ABI == ABI_NT)#define TARGET_BITFIELD_TYPE (! TARGET_NO_BITFIELD_TYPE)#define TARGET_BIG_ENDIAN (! TARGET_LITTLE_ENDIAN)#define TARGET_NO_PROTOTYPE (! TARGET_PROTOTYPE)#define TARGET_NO_TOC (! TARGET_TOC)#define TARGET_NO_EABI (! TARGET_EABI)/* Pseudo target to indicate whether the object format is ELF (to get around not having conditional compilation in the md file) */#define TARGET_ELF 1/* Note, V.4 no longer uses a normal TOC, so make -mfull-toc, be just the same as -mminimal-toc. */#undef SUBTARGET_SWITCHES#define SUBTARGET_SWITCHES \ { "bit-align", -MASK_NO_BITFIELD_TYPE }, \ { "no-bit-align", MASK_NO_BITFIELD_TYPE }, \ { "strict-align", MASK_STRICT_ALIGN }, \ { "no-strict-align", -MASK_STRICT_ALIGN }, \ { "relocatable", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC }, \ { "no-relocatable", -MASK_RELOCATABLE }, \ { "relocatable-lib", MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC }, \ { "no-relocatable-lib", -MASK_RELOCATABLE }, \ { "little-endian", MASK_LITTLE_ENDIAN }, \ { "little", MASK_LITTLE_ENDIAN }, \ { "big-endian", -MASK_LITTLE_ENDIAN }, \ { "big", -MASK_LITTLE_ENDIAN }, \ { "no-toc", 0 }, \ { "toc", MASK_MINIMAL_TOC }, \ { "full-toc", MASK_MINIMAL_TOC }, \ { "prototype", MASK_PROTOTYPE }, \ { "no-prototype", -MASK_PROTOTYPE }, \ { "no-traceback", 0 }, \ { "eabi", MASK_EABI }, \ { "no-eabi", -MASK_EABI }, \ { "regnames", MASK_REGNAMES }, \ { "no-regnames", -MASK_REGNAMES }, \ { "sdata", 0 }, \ { "no-sdata", 0 }, \ { "sim", 0 }, \ { "ads", 0 }, \ { "yellowknife", 0 }, \ { "mvme", 0 }, \ { "emb", 0 }, \ { "solaris-cclib", 0 }, \ { "shlib", 0 }, \ EXTRA_SUBTARGET_SWITCHES \ { "newlib", 0 },/* This is meant to be redefined in the host dependent files */#define EXTRA_SUBTARGET_SWITCHES/* Default ABI to use */#define RS6000_ABI_NAME "sysv"/* Strings provided by SUBTARGET_OPTIONS */extern const char *rs6000_abi_name;extern const char *rs6000_sdata_name;#define SUBTARGET_OPTIONS \ { "call-", &rs6000_abi_name}, \ { "sdata=", &rs6000_sdata_name}/* Max # of bytes for variables to automatically be put into the .sdata or .sdata2 sections. */extern int g_switch_value; /* value of the -G xx switch */extern int g_switch_set; /* whether -G xx was passed. */#ifndef SDATA_DEFAULT_SIZE#define SDATA_DEFAULT_SIZE 8#endif/* 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. The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to get control. */#define SUBTARGET_OVERRIDE_OPTIONS \do { \ if (!g_switch_set) \ g_switch_value = SDATA_DEFAULT_SIZE; \ \ if (!strcmp (rs6000_abi_name, "sysv")) \ rs6000_current_abi = ABI_V4; \ else if (!strcmp (rs6000_abi_name, "sysv-noeabi")) \ { \ rs6000_current_abi = ABI_V4; \ target_flags &= ~ MASK_EABI; \ } \ else if (!strcmp (rs6000_abi_name, "sysv-eabi") \ || !strcmp (rs6000_abi_name, "eabi")) \ { \ rs6000_current_abi = ABI_V4; \ target_flags |= MASK_EABI; \ } \ else if (!strcmp (rs6000_abi_name, "aix")) \ { \ rs6000_current_abi = ABI_AIX_NODESC; \ target_flags |= MASK_EABI; \ } \ else if (!strcmp (rs6000_abi_name, "aixdesc")) \ rs6000_current_abi = ABI_AIX; \ else if (!strcmp (rs6000_abi_name, "nt")) \ rs6000_current_abi = ABI_NT; \ else if (!strcmp (rs6000_abi_name, "linux")) \ rs6000_current_abi = ABI_V4; \ else if (!strcmp (rs6000_abi_name, "solaris")) \ rs6000_current_abi = ABI_SOLARIS; \ else \ { \ rs6000_current_abi = ABI_V4; \ error ("Bad value for -mcall-%s", rs6000_abi_name); \ } \ \ if (rs6000_sdata_name) \ { \ if (!strcmp (rs6000_sdata_name, "none")) \ rs6000_sdata = SDATA_NONE; \ else if (!strcmp (rs6000_sdata_name, "data")) \ rs6000_sdata = SDATA_DATA; \ else if (!strcmp (rs6000_sdata_name, "default")) \ rs6000_sdata = (TARGET_EABI) ? SDATA_EABI : SDATA_SYSV; \ else if (!strcmp (rs6000_sdata_name, "sysv")) \ rs6000_sdata = SDATA_SYSV; \ else if (!strcmp (rs6000_sdata_name, "eabi")) \ rs6000_sdata = SDATA_EABI; \ else \ error ("Bad value for -msdata=%s", rs6000_sdata_name); \ } \ else if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) \ { \ rs6000_sdata = SDATA_DATA; \ rs6000_sdata_name = "data"; \ } \ else \ { \ rs6000_sdata = SDATA_NONE; \ rs6000_sdata_name = "none"; \ } \ \ if (TARGET_RELOCATABLE && \ (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \ { \ rs6000_sdata = SDATA_DATA; \ error ("-mrelocatable and -msdata=%s are incompatible.", \ rs6000_sdata_name); \ } \ \ else if (flag_pic && \ (rs6000_sdata == SDATA_EABI || rs6000_sdata == SDATA_SYSV)) \ { \ rs6000_sdata = SDATA_DATA; \ error ("-f%s and -msdata=%s are incompatible.", \ (flag_pic > 1) ? "PIC" : "pic", \ rs6000_sdata_name); \ } \ \ if (rs6000_sdata != SDATA_NONE && DEFAULT_ABI != ABI_V4 \ && DEFAULT_ABI != ABI_SOLARIS) \ { \ rs6000_sdata = SDATA_NONE; \ error ("-msdata=%s and -mcall-%s are incompatible.", \ rs6000_sdata_name, rs6000_abi_name); \ } \ \ if (TARGET_RELOCATABLE && !TARGET_MINIMAL_TOC) \ { \ target_flags |= MASK_MINIMAL_TOC; \ error ("-mrelocatable and -mno-minimal-toc are incompatible."); \ } \ \ if (TARGET_RELOCATABLE && \ (rs6000_current_abi == ABI_AIX || rs6000_current_abi == ABI_NT)) \ { \ target_flags &= ~MASK_RELOCATABLE; \ error ("-mrelocatable and -mcall-%s are incompatible.", \ rs6000_abi_name); \ } \ \ if (flag_pic > 1 && \ (rs6000_current_abi == ABI_AIX || rs6000_current_abi == ABI_NT)) \ { \ flag_pic = 0; \ error ("-fPIC and -mcall-%s are incompatible.", \ rs6000_abi_name); \ } \ \ if (rs6000_current_abi == ABI_AIX && TARGET_LITTLE_ENDIAN) \ { \ target_flags &= ~MASK_LITTLE_ENDIAN; \ error ("-mcall-aixdesc must be big endian"); \ } \ \ if (rs6000_current_abi == ABI_NT && TARGET_BIG_ENDIAN) \ { \ target_flags |= MASK_LITTLE_ENDIAN; \ error ("-mcall-nt must be little endian"); \ } \ \ /* Treat -fPIC the same as -mrelocatable */ \ if (flag_pic > 1) \ target_flags |= MASK_RELOCATABLE | MASK_MINIMAL_TOC | MASK_NO_FP_IN_TOC; \ \ else if (TARGET_RELOCATABLE) \ flag_pic = 2; \ \} while (0)/* Default ABI to compile code for */#define DEFAULT_ABI rs6000_current_abi#define CPP_DEFAULT_SPEC "-D_ARCH_PPC"#define ASM_DEFAULT_SPEC "-mppc"#include "rs6000/rs6000.h"#undef TARGET_DEFAULT#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)#undef PROCESSOR_DEFAULT#define PROCESSOR_DEFAULT PROCESSOR_PPC601/* System V.4 uses register 13 as a pointer to the small data area, so it is not available to the normal user. */#undef FIXED_R13#define FIXED_R13 1/* System V.4 passes the first 8 floating arguments in registers, instead of the first 13 like AIX does. */#undef FP_ARG_MAX_REG#define FP_ARG_MAX_REG ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_AIX_NODESC) \ ? FP_ARG_AIX_MAX_REG : FP_ARG_V4_MAX_REG)/* Size of the V.4 varargs area if needed */#undef RS6000_VARARGS_AREA#define RS6000_VARARGS_AREA ((rs6000_sysv_varargs_p) ? RS6000_VARARGS_SIZE : 0)/* Override default big endianism */#undef BYTES_BIG_ENDIAN#undef WORDS_BIG_ENDIAN#define BYTES_BIG_ENDIAN (TARGET_BIG_ENDIAN)#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. */#if !defined(_LITTLE_ENDIAN) && !defined(__sun__)#define LIBGCC2_WORDS_BIG_ENDIAN 1#else#define LIBGCC2_WORDS_BIG_ENDIAN 0#endif/* Size of the outgoing register save area */#undef RS6000_REG_SAVE#define RS6000_REG_SAVE ((DEFAULT_ABI == ABI_AIX \ || DEFAULT_ABI == ABI_AIX_NODESC) \ ? (TARGET_64BIT ? 64 : 32) \ : 0)/* Size of the fixed area on the stack. For AIX, use the standard 6 word area, otherwise use 2 words to store back chain & LR. */#undef RS6000_SAVE_AREA#define RS6000_SAVE_AREA \ (((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_AIX_NODESC) ? 24 : 8) << (TARGET_64BIT ? 1 : 0))/* Define cutoff for using external functions to save floating point. Currently on V.4, always use inline stores */#undef FP_SAVE_INLINE#define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)/* Don't generate XCOFF debugging information. */#undef XCOFF_DEBUGGING_INFO/* Don't use the COFF object file format. */#undef OBJECT_FORMAT_COFF/* Don't bother to output .extern pseudo-ops. They are not needed by ELF assemblers. */#undef ASM_OUTPUT_EXTERNAL/* Put jump tables in read-only memory, rather than in .text. */#undef JUMP_TABLES_IN_TEXT_SECTION#define JUMP_TABLES_IN_TEXT_SECTION 0/* Disable AIX-ism that disables turning -B into -L if the argument specifies a relative file name. This breaks setting GCC_EXEC_PREFIX to D:\path under Windows. */#undef RELATIVE_PREFIX_NOT_LINKDIR/* Undefine some things which are defined by the generic svr4.h. */#undef ASM_FILE_END#undef ASM_OUTPUT_EXTERNAL_LIBCALL#undef READONLY_DATA_SECTION#undef SELECT_SECTION#undef ASM_DECLARE_FUNCTION_NAME#undef ASM_OUTPUT_CONSTRUCTOR#undef ASM_OUTPUT_DESTRUCTOR/* Use the regular svr4 definitions. */#include "svr4.h"/* Prefix and suffix to use to saving floating point */#undef SAVE_FP_PREFIX#undef SAVE_FP_SUFFIX#define SAVE_FP_PREFIX "_savefpr_"#define SAVE_FP_SUFFIX "_l"/* Prefix and suffix to use to restoring floating point */#undef RESTORE_FP_PREFIX#undef RESTORE_FP_SUFFIX
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -