📄 m32r.h
字号:
/* The default is the small model. */#ifndef M32R_MODEL_DEFAULT#define M32R_MODEL_DEFAULT "small"#endif/* Small Data Area The SDA consists of sections .sdata, .sbss, and .scommon. .scommon isn't a real section, symbols in it have their section index set to SHN_M32R_SCOMMON, though support for it exists in the linker script. Two switches control the SDA: -G NNN - specifies the maximum size of variable to go in the SDA -msdata=foo - specifies how such variables are handled -msdata=none - small data area is disabled -msdata=sdata - small data goes in the SDA, special code isn't generated to use it, and special relocs aren't generated -msdata=use - small data goes in the SDA, special code is generated to use the SDA and special relocs are generated The SDA is not multilib'd, it isn't necessary. MULTILIB_EXTRA_OPTS is set in tmake_file to -msdata=sdata so multilib'd libraries have small data in .sdata/SHN_M32R_SCOMMON so programs that use -msdata=use will successfully link with them (references in header files will cause the compiler to emit code that refers to library objects in .data). ??? There can be a problem if the user passes a -G value greater than the default and a library object in a header file is that size. The default is 8 so this should be rare - if it occurs the user is required to rebuild the libraries or use a smaller value for -G. *//* Maximum size of variables that go in .sdata/.sbss. The -msdata=foo switch also controls how small variables are handled. */#ifndef SDATA_DEFAULT_SIZE#define SDATA_DEFAULT_SIZE 8#endifenum m32r_sdata { M32R_SDATA_NONE, M32R_SDATA_SDATA, M32R_SDATA_USE };extern enum m32r_sdata m32r_sdata;#define TARGET_SDATA_NONE (m32r_sdata == M32R_SDATA_NONE)#define TARGET_SDATA_SDATA (m32r_sdata == M32R_SDATA_SDATA)#define TARGET_SDATA_USE (m32r_sdata == M32R_SDATA_USE)/* Default is to disable the SDA [for upward compatibility with previous toolchains]. */#ifndef M32R_SDATA_DEFAULT#define M32R_SDATA_DEFAULT "none"#endif/* Define this macro as a C expression for the initializer of an array of strings 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 SUBTARGET_MULTILIB_DEFAULTS#define SUBTARGET_MULTILIB_DEFAULTS#endif#ifndef MULTILIB_DEFAULTS#define MULTILIB_DEFAULTS { "mmodel=small" SUBTARGET_MULTILIB_DEFAULTS }#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. Don't use this macro to turn on various extra optimizations for `-O'. That is what `OPTIMIZATION_OPTIONS' is for. */#ifndef SUBTARGET_OVERRIDE_OPTIONS#define SUBTARGET_OVERRIDE_OPTIONS#endif#define OVERRIDE_OPTIONS \ do \ { \ /* These need to be done at start up. \ It's convenient to do them here. */ \ m32r_init (); \ SUBTARGET_OVERRIDE_OPTIONS \ } \ while (0)#ifndef SUBTARGET_OPTIMIZATION_OPTIONS#define SUBTARGET_OPTIMIZATION_OPTIONS#endif#define OPTIMIZATION_OPTIONS(LEVEL, SIZE) \ do \ { \ if (LEVEL == 1) \ flag_regmove = TRUE; \ \ if (SIZE) \ { \ flag_omit_frame_pointer = TRUE; \ flag_strength_reduce = FALSE; \ } \ \ SUBTARGET_OPTIMIZATION_OPTIONS \ } \ while (0)/* Define this macro if debugging can be performed even without a frame pointer. If this macro is defined, GCC will turn on the `-fomit-frame-pointer' option whenever `-O' is specified. */#define CAN_DEBUG_WITHOUT_FP/* Target machine storage layout. *//* Define this if most significant bit is lowest numbered in instructions that operate on numbered bit-fields. */#define BITS_BIG_ENDIAN 1/* Define this if most significant byte of a word is the lowest numbered. */#define BYTES_BIG_ENDIAN (TARGET_LITTLE_ENDIAN == 0)/* Define this if most significant word of a multiword number is the lowest numbered. */#define WORDS_BIG_ENDIAN (TARGET_LITTLE_ENDIAN == 0)/* Define this macro if WORDS_BIG_ENDIAN is not constant. This must be a constant value with the same meaning as WORDS_BIG_ENDIAN, which will be used only when compiling libgcc2.c. Typically the value will be set based on preprocessor defines. *//*#define LIBGCC2_WORDS_BIG_ENDIAN 1*//* Width of a word, in units (bytes). */#define UNITS_PER_WORD 4/* Define this macro if it is advisable to hold scalars in registers in a wider mode than that declared by the program. In such cases, the value is constrained to be within the bounds of the declared type, but kept valid in the wider mode. The signedness of the extension may differ from that of the type. */#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \ if (GET_MODE_CLASS (MODE) == MODE_INT \ && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \ { \ (MODE) = SImode; \ }/* Allocation boundary (in *bits*) for storing arguments in argument list. */#define PARM_BOUNDARY 32/* Boundary (in *bits*) on which stack pointer should be aligned. */#define STACK_BOUNDARY 32/* ALIGN FRAMES on word boundaries */#define M32R_STACK_ALIGN(LOC) (((LOC) + 3) & ~ 3)/* Allocation boundary (in *bits*) for the code of a function. */#define FUNCTION_BOUNDARY 32/* Alignment of field after `int : 0' in a structure. */#define EMPTY_FIELD_BOUNDARY 32/* Every structure's size must be a multiple of this. */#define STRUCTURE_SIZE_BOUNDARY 8/* A bit-field declared as `int' forces `int' alignment for the struct. */#define PCC_BITFIELD_TYPE_MATTERS 1/* No data type wants to be aligned rounder than this. */#define BIGGEST_ALIGNMENT 32/* The best alignment to use in cases where we have a choice. */#define FASTEST_ALIGNMENT 32/* Make strings word-aligned so strcpy from constants will be faster. */#define CONSTANT_ALIGNMENT(EXP, ALIGN) \ ((TREE_CODE (EXP) == STRING_CST \ && (ALIGN) < FASTEST_ALIGNMENT) \ ? FASTEST_ALIGNMENT : (ALIGN))/* Make arrays of chars word-aligned for the same reasons. */#define DATA_ALIGNMENT(TYPE, ALIGN) \ (TREE_CODE (TYPE) == ARRAY_TYPE \ && TYPE_MODE (TREE_TYPE (TYPE)) == QImode \ && (ALIGN) < FASTEST_ALIGNMENT ? FASTEST_ALIGNMENT : (ALIGN))/* Set this nonzero if move instructions will actually fail to work when given unaligned data. */#define STRICT_ALIGNMENT 1/* Define LAVEL_ALIGN to calculate code length of PNOP at labels. */#define LABEL_ALIGN(insn) 2/* Layout of source language data types. */#define SHORT_TYPE_SIZE 16#define INT_TYPE_SIZE 32#define LONG_TYPE_SIZE 32#define LONG_LONG_TYPE_SIZE 64#define FLOAT_TYPE_SIZE 32#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 1#define SIZE_TYPE "long unsigned int"#define PTRDIFF_TYPE "long int"#define WCHAR_TYPE "short unsigned int"#define WCHAR_TYPE_SIZE 16/* 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. */#define M32R_NUM_REGISTERS 19#ifndef SUBTARGET_NUM_REGISTERS#define SUBTARGET_NUM_REGISTERS 0#endif#define FIRST_PSEUDO_REGISTER (M32R_NUM_REGISTERS + SUBTARGET_NUM_REGISTERS) /* 1 for registers that have pervasive standard uses and are not available for the register allocator. 0-3 - arguments/results 4-5 - call used [4 is used as a tmp during prologue/epilogue generation] 6 - call used, gptmp 7 - call used, static chain pointer 8-11 - call saved 12 - call saved [reserved for global pointer] 13 - frame pointer 14 - subroutine link register 15 - stack pointer 16 - arg pointer 17 - carry flag 18 - accumulator 19 - accumulator 1 in the m32r/x By default, the extension registers are not available. */#ifndef SUBTARGET_FIXED_REGISTERS#define SUBTARGET_FIXED_REGISTERS#endif#define FIXED_REGISTERS \{ \ 0, 0, 0, 0, 0, 0, 0, 0, \ 0, 0, 0, 0, 0, 0, 0, 1, \ 1, 1, 1 \ SUBTARGET_FIXED_REGISTERS \}/* 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. */#ifndef SUBTARGET_CALL_USED_REGISTERS#define SUBTARGET_CALL_USED_REGISTERS#endif#define CALL_USED_REGISTERS \{ \ 1, 1, 1, 1, 1, 1, 1, 1, \ 0, 0, 0, 0, 0, 0, 1, 1, \ 1, 1, 1 \ SUBTARGET_CALL_USED_REGISTERS \}#define CALL_REALLY_USED_REGISTERS CALL_USED_REGISTERS/* Zero or more C statements that may conditionally modify two variables `fixed_regs' and `call_used_regs' (both of type `char []') after they have been initialized from the two preceding macros. This is necessary in case the fixed or call-clobbered registers depend on target flags. You need not define this macro if it has no work to do. */#ifdef SUBTARGET_CONDITIONAL_REGISTER_USAGE#define CONDITIONAL_REGISTER_USAGE SUBTARGET_CONDITIONAL_REGISTER_USAGE#else#define CONDITIONAL_REGISTER_USAGE \ do \ { \ if (flag_pic) \ { \ fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \ } \ } \ while (0)#endif/* If defined, an initializer for a vector of integers, containing the numbers of hard registers in the order in which GCC should prefer to use them (from most preferred to least). */#ifndef SUBTARGET_REG_ALLOC_ORDER#define SUBTARGET_REG_ALLOC_ORDER#endif#if 1 /* Better for int code. */#define REG_ALLOC_ORDER \{ \ 4, 5, 6, 7, 2, 3, 8, 9, 10, \ 11, 12, 13, 14, 0, 1, 15, 16, 17, 18 \ SUBTARGET_REG_ALLOC_ORDER \}#else /* Better for fp code at expense of int code. */#define REG_ALLOC_ORDER \{ \ 0, 1, 2, 3, 4, 5, 6, 7, 8, \ 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 \ SUBTARGET_REG_ALLOC_ORDER \}#endif/* 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) \ ((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. */extern const unsigned int m32r_hard_regno_mode_ok[FIRST_PSEUDO_REGISTER];extern unsigned int m32r_mode_class[];#define HARD_REGNO_MODE_OK(REGNO, MODE) \ ((m32r_hard_regno_mode_ok[REGNO] & m32r_mode_class[MODE]) != 0)/* A C expression that is nonzero if it is desirable to choose register allocation so as to avoid move instructions between a value of mode MODE1 and a value of mode MODE2. If `HARD_REGNO_MODE_OK (R, MODE1)' and `HARD_REGNO_MODE_OK (R, MODE2)' are ever different for any R, then `MODES_TIEABLE_P (MODE1, MODE2)' must be zero. *//* Tie QI/HI/SI modes together. */#define MODES_TIEABLE_P(MODE1, MODE2) \ ( GET_MODE_CLASS (MODE1) == MODE_INT \ && GET_MODE_CLASS (MODE2) == MODE_INT \ && GET_MODE_SIZE (MODE1) <= UNITS_PER_WORD \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -