📄 pa.h
字号:
/* Definitions of target machine for GNU compiler, for the HP Spectrum. Copyright (C) 1992, 93-98, 1999 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) of Cygnus Support and Tim Moore (moore@defmacro.cs.utah.edu) of the Center for Software Science at the University of Utah.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 1, 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. */enum cmp_type /* comparison type */{ CMP_SI, /* compare integers */ CMP_SF, /* compare single precision floats */ CMP_DF, /* compare double precision floats */ CMP_MAX /* max comparison type */};/* For long call handling. */extern unsigned int total_code_bytes;/* Which processor to schedule for. */enum processor_type{ PROCESSOR_700, PROCESSOR_7100, PROCESSOR_7100LC, PROCESSOR_7200, PROCESSOR_8000};/* For -mschedule= option. */extern char *pa_cpu_string;extern enum processor_type pa_cpu;#define pa_cpu_attr ((enum attr_cpu)pa_cpu)/* The 700 can only issue a single insn at a time. The 7XXX processors can issue two insns at a time. The 8000 can issue 4 insns at a time. */#define ISSUE_RATE \ (pa_cpu == PROCESSOR_700 ? 1 \ : pa_cpu == PROCESSOR_7100 ? 2 \ : pa_cpu == PROCESSOR_7100LC ? 2 \ : pa_cpu == PROCESSOR_7200 ? 2 \ : pa_cpu == PROCESSOR_8000 ? 4 \ : 2)/* Which architecture to generate code for. */enum architecture_type{ ARCHITECTURE_10, ARCHITECTURE_11, ARCHITECTURE_20};/* For -march= option. */extern char *pa_arch_string;extern enum architecture_type pa_arch;/* Print subsidiary information on the compiler version in use. */#define TARGET_VERSION fputs (" (hppa)", stderr);/* Run-time compilation parameters selecting different hardware subsets. */extern int target_flags;/* compile code for HP-PA 1.1 ("Snake") */#define MASK_PA_11 1#define TARGET_PA_11 (target_flags & MASK_PA_11)/* Disable all FP registers (they all become fixed). This may be necessary for compiling kernels which perform lazy context switching of FP regs. Note if you use this option and try to perform floating point operations the compiler will abort! */#define MASK_DISABLE_FPREGS 2#define TARGET_DISABLE_FPREGS (target_flags & MASK_DISABLE_FPREGS)/* Generate code which assumes that calls through function pointers will never cross a space boundary. Such assumptions are generally safe for building kernels and statically linked executables. Code compiled with this option will fail miserably if the executable is dynamically linked or uses nested functions! This is also used to trigger aggressive unscaled index addressing. */#define MASK_NO_SPACE_REGS 4#define TARGET_NO_SPACE_REGS (target_flags & MASK_NO_SPACE_REGS)/* Allow unconditional jumps in the delay slots of call instructions. */#define MASK_JUMP_IN_DELAY 8#define TARGET_JUMP_IN_DELAY (target_flags & MASK_JUMP_IN_DELAY)/* Optimize for space. Currently this only turns on out of line prologues and epilogues. */#define MASK_SPACE 16#define TARGET_SPACE (target_flags & MASK_SPACE)/* Disable indexed addressing modes. */#define MASK_DISABLE_INDEXING 32#define TARGET_DISABLE_INDEXING (target_flags & MASK_DISABLE_INDEXING)/* Emit code which follows the new portable runtime calling conventions HP wants everyone to use for ELF objects. If at all possible you want to avoid this since it's a performance loss for non-prototyped code. Note TARGET_PORTABLE_RUNTIME also forces all calls to use inline long-call stubs which is quite expensive. */#define MASK_PORTABLE_RUNTIME 64#define TARGET_PORTABLE_RUNTIME (target_flags & MASK_PORTABLE_RUNTIME)/* Emit directives only understood by GAS. This allows parameter relocations to work for static functions. There is no way to make them work the HP assembler at this time. */#define MASK_GAS 128#define TARGET_GAS (target_flags & MASK_GAS)/* Emit code for processors which do not have an FPU. */#define MASK_SOFT_FLOAT 256#define TARGET_SOFT_FLOAT (target_flags & MASK_SOFT_FLOAT)/* Use 3-insn load/store sequences for access to large data segments in shared libraries on hpux10. */#define MASK_LONG_LOAD_STORE 512#define TARGET_LONG_LOAD_STORE (target_flags & MASK_LONG_LOAD_STORE)/* Use a faster sequence for indirect calls. */#define MASK_FAST_INDIRECT_CALLS 1024#define TARGET_FAST_INDIRECT_CALLS (target_flags & MASK_FAST_INDIRECT_CALLS)/* Generate code with big switch statements to avoid out of range branches occurring within the switch table. */#define MASK_BIG_SWITCH 2048#define TARGET_BIG_SWITCH (target_flags & MASK_BIG_SWITCH)/* Generate code for the HPPA 2.0 architecture. TARGET_PA_11 should also be true when this is true. */#define MASK_PA_20 4096#define TARGET_PA_20 (target_flags & MASK_PA_20)/* 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 \ {{"snake", MASK_PA_11, "Generate PA1.1 code"}, \ {"nosnake", -(MASK_PA_11 | MASK_PA_20), "Generate PA1.0 code"}, \ {"pa-risc-1-0", -(MASK_PA_11 | MASK_PA_20), "Generate PA1.0 code"}, \ {"pa-risc-1-1", MASK_PA_11, "Generate PA1.1 code"}, \ {"pa-risc-2-0", MASK_PA_20, "Generate PA2.0 code. This option requires gas snapshot 19990413 or later"}, \ {"disable-fpregs", MASK_DISABLE_FPREGS, "Disable FP regs"}, \ {"no-disable-fpregs", -MASK_DISABLE_FPREGS, "Do not disable FP regs"},\ {"no-space-regs", MASK_NO_SPACE_REGS, "Disable space regs"}, \ {"space-regs", -MASK_NO_SPACE_REGS, "Do not disable space regs"}, \ {"jump-in-delay", MASK_JUMP_IN_DELAY, "Put jumps in call delay slots"},\ {"no-jump-in-delay", -MASK_JUMP_IN_DELAY, "Do not put jumps in call delay slots"}, \ {"space", MASK_SPACE, "Optimize for code space"}, \ {"no-space", -MASK_SPACE, "Do not optimize for code space"}, \ {"disable-indexing", MASK_DISABLE_INDEXING, "Disable indexed addressing"},\ {"no-disable-indexing", -MASK_DISABLE_INDEXING, "Do not disable indexed addressing"},\ {"portable-runtime", MASK_PORTABLE_RUNTIME, "Use portable calling conventions"}, \ {"no-portable-runtime", -MASK_PORTABLE_RUNTIME, "Do not use portable calling conventions"},\ {"gas", MASK_GAS, "Assume code will be assembled by GAS"}, \ {"no-gas", -MASK_GAS, "Do not assume code will be assembled by GAS"}, \ {"soft-float", MASK_SOFT_FLOAT, "Use software floating point"}, \ {"no-soft-float", -MASK_SOFT_FLOAT, "Do not use software floating point"}, \ {"long-load-store", MASK_LONG_LOAD_STORE, "Emit long load/store sequences"}, \ {"no-long-load-store", -MASK_LONG_LOAD_STORE, "Do not emit long load/store sequences"},\ {"fast-indirect-calls", MASK_FAST_INDIRECT_CALLS, "Generate fast indirect calls"},\ {"no-fast-indirect-calls", -MASK_FAST_INDIRECT_CALLS, "Do not generate fast indirect calls"},\ {"big-switch", MASK_BIG_SWITCH, "Generate code for huge switch statements"}, \ {"no-big-switch", -MASK_BIG_SWITCH, "Do not generate code for huge switch statements"}, \ {"linker-opt", 0, "Enable linker optimizations"}, \ { "", TARGET_DEFAULT | TARGET_CPU_DEFAULT, NULL}}#ifndef TARGET_DEFAULT#define TARGET_DEFAULT (MASK_GAS | MASK_JUMP_IN_DELAY)#endif#ifndef TARGET_CPU_DEFAULT#define TARGET_CPU_DEFAULT 0#endif#define TARGET_OPTIONS \{ \ { "schedule=", &pa_cpu_string, "Specify CPU for scheduling purposes" },\ { "arch=", &pa_arch_string, "Specify architecture for code generation. Values are 1.0, 1.1, and 2.0. 2.0 requires gas snapshot 19990413 or later." }\}#define OVERRIDE_OPTIONS override_options ()#define DBX_DEBUGGING_INFO#define DEFAULT_GDB_EXTENSIONS 1/* This is the way other stabs-in-XXX tools do things. We will be compatible. */#define DBX_BLOCKS_FUNCTION_RELATIVE 1/* Likewise for linenos. We make the first line stab special to avoid adding several gross hacks to GAS. */#undef ASM_OUTPUT_SOURCE_LINE#define ASM_OUTPUT_SOURCE_LINE(file, line) \ { static int sym_lineno = 1; \ static tree last_function_decl = NULL; \ if (current_function_decl == last_function_decl) \ fprintf (file, "\t.stabn 68,0,%d,L$M%d-%s\nL$M%d:\n", \ line, sym_lineno, \ XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0) + 1, \ sym_lineno); \ else \ fprintf (file, "\t.stabn 68,0,%d,0\n", line); \ last_function_decl = current_function_decl; \ sym_lineno += 1; }/* But, to make this work, we have to output the stabs for the function name *first*... */#define DBX_FUNCTION_FIRST/* Only labels should ever begin in column zero. */#define ASM_STABS_OP "\t.stabs"#define ASM_STABN_OP "\t.stabn"/* GDB always assumes the current function's frame begins at the value of the stack pointer upon entry to the current function. Accessing local variables and parameters passed on the stack is done using the base of the frame + an offset provided by GCC. For functions which have frame pointers this method works fine; the (frame pointer) == (stack pointer at function entry) and GCC provides an offset relative to the frame pointer. This loses for functions without a frame pointer; GCC provides an offset which is relative to the stack pointer after adjusting for the function's frame size. GDB would prefer the offset to be relative to the value of the stack pointer at the function's entry. Yuk! */#define DEBUGGER_AUTO_OFFSET(X) \ ((GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0) \ + (frame_pointer_needed ? 0 : compute_frame_size (get_frame_size (), 0)))#define DEBUGGER_ARG_OFFSET(OFFSET, X) \ ((GET_CODE (X) == PLUS ? OFFSET : 0) \ + (frame_pointer_needed ? 0 : compute_frame_size (get_frame_size (), 0)))/* gdb needs a null N_SO at the end of each file for scattered loading. */#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \ text_section (); \ if (!TARGET_PORTABLE_RUNTIME) \ fputs ("\t.SPACE $TEXT$\n\t.NSUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY\n", FILE); \ else \ fprintf (FILE, "%s\n", TEXT_SECTION_ASM_OP); \ fprintf (FILE, \ "\t.stabs \"\",%d,0,0,L$text_end0000\nL$text_end0000:\n", N_SO)#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_PA_11) == 0#define CPP_SPEC "%{msnake:-D__hp9000s700 -D_PA_RISC1_1}\ %{mpa-risc-1-1:-D__hp9000s700 -D_PA_RISC1_1}\ %{!ansi: -D_HPUX_SOURCE -D_HIUX_SOURCE -D__STDC_EXT__}\ %{threads:-D_REENTRANT -D_DCE_THREADS}"#else#define CPP_SPEC "%{!mpa-risc-1-0:%{!mnosnake:%{!msoft-float:-D__hp9000s700 -D_PA_RISC1_1}}} \ %{!ansi: -D_HPUX_SOURCE -D_HIUX_SOURCE -D__STDC_EXT__}\ %{threads:-D_REENTRANT -D_DCE_THREADS}"#endif/* Defines for a K&R CC */#define CC1_SPEC "%{pg:} %{p:}"#define LINK_SPEC "%{mlinker-opt:-O} %{!shared:-u main} %{shared:-b}"/* We don't want -lg. */#ifndef LIB_SPEC#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"#endif/* Make gcc agree with <machine/ansi.h> */#define SIZE_TYPE "unsigned int"#define PTRDIFF_TYPE "int"#define WCHAR_TYPE "unsigned int"#define WCHAR_TYPE_SIZE 32/* Show we can debug even without a frame pointer. */#define CAN_DEBUG_WITHOUT_FP/* Machine dependent reorg pass. */#define MACHINE_DEPENDENT_REORG(X) pa_reorg(X)/* Prototype function used in MACHINE_DEPENDENT_REORG macro. */void pa_reorg ();/* Prototype function used in various macros. */int symbolic_operand ();/* Used in insn-*.c. */int following_call ();int function_label_operand ();int lhs_lshift_cint_operand ();/* Names to predefine in the preprocessor for this target machine. */#define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -Dunix -Dhp9000 -Dhp800 -Dspectrum -DREVARGV -Asystem(unix) -Asystem(bsd) -Acpu(hppa) -Amachine(hppa)"/* HPUX has a program 'chatr' to list the dependencies of dynamically linked executables and shared libraries. */#define LDD_SUFFIX "chatr"/* Look for lines like "dynamic /usr/lib/X11R5/libX11.sl" or "static /usr/lib/X11R5/libX11.sl". HPUX 10.20 also has lines like "static branch prediction ..." so we filter that out explicitly. We also try to bound our search for libraries with marker lines. What a pain. */#define PARSE_LDD_OUTPUT(PTR) \do { \ static int in_shlib_list = 0; \ while (*PTR == ' ') PTR++; \ if (strncmp (PTR, "shared library list:", \ sizeof ("shared library list:") - 1) == 0) \ { \ PTR = 0; \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -