📄 mn10200.h
字号:
/* Definitions of target machine for GNU compiler. Matsushita MN10200 series Copyright (C) 1997 Free Software Foundation, Inc. Contributed by Jeff Law (law@cygnus.com).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. */#include "svr4.h"/* Get rid of svr4.h stuff we don't want/need. */#undef ASM_SPEC#undef ASM_FINAL_SPEC#undef LIB_SPEC#undef ENDFILE_SPEC#undef LINK_SPEC#undef STARTFILE_SPEC/* Names to predefine in the preprocessor for this target machine. */#define CPP_PREDEFINES "-D__mn10200__ -D__MN10200__ -D__LONG_MAX__=2147483647L -D__LONG_LONG_MAX__=2147483647L -D__INT_MAX__=32767"/* Run-time compilation parameters selecting different hardware subsets. *//* We don't have any switched on the mn10200. Though there are some things that might be worth a switch: -mspace to optimize even more for space. -mrelax to enable the relaxing linker. */extern int target_flags;/* Macros used in the machine description to test the flags. *//* 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 \ {{ "", TARGET_DEFAULT}}#ifndef TARGET_DEFAULT#define TARGET_DEFAULT 0#endif/* Print subsidiary information on the compiler version in use. */#define TARGET_VERSION fprintf (stderr, " (MN10200)");/* Target machine storage layout *//* Define this if most significant bit is lowest numbered in instructions that operate on numbered bit-fields. This is not true on the Matsushita MN10300. */#define BITS_BIG_ENDIAN 0/* Define this if most significant byte of a word is the lowest numbered. *//* This is not true on the Matsushita MN10200. */#define BYTES_BIG_ENDIAN 0/* Define this if most significant word of a multiword number is lowest numbered. This is not true on the Matsushita MN10200. */#define WORDS_BIG_ENDIAN 0/* 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. This is a white lie. Registers are really 24bits, but most operations only operate on 16 bits. GCC chokes badly if we set this to a value that is not a power of two. */#define BITS_PER_WORD 16/* Width of a word, in units (bytes). */#define UNITS_PER_WORD 2/* Width in bits of a pointer. See also the macro `Pmode' defined below. This differs from Pmode because we need to allocate 32bits of space to hold the 24bit pointers on this machine. */#define POINTER_SIZE 32/* Allocation boundary (in *bits*) for storing arguments in argument list. */#define PARM_BOUNDARY 16/* The stack goes in 16 bit lumps. */#define STACK_BOUNDARY 16/* Allocation boundary (in *bits*) for the code of a function. 8 is the minimum boundary; it's unclear if bigger alignments would improve performance. */#define FUNCTION_BOUNDARY 8/* No data type wants to be aligned rounder than this. */#define BIGGEST_ALIGNMENT 16/* Alignment of field after `int : 0' in a structure. */#define EMPTY_FIELD_BOUNDARY 16/* Seems to be how the Matsushita compiler does things, and there's no real reason to be different. */#define STRUCTURE_SIZE_BOUNDARY 16#undef PCC_BITFIELD_TYPE_MATTERS/* Define this if move instructions will actually fail to work when given unaligned data. */#define STRICT_ALIGNMENT 1/* Define this as 1 if `char' should by default be signed; else as 0. */#define DEFAULT_SIGNED_CHAR 0/* 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, even those that are not normally considered general registers. XXX Long term we should probably expose the MDR register, we use it for division, multiplication, and some extension operations. */#define FIRST_PSEUDO_REGISTER 8/* 1 for registers that have pervasive standard uses and are not available for the register allocator. */#define FIXED_REGISTERS \ { 0, 0, 0, 0, 0, 0, 0, 1}/* 1 for registers not available across function calls. These must include the FIXED_REGISTERS and also any registers that can be used without being saved. The latter must include the registers where values are returned and the register where structure-value addresses are passed. Aside from that, you can include as many other registers as you like. */#define CALL_USED_REGISTERS \ { 1, 1, 0, 0, 1, 0, 0, 1}#define REG_ALLOC_ORDER \ { 0, 1, 4, 2, 3, 5, 6, 7}/* Return number of consecutive hard regs needed starting at reg REGNO to hold something of mode MODE. This is ordinarily the length in words of a value of mode MODE but can be less for certain modes in special long registers. */#define HARD_REGNO_NREGS(REGNO, MODE) \ ((MODE) == PSImode ? 1 : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) \ / UNITS_PER_WORD))/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. We allow any register to hold a PSImode value. We allow any register to hold values <= 16 bits. For values > 16 bits we require aligned register pairs. */#define HARD_REGNO_MODE_OK(REGNO, MODE) \ ((MODE) == PSImode ? 1 : ((REGNO) & 1) == 0 || GET_MODE_SIZE (MODE) <= 2)/* Value is 1 if it is a good idea to tie two pseudo registers when one has mode MODE1 and one has mode MODE2. If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2, for any hard reg, then this must be 0 for correct output. */#define MODES_TIEABLE_P(MODE1, MODE2) \ (MODE1 == MODE2 || (GET_MODE_SIZE (MODE1) <= 2 && GET_MODE_SIZE (MODE2) <= 2))/* 4 data, and effectively 2 address registers is small as far as I'm concerned. Especially since we use 2 data registers for argument passing and return values. We used to define CLASS_LIKELY_SPILLED_P as true for DATA_REGS too, but we've made improvements to the port which greatly reduce register pressure. As a result we no longer need to define CLASS_LIKELY_SPILLED_P for DATA_REGS (and by not defining it we get significantly better code). */#define SMALL_REGISTER_CLASSES 1#define CLASS_LIKELY_SPILLED_P(CLASS) (CLASS == ADDRESS_REGS)/* Define the classes of registers for register constraints in the machine description. Also define ranges of constants. One of the classes must always be named ALL_REGS and include all hard regs. If there is more than one class, another class must be named NO_REGS and contain no registers. The name GENERAL_REGS must be the name of a class (or an alias for another name such as ALL_REGS). This is the class of registers that is allowed by "g" or "r" in a register constraint. Also, registers outside this class are allocated only when instructions express preferences for them. The classes must be numbered in nondecreasing order; that is, a larger-numbered class must never be contained completely in a smaller-numbered class. For any two classes, it is very desirable that there be another class that represents their union. */ enum reg_class { NO_REGS, DATA_REGS, ADDRESS_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES};#define N_REG_CLASSES (int) LIM_REG_CLASSES/* Give names of register classes as strings for dump file. */#define REG_CLASS_NAMES \{ "NO_REGS", "DATA_REGS", "ADDRESS_REGS", \ "GENERAL_REGS", "ALL_REGS", "LIM_REGS" }/* Define which registers fit in which classes. This is an initializer for a vector of HARD_REG_SET of length N_REG_CLASSES. */#define REG_CLASS_CONTENTS \{ 0, /* No regs */ \ 0x0f, /* DATA_REGS */ \ 0xf0, /* ADDRESS_REGS */ \ 0xff, /* GENERAL_REGS */ \ 0xff, /* ALL_REGS */ \}/* The same information, inverted: Return the class number of the smallest class containing reg number REGNO. This could be a conditional expression or could index an array. */#define REGNO_REG_CLASS(REGNO) \ ((REGNO) < 4 ? DATA_REGS : ADDRESS_REGS)/* The class value for index registers, and the one for base regs. */#define INDEX_REG_CLASS DATA_REGS#define BASE_REG_CLASS ADDRESS_REGS/* Get reg_class from a letter such as appears in the machine description. */#define REG_CLASS_FROM_LETTER(C) \ ((C) == 'd' ? DATA_REGS : \ (C) == 'a' ? ADDRESS_REGS : NO_REGS)/* Macros to check register numbers against specific register classes. *//* These assume that REGNO is a hard or pseudo reg number. They give nonzero only if REGNO is a hard reg of the suitable class or a pseudo reg currently allocated to a suitable hard reg. Since they use reg_renumber, they are safe only once reg_renumber has been allocated, which happens in local-alloc.c. */ #define REGNO_OK_FOR_BASE_P(regno) \ (((regno) > 3 && regno < FIRST_PSEUDO_REGISTER) \ || (reg_renumber[regno] > 3 && reg_renumber[regno] < FIRST_PSEUDO_REGISTER))#define REGNO_OK_FOR_INDEX_P(regno) \ (((regno) >= 0 && regno < 4) \ || (reg_renumber[regno] >= 0 && reg_renumber[regno] < 4))/* Given an rtx X being reloaded into a reg required to be in class CLASS, return the class of reg to actually use. In general this is just CLASS; but on some machines in some cases it is preferable to use a more restrictive class. */#define PREFERRED_RELOAD_CLASS(X,CLASS) \ ((GET_MODE (X) != PSImode) ? DATA_REGS : CLASS)/* We want to use DATA_REGS for anything that is not PSImode. */#define LIMIT_RELOAD_CLASS(MODE, CLASS) \ ((MODE != PSImode) ? DATA_REGS : CLASS)/* We have/need secondary reloads on the mn10200. Mostly to deal with problems using address registers. */#define SECONDARY_INPUT_RELOAD_CLASS(CLASS,MODE,IN) \ secondary_reload_class(CLASS,MODE,IN, 1)#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS,MODE,IN) \ secondary_reload_class(CLASS,MODE,IN, 0)/* Return the maximum number of consecutive registers needed to represent mode MODE in a register of class CLASS. */#define CLASS_MAX_NREGS(CLASS, MODE) \ ((MODE) == PSImode ? 1 : (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)/* The letters I, J, K, L, M, N, O, P in a register constraint string can be used to stand for particular ranges of immediate operands. This macro defines what the ranges are. C is the letter, and VALUE is a constant value. Return 1 if VALUE is in the range specified by C. */#define INT_8_BITS(VALUE) ((unsigned) (VALUE) + 0x80 < 0x100)#define INT_16_BITS(VALUE) ((unsigned) (VALUE) + 0x8000 < 0x10000)#define CONST_OK_FOR_I(VALUE) ((VALUE) == 0)#define CONST_OK_FOR_J(VALUE) ((VALUE) >= 1 && (VALUE) <= 3)#define CONST_OK_FOR_K(VALUE) ((VALUE) >= 1 && (VALUE) <= 4)#define CONST_OK_FOR_L(VALUE) ((VALUE) == 15)#define CONST_OK_FOR_M(VALUE) ((VALUE) == 255)#define CONST_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'I' ? CONST_OK_FOR_I (VALUE) : \ (C) == 'J' ? CONST_OK_FOR_J (VALUE) : \ (C) == 'K' ? CONST_OK_FOR_K (VALUE) : \ (C) == 'L' ? CONST_OK_FOR_L (VALUE) : \ (C) == 'M' ? CONST_OK_FOR_M (VALUE) : 0)/* Similar, but for floating constants, and defining letters G and H. Here VALUE is the CONST_DOUBLE rtx itself. `G' is a floating-point zero. */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'G' ? (GET_MODE_CLASS (GET_MODE (VALUE)) == MODE_FLOAT \ && (VALUE) == CONST0_RTX (GET_MODE (VALUE))) \ : 0)/* Stack layout; function entry, exit and calling. *//* Define this if pushing a word on the stack makes the stack pointer a smaller address. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -