📄 m68hc11.h
字号:
/* Definitions of target machine for GNU compiler. Motorola 68HC11 and 68HC12. Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Stephane Carrez (stcarrez@nerim.fr)This file is part of GCC.GCC 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.GCC 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 GCC; see the file COPYING. If not, write tothe Free Software Foundation, 51 Franklin Street, Fifth Floor,Boston, MA 02110-1301, USA.Note: A first 68HC11 port was made by Otto Lind (otto@coactive.com) on gcc 2.6.3. I have used it as a starting point for this port. However, this new port is a complete re-write. Its internal design is completely different. The generated code is not compatible with the gcc 2.6.3 port. The gcc 2.6.3 port is available at: ftp.unina.it/pub/electronics/motorola/68hc11/gcc/gcc-6811-fsf.tar.gz*//********************************************************************************* Controlling the Compilation Driver, `gcc'*******************************************************************************/#undef ENDFILE_SPEC/* Compile and assemble for a 68hc11 unless there is a -m68hc12 option. */#ifndef ASM_SPEC#define ASM_SPEC \"%{m68hc12:-m68hc12}" \"%{m68hcs12:-m68hcs12}" \"%{!m68hc12:%{!m68hcs12:-m68hc11}} " \"%{mshort:-mshort}%{!mshort:-mlong} " \"%{fshort-double:-mshort-double}%{!fshort-double:-mlong-double}"#endif/* We need to tell the linker the target elf format. Just pass an emulation option. This can be overridden by -Wl option of gcc. */#ifndef LINK_SPEC#define LINK_SPEC \"%{m68hc12:-m m68hc12elf}" \"%{m68hcs12:-m m68hc12elf}" \"%{!m68hc12:%{!m68hcs12:-m m68hc11elf}} " \"%{!mnorelax:%{!m68hc12:%{!m68hcs12:-relax}}}"#endif#ifndef LIB_SPEC#define LIB_SPEC ""#endif#ifndef CC1_SPEC#define CC1_SPEC ""#endif#ifndef CPP_SPEC#define CPP_SPEC \"%{mshort:-D__HAVE_SHORT_INT__ -D__INT__=16}\ %{!mshort:-D__INT__=32}\ %{m68hc12:-Dmc6812 -DMC6812 -Dmc68hc12}\ %{m68hcs12:-Dmc6812 -DMC6812 -Dmc68hcs12}\ %{!m68hc12:%{!m68hcs12:-Dmc6811 -DMC6811 -Dmc68hc11}}\ %{fshort-double:-D__HAVE_SHORT_DOUBLE__}\ %{mlong-calls:-D__USE_RTC__}"#endif#undef STARTFILE_SPEC#define STARTFILE_SPEC "crt1%O%s"/* Names to predefine in the preprocessor for this target machine. */#define TARGET_CPU_CPP_BUILTINS() \ do \ { \ builtin_define_std ("mc68hc1x"); \ } \ while (0)/* As an embedded target, we have no libc. */#ifndef inhibit_libc# define inhibit_libc#endif/* Forward type declaration for prototypes definitions. rtx_ptr is equivalent to rtx. Can't use the same name. */struct rtx_def;typedef struct rtx_def *rtx_ptr;union tree_node;typedef union tree_node *tree_ptr;/* We can't declare enum machine_mode forward nor include 'machmode.h' here. Prototypes defined here will use an int instead. It's better than no prototype at all. */typedef int enum_machine_mode;/********************************************************************************* Run-time Target Specification*******************************************************************************//* Run-time compilation parameters selecting different hardware subsets. */extern short *reg_renumber; /* def in local_alloc.c */#define TARGET_OP_TIME (optimize && optimize_size == 0)#define TARGET_RELAX (TARGET_NO_DIRECT_MODE)/* Default target_flags if no switches specified. */#ifndef TARGET_DEFAULT# define TARGET_DEFAULT 0#endif/* Define this macro as a C expression for the initializer of an array of string to tell the driver program which options are defaults for this target and thus do not need to be handled specially when using `MULTILIB_OPTIONS'. */#ifndef MULTILIB_DEFAULTS# if TARGET_DEFAULT & MASK_M6811# define MULTILIB_DEFAULTS { "m68hc11" }# else# define MULTILIB_DEFAULTS { "m68hc12" }# endif#endif/* Print subsidiary information on the compiler version in use. */#define TARGET_VERSION fprintf (stderr, " (MC68HC11/MC68HC12/MC68HCS12)")/* 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 m68hc11_override_options ();/* Define cost parameters for a given processor variant. */struct processor_costs { const int add; /* cost of an add instruction */ const int logical; /* cost of a logical instruction */ const int shift_var; const int shiftQI_const[8]; const int shiftHI_const[16]; const int multQI; const int multHI; const int multSI; const int divQI; const int divHI; const int divSI;};/* Costs for the current processor. */extern const struct processor_costs *m68hc11_cost;/* target machine storage layout *//* Define this if most significant byte of a word is the lowest numbered. */#define BYTES_BIG_ENDIAN 1/* 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 word of a multiword number is numbered. */#define WORDS_BIG_ENDIAN 1/* Width of a word, in units (bytes). */#define UNITS_PER_WORD 2/* Definition of size_t. This is really an unsigned short as the 68hc11 only handles a 64K address space. */#define SIZE_TYPE "short unsigned int"/* A C expression for a string describing the name of the data type to use for the result of subtracting two pointers. The typedef name `ptrdiff_t' is defined using the contents of the string. The 68hc11 only has a 64K address space. */#define PTRDIFF_TYPE "short int"/* Allocation boundary (bits) for storing pointers in memory. */#define POINTER_BOUNDARY 8/* Normal alignment required for function parameters on the stack, in bits. This can't be less than BITS_PER_WORD */#define PARM_BOUNDARY (BITS_PER_WORD)/* Boundary (bits) on which stack pointer should be aligned. */#define STACK_BOUNDARY 8/* Allocation boundary (bits) for the code of a function. */#define FUNCTION_BOUNDARY 8#define BIGGEST_ALIGNMENT 8/* Alignment of field after `int : 0' in a structure. */#define EMPTY_FIELD_BOUNDARY 8/* Every structure's size must be a multiple of this. */#define STRUCTURE_SIZE_BOUNDARY 8/* Define this if instructions will fail to work if given data not on the nominal alignment. If instructions will merely go slower in that case, do not define this macro. */#define STRICT_ALIGNMENT 0/* An integer expression for the size in bits of the largest integer machine mode that should actually be used. All integer machine modes of this size or smaller can be used for structures and unions with the appropriate sizes. */#define MAX_FIXED_MODE_SIZE 64/* target machine storage layout *//* Size (bits) of the type "int" on target machine (If undefined, default is BITS_PER_WORD). */#define INT_TYPE_SIZE (TARGET_SHORT ? 16 : 32)/* Size (bits) of the type "short" on target machine */#define SHORT_TYPE_SIZE 16/* Size (bits) of the type "long" on target machine */#define LONG_TYPE_SIZE 32/* Size (bits) of the type "long long" on target machine */#define LONG_LONG_TYPE_SIZE 64/* A C expression for the size in bits of the type `float' on the target machine. If you don't define this, the default is one word. Don't use default: a word is only 16. */#define FLOAT_TYPE_SIZE 32/* A C expression for the size in bits of the type double on the target machine. If you don't define this, the default is two words. Be IEEE compliant. */#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 0/* Define these to avoid dependence on meaning of `int'. Note that WCHAR_TYPE_SIZE is used in cexp.y, where TARGET_SHORT is not available. */#define WCHAR_TYPE "short int"#define WCHAR_TYPE_SIZE 16/* Standard register usage. */#define HARD_REG_SIZE (UNITS_PER_WORD)/* Assign names to real MC68HC11 registers. A and B registers are not really used (A+B = D) X register is first so that GCC allocates X+D for 32-bit integers and the lowpart of that integer will be D. Having the lower part in D is better for 32<->16bit conversions and for many arithmetic operations. */#define HARD_X_REGNUM 0#define HARD_D_REGNUM 1#define HARD_Y_REGNUM 2#define HARD_SP_REGNUM 3#define HARD_PC_REGNUM 4#define HARD_A_REGNUM 5#define HARD_B_REGNUM 6#define HARD_CCR_REGNUM 7/* The Z register does not really exist in the 68HC11. This a fake register for GCC. It is treated exactly as an index register (X or Y). It is only in the A_REGS class, which is the BASE_REG_CLASS for GCC. Defining this register helps the reload pass of GCC. Otherwise, the reload often dies with register spill failures. The Z register is replaced by either X or Y during the machine specific reorg (m68hc11_reorg). It is saved in the SOFT_Z_REGNUM soft-register when this is necessary. It's possible to tell GCC not to use this register with -ffixed-z. */#define HARD_Z_REGNUM 8/* The frame pointer is a soft-register. It's treated as such by GCC: it is not and must not be part of the BASE_REG_CLASS. */#define DEFAULT_HARD_FP_REGNUM (9)#define HARD_FP_REGNUM (9)#define HARD_AP_REGNUM (HARD_FP_REGNUM)/* Temporary soft-register used in some cases when an operand came up into a bad register class (D, X, Y, SP) and gcc failed to recognize this. This register is never allocated by GCC. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -