📄 dsp16xx.h
字号:
/* Definitions of target machine for GNU compiler. AT&T DSP1600. Copyright (C) 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Michael Collison (collison@isisinc.net).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. */extern const char *low_reg_names[];extern const char *text_seg_name;extern const char *rsect_text;extern const char *data_seg_name;extern const char *rsect_data;extern const char *bss_seg_name;extern const char *rsect_bss;extern const char *const_seg_name;extern const char *rsect_const;extern const char *chip_name;extern const char *save_chip_name;extern GTY(()) rtx dsp16xx_compare_op0;extern GTY(()) rtx dsp16xx_compare_op1;extern GTY(()) rtx dsp16xx_addhf3_libcall;extern GTY(()) rtx dsp16xx_subhf3_libcall;extern GTY(()) rtx dsp16xx_mulhf3_libcall;extern GTY(()) rtx dsp16xx_divhf3_libcall;extern GTY(()) rtx dsp16xx_cmphf3_libcall;extern GTY(()) rtx dsp16xx_fixhfhi2_libcall;extern GTY(()) rtx dsp16xx_floathihf2_libcall;extern GTY(()) rtx dsp16xx_neghf2_libcall;extern GTY(()) rtx dsp16xx_mulhi3_libcall;extern GTY(()) rtx dsp16xx_udivqi3_libcall;extern GTY(()) rtx dsp16xx_udivhi3_libcall;extern GTY(()) rtx dsp16xx_divqi3_libcall;extern GTY(()) rtx dsp16xx_divhi3_libcall;extern GTY(()) rtx dsp16xx_modqi3_libcall;extern GTY(()) rtx dsp16xx_modhi3_libcall;extern GTY(()) rtx dsp16xx_umodqi3_libcall;extern GTY(()) rtx dsp16xx_umodhi3_libcall;extern GTY(()) rtx dsp16xx_ashrhi3_libcall;extern GTY(()) rtx dsp16xx_ashlhi3_libcall;extern GTY(()) rtx dsp16xx_lshrhi3_libcall;/* RUN-TIME TARGET SPECIFICATION */#define DSP16XX 1/* Name of the AT&T assembler */#define ASM_PROG "as1600"/* Name of the AT&T linker */#define LD_PROG "ld1600"/* Define which switches take word arguments */#define WORD_SWITCH_TAKES_ARG(STR) \ (!strcmp (STR, "ifile") ? 1 : \ 0)#undef CC1_SPEC#define CC1_SPEC "%{!O*:-O}"/* Define this as a spec to call the AT&T assembler */#define CROSS_ASM_SPEC "%{!S:as1600 %a %i\n }"/* Define this as a spec to call the AT&T linker */#define CROSS_LINK_SPEC "%{!c:%{!M:%{!MM:%{!E:%{!S:ld1600 %l %X %{o*} %{m} \ %{r} %{s} %{t} %{u*} %{x}\ %{!A:%{!nostdlib:%{!nostartfiles:%S}}} %{static:}\ %{L*} %D %o %{!nostdlib:-le1600 %L -le1600}\ %{!A:%{!nostdlib:%{!nostartfiles:%E}}}\n }}}}}"/* Nothing complicated here, just link with libc.a under normal circumstances */#define LIB_SPEC "-lc"/* Specify the startup file to link with. */#define STARTFILE_SPEC "%{mmap1:m1_crt0.o%s} \%{mmap2:m2_crt0.o%s} \%{mmap3:m3_crt0.o%s} \%{mmap4:m4_crt0.o%s} \%{!mmap*: %{!ifile*: m4_crt0.o%s} %{ifile*: \%ea -ifile option requires a -map option}}"/* Specify the end file to link with */#define ENDFILE_SPEC "%{mmap1:m1_crtn.o%s} \%{mmap2:m2_crtn.o%s} \%{mmap3:m3_crtn.o%s} \%{mmap4:m4_crtn.o%s} \%{!mmap*: %{!ifile*: m4_crtn.o%s} %{ifile*: \%ea -ifile option requires a -map option}}"/* Tell gcc where to look for the startfile *//*#define STANDARD_STARTFILE_PREFIX "/d1600/lib"*//* Tell gcc where to look for it's executables *//*#define STANDARD_EXEC_PREFIX "/d1600/bin"*//* Command line options to the AT&T assembler */#define ASM_SPEC "%{V} %{v:%{!V:-V}} %{g*:-g}"/* Command line options for the AT&T linker */#define LINK_SPEC "%{V} %{v:%{!V:-V}} %{minit:-i} \%{!ifile*:%{mmap1:m1_deflt.if%s} \ %{mmap2:m2_deflt.if%s} \ %{mmap3:m3_deflt.if%s} \ %{mmap4:m4_deflt.if%s} \ %{!mmap*:m4_deflt.if%s}} \%{ifile*:%*} %{r}"/* Include path is determined from the environment variable */#define INCLUDE_DEFAULTS \{ \ { 0, 0, 0 } \}/* Names to predefine in the preprocessor for this target machine. */#define TARGET_CPU_CPP_BUILTINS() \ do \ { \ builtin_define_std ("dsp1600"); \ builtin_define_std ("DSP1600"); \ } \ while (0)#ifdef __MSDOS__# define TARGET_OS_CPP_BUILTINS() \ do \ { \ builtin_define_std ("MSDOS"); \ } \ while (0)#else# define TARGET_OS_CPP_BUILTINS() \ do \ { \ builtin_define_std ("dsp1610"); \ builtin_define_std ("DSP1610"); \ } \ while (0)#endif/* Run-time compilation parameters selecting different hardware subsets. */extern int target_flags;/* Macros used in the machine description to test the flags. */#define MASK_REGPARM 0x00000001 /* Pass parameters in registers */#define MASK_NEAR_CALL 0x00000002 /* The call is on the same 4k page */#define MASK_NEAR_JUMP 0x00000004 /* The jump is on the same 4k page */#define MASK_BMU 0x00000008 /* Use the 'bmu' shift instructions */#define MASK_MAP1 0x00000040 /* Link with map1 */#define MASK_MAP2 0x00000080 /* Link with map2 */#define MASK_MAP3 0x00000100 /* Link with map3 */#define MASK_MAP4 0x00000200 /* Link with map4 */#define MASK_YBASE_HIGH 0x00000400 /* The ybase register window starts high */#define MASK_INIT 0x00000800 /* Have the linker generate tables to initialize data at startup */#define MASK_RESERVE_YBASE 0x00002000 /* Reserved the ybase registers */#define MASK_DEBUG 0x00004000 /* Debugging turned on*/#define MASK_SAVE_TEMPS 0x00008000 /* Save temps. option seen *//* Compile passing first two args in regs 0 and 1. This exists only to test compiler features that will be needed for RISC chips. It is not usable and is not intended to be usable on this cpu. */#define TARGET_REGPARM (target_flags & MASK_REGPARM)/* The call is on the same 4k page, so instead of loading the 'pt' register and branching, we can branch directly */#define TARGET_NEAR_CALL (target_flags & MASK_NEAR_CALL)/* The jump is on the same 4k page, so instead of loading the 'pt' register and branching, we can branch directly */#define TARGET_NEAR_JUMP (target_flags & MASK_NEAR_JUMP)/* Generate shift instructions to use the 1610 Bit Manipulation Unit. */#define TARGET_BMU (target_flags & MASK_BMU)#define TARGET_YBASE_HIGH (target_flags & MASK_YBASE_HIGH)/* Direct the linker to output extra info for initialized data */#define TARGET_MASK_INIT (target_flags & MASK_INIT)#define TARGET_INLINE_MULT (target_flags & MASK_INLINE_MULT)/* Reserve the ybase registers *(0) - *(31) */#define TARGET_RESERVE_YBASE (target_flags & MASK_RESERVE_YBASE)/* We turn this option on internally after seeing "-g" */#define TARGET_DEBUG (target_flags & MASK_DEBUG)/* We turn this option on internally after seeing "-save-temps */#define TARGET_SAVE_TEMPS (target_flags & MASK_SAVE_TEMPS)/* 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 \ { \ { "regparm", MASK_REGPARM, \ N_("Pass parameters in registers (default)") }, \ { "no-regparm", -MASK_REGPARM, \ N_("Don't pass parameters in registers") }, \ { "near-call", MASK_NEAR_JUMP, \ N_("Generate code for near calls") }, \ { "no-near-call", -MASK_NEAR_CALL, \ N_("Don't generate code for near calls") }, \ { "near-jump", MASK_NEAR_JUMP, \ N_("Generate code for near jumps") }, \ { "no-near-jump", -MASK_NEAR_JUMP, \ N_("Don't generate code for near jumps") }, \ { "bmu", MASK_BMU, \ N_("Generate code for a bit-manipulation unit") }, \ { "no-bmu", -MASK_BMU, \ N_("Don't generate code for a bit-manipulation unit") }, \ { "map1", MASK_MAP1, \ N_("Generate code for memory map1") }, \ { "map2", MASK_MAP2, \ N_("Generate code for memory map2") }, \ { "map3", MASK_MAP3, \ N_("Generate code for memory map3") }, \ { "map4", MASK_MAP4, \ N_("Generate code for memory map4") }, \ { "init", MASK_INIT, \ N_("Ouput extra code for initialized data") }, \ { "reserve-ybase", MASK_RESERVE_YBASE, \ N_("Don't let reg. allocator use ybase registers") }, \ { "debug", MASK_DEBUG, \ N_("Output extra debug info in Luxworks environment") }, \ { "save-temporaries", MASK_SAVE_TEMPS, \ N_("Save temp. files in Luxworks environment") }, \ { "", TARGET_DEFAULT, ""} \ }/* Default target_flags if no switches are specified */#ifndef TARGET_DEFAULT#define TARGET_DEFAULT MASK_REGPARM|MASK_YBASE_HIGH#endif#define TARGET_OPTIONS \{ \ { "text=", &text_seg_name, \ N_("Specify alternate name for text section") }, \ { "data=", &data_seg_name, \ N_("Specify alternate name for data section") }, \ { "bss=", &bss_seg_name, \ N_("Specify alternate name for bss section") }, \ { "const=", &const_seg_name, \ N_("Specify alternate name for constant section") }, \ { "chip=", &chip_name, \ N_("Specify alternate name for dsp16xx chip") }, \}/* 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 override_options ()#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \{ \ flag_gnu_linker = FALSE; \ \ if (LEVEL >= 2) \ { \ /* The dsp16xx family has so few registers \ * that running the first instruction \ * scheduling is bad for reg. allocation \ * since it increases lifetimes of pseudos. \ * So turn of first scheduling pass. \ */ \ flag_schedule_insns = FALSE; \ } \}/* STORAGE LAYOUT *//* Define this if most significant bit is lowest numbered in instructions that operate on numbered bit-fields. */#define BITS_BIG_ENDIAN 0/* Define this if most significant byte of a word is the lowest numbered. We define big-endian, but since the 1600 series cannot address bytes it does not matter. */#define BYTES_BIG_ENDIAN 1/* Define this if most significant word of a multiword number is numbered. For the 1600 we can decide arbitrarily since there are no machine instructions for them. */#define WORDS_BIG_ENDIAN 1/* number of bits in an addressable storage unit */#define BITS_PER_UNIT 16/* Maximum number of bits in a word. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -