📄 sh.h
字号:
extern int assembler_dialect;#define OVERRIDE_OPTIONS \do { \ int regno; \ \ sh_cpu = CPU_SH1; \ assembler_dialect = 0; \ if (TARGET_SH2) \ sh_cpu = CPU_SH2; \ if (TARGET_SH3) \ sh_cpu = CPU_SH3; \ if (TARGET_SH3E) \ sh_cpu = CPU_SH3E; \ if (TARGET_SH4) \ { \ assembler_dialect = 1; \ sh_cpu = CPU_SH4; \ } \ if (TARGET_SH5) \ { \ sh_cpu = CPU_SH5; \ target_flags |= DALIGN_BIT; \ if (TARGET_FPU_ANY) \ target_flags |= FMOVD_BIT; \ if (TARGET_SHMEDIA) \ { \ /* There are no delay slots on SHmedia. */ \ flag_delayed_branch = 0; \ /* Relaxation isn't yet supported for SHmedia */ \ target_flags &= ~RELAX_BIT; \ } \ if (profile_flag || profile_arc_flag) \ { \ warning ("Profiling is not supported on this target."); \ profile_flag = profile_arc_flag = 0; \ } \ } \ else \ { \ /* Only the sh64-elf assembler fully supports .quad properly. */\ targetm.asm_out.aligned_op.di = NULL; \ targetm.asm_out.unaligned_op.di = NULL; \ } \ \ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) \ if (! VALID_REGISTER_P (regno)) \ sh_register_names[regno][0] = '\0'; \ \ for (regno = 0; regno < ADDREGNAMES_SIZE; regno++) \ if (! VALID_REGISTER_P (ADDREGNAMES_REGNO (regno))) \ sh_additional_register_names[regno][0] = '\0'; \ \ if (flag_omit_frame_pointer < 0) \ { \ /* The debugging information is sufficient, \ but gdb doesn't implement this yet */ \ if (0) \ flag_omit_frame_pointer \ = (PREFERRED_DEBUGGING_TYPE == DWARF_DEBUG \ || PREFERRED_DEBUGGING_TYPE == DWARF2_DEBUG); \ else \ flag_omit_frame_pointer = 0; \ } \ \ if (flag_pic && ! TARGET_PREFERGOT) \ flag_no_function_cse = 1; \ \ /* Never run scheduling before reload, since that can \ break global alloc, and generates slower code anyway due \ to the pressure on R0. */ \ flag_schedule_insns = 0; \} while (0)/* Target machine storage layout. *//* Define to use software floating point emulator for REAL_ARITHMETIC and decimal <-> binary conversion. */#define REAL_ARITHMETIC/* 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. */#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 to set the endianness to use in libgcc2.c, which can not depend on target_flags. */#if defined(__LITTLE_ENDIAN__)#define LIBGCC2_WORDS_BIG_ENDIAN 0#else#define LIBGCC2_WORDS_BIG_ENDIAN 1#endif/* 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. */#define BITS_PER_WORD (TARGET_SHMEDIA ? 64 : 32)#define MAX_BITS_PER_WORD 64#define MAX_LONG_TYPE_SIZE MAX_BITS_PER_WORD/* Width in bits of an `int'. We want just 32-bits, even if words are longer. */#define INT_TYPE_SIZE 32/* Width in bits of a `long'. */#define LONG_TYPE_SIZE (TARGET_SHMEDIA64 ? 64 : 32)/* Width in bits of a `long long'. */#define LONG_LONG_TYPE_SIZE 64/* Width in bits of a `long double'. */#define LONG_DOUBLE_TYPE_SIZE 64/* Width of a word, in units (bytes). */#define UNITS_PER_WORD (TARGET_SHMEDIA ? 8 : 4)#define MIN_UNITS_PER_WORD 4/* Width in bits of a pointer. See also the macro `Pmode' defined below. */#define POINTER_SIZE (TARGET_SHMEDIA64 ? 64 : 32)/* Allocation boundary (in *bits*) for storing arguments in argument list. */#define PARM_BOUNDARY (TARGET_SH5 ? 64 : 32)/* Boundary (in *bits*) on which stack pointer should be aligned. */#define STACK_BOUNDARY BIGGEST_ALIGNMENT/* The log (base 2) of the cache line size, in bytes. Processors prior to SH2 have no actual cache, but they fetch code in chunks of 4 bytes. The SH2/3 have 16 byte cache lines, and the SH4 has a 32 byte cache line */#define CACHE_LOG (TARGET_CACHE32 ? 5 : TARGET_SH2 ? 4 : 2)/* Allocation boundary (in *bits*) for the code of a function. 32 bit alignment is faster, because instructions are always fetched as a pair from a longword boundary. */#define FUNCTION_BOUNDARY \ (TARGET_SMALLCODE ? 16 << TARGET_SHMEDIA : (1 << CACHE_LOG) * 8)/* On SH5, the lowest bit is used to indicate SHmedia functions, so the vbit must go into the delta field of pointers-to-member-functions. */#define TARGET_PTRMEMFUNC_VBIT_LOCATION \ (TARGET_SH5 ? ptrmemfunc_vbit_in_delta : ptrmemfunc_vbit_in_pfn)/* Alignment of field after `int : 0' in a structure. */#define EMPTY_FIELD_BOUNDARY 32/* No data type wants to be aligned rounder than this. */#define BIGGEST_ALIGNMENT (TARGET_ALIGN_DOUBLE ? 64 : 32)/* The best alignment to use in cases where we have a choice. */#define FASTEST_ALIGNMENT (TARGET_SH5 ? 64 : 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))#ifndef MAX_OFILE_ALIGNMENT#define MAX_OFILE_ALIGNMENT 128#endif/* 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))/* Number of bits which any structure or union's size must be a multiple of. Each structure or union's size is rounded up to a multiple of this. */#define STRUCTURE_SIZE_BOUNDARY (TARGET_PADSTRUCT ? 32 : 8)/* Set this nonzero if move instructions will actually fail to work when given unaligned data. */#define STRICT_ALIGNMENT 1/* If LABEL_AFTER_BARRIER demands an alignment, return its base 2 logarithm. */#define LABEL_ALIGN_AFTER_BARRIER(LABEL_AFTER_BARRIER) \ barrier_align (LABEL_AFTER_BARRIER)#define LOOP_ALIGN(A_LABEL) \ ((! optimize || TARGET_HARVARD || TARGET_SMALLCODE) \ ? 0 : sh_loop_align (A_LABEL))#define LABEL_ALIGN(A_LABEL) \( \ (PREV_INSN (A_LABEL) \ && GET_CODE (PREV_INSN (A_LABEL)) == INSN \ && GET_CODE (PATTERN (PREV_INSN (A_LABEL))) == UNSPEC_VOLATILE \ && XINT (PATTERN (PREV_INSN (A_LABEL)), 1) == UNSPECV_ALIGN) \ /* explicit alignment insn in constant tables. */ \ ? INTVAL (XVECEXP (PATTERN (PREV_INSN (A_LABEL)), 0, 0)) \ : 0)/* Jump tables must be 32 bit aligned, no matter the size of the element. */#define ADDR_VEC_ALIGN(ADDR_VEC) 2/* The base two logarithm of the known minimum alignment of an insn length. */#define INSN_LENGTH_ALIGNMENT(A_INSN) \ (GET_CODE (A_INSN) == INSN \ ? 1 << TARGET_SHMEDIA \ : GET_CODE (A_INSN) == JUMP_INSN || GET_CODE (A_INSN) == CALL_INSN \ ? 1 << TARGET_SHMEDIA \ : CACHE_LOG)/* Standard register usage. *//* Register allocation for the Hitachi calling convention: r0 arg return r1..r3 scratch r4..r7 args in r8..r13 call saved r14 frame pointer/call saved r15 stack pointer ap arg pointer (doesn't really exist, always eliminated) pr subroutine return address t t bit mach multiply/accumulate result, high part macl multiply/accumulate result, low part. fpul fp/int communication register rap return address pointer register fr0 fp arg return fr1..fr3 scratch floating point registers fr4..fr11 fp args in fr12..fr15 call saved floating point registers */#define MAX_REGISTER_NAME_LENGTH 5extern char sh_register_names[][MAX_REGISTER_NAME_LENGTH + 1];#define SH_REGISTER_NAMES_INITIALIZER \{ \ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \ "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", \ "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", \ "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", \ "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", \ "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47", \ "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55", \ "r56", "r57", "r58", "r59", "r60", "r61", "r62", "r63", \ "fr0", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", \ "fr8", "fr9", "fr10", "fr11", "fr12", "fr13", "fr14", "fr15", \ "fr16", "fr17", "fr18", "fr19", "fr20", "fr21", "fr22", "fr23", \ "fr24", "fr25", "fr26", "fr27", "fr28", "fr29", "fr30", "fr31", \ "fr32", "fr33", "fr34", "fr35", "fr36", "fr37", "fr38", "fr39", \ "fr40", "fr41", "fr42", "fr43", "fr44", "fr45", "fr46", "fr47", \ "fr48", "fr49", "fr50", "fr51", "fr52", "fr53", "fr54", "fr55", \ "fr56", "fr57", "fr58", "fr59", "fr60", "fr61", "fr62", "fr63", \ "tr0", "tr1", "tr2", "tr3", "tr4", "tr5", "tr6", "tr7", \ "xd0", "xd2", "xd4", "xd6", "xd8", "xd10", "xd12", "xd14", \ "gbr", "ap", "pr", "t", "mach", "macl", "fpul", "fpscr", \ "rap" \}#define DEBUG_REGISTER_NAMES SH_REGISTER_NAMES_INITIALIZER#define REGNAMES_ARR_INDEX_1(index) \ (sh_register_names[index])#define REGNAMES_ARR_INDEX_2(index) \ REGNAMES_ARR_INDEX_1 ((index)), REGNAMES_ARR_INDEX_1 ((index)+1)#define REGNAMES_ARR_INDEX_4(index) \ REGNAMES_ARR_INDEX_2 ((index)), REGNAMES_ARR_INDEX_2 ((index)+2)#define REGNAMES_ARR_INDEX_8(index) \ REGNAMES_ARR_INDEX_4 ((index)), REGNAMES_ARR_INDEX_4 ((index)+4)#define REGNAMES_ARR_INDEX_16(index) \ REGNAMES_ARR_INDEX_8 ((index)), REGNAMES_ARR_INDEX_8 ((index)+8)#define REGNAMES_ARR_INDEX_32(index) \ REGNAMES_ARR_INDEX_16 ((index)), REGNAMES_ARR_INDEX_16 ((index)+16)#define REGNAMES_ARR_INDEX_64(index) \ REGNAMES_ARR_INDEX_32 ((index)), REGNAMES_ARR_INDEX_32 ((index)+32)#define REGISTER_NAMES \{ \ REGNAMES_ARR_INDEX_64 (0), \ REGNAMES_ARR_INDEX_64 (64), \ REGNAMES_ARR_INDEX_8 (128), \ REGNAMES_ARR_INDEX_8 (136), \ REGNAMES_ARR_INDEX_8 (144), \ REGNAMES_ARR_INDEX_1 (152) \}#define ADDREGNAMES_SIZE 32#define MAX_ADDITIONAL_REGISTER_NAME_LENGTH 4extern char sh_additional_register_names[ADDREGNAMES_SIZE] \ [MAX_ADDITIONAL_REGISTER_NAME_LENGTH + 1];#define SH_ADDITIONAL_REGISTER_NAMES_INITIALIZER \{ \ "dr0", "dr2", "dr4", "dr6", "dr8", "dr10", "dr12", "dr14", \ "dr16", "dr18", "dr20", "dr22", "dr24", "dr26", "dr28", "dr30", \ "dr32", "dr34", "dr36", "dr38", "dr40", "dr42", "dr44", "dr46", \ "dr48", "dr50", "dr52", "dr54", "dr56", "dr58", "dr60", "dr62" \}#define ADDREGNAMES_REGNO(index) \ ((index < 32) ? (FIRST_FP_REG + (index) * 2) \ : (-1))#define ADDREGNAMES_ARR_INDEX_1(index) \ { (sh_additional_register_names[index]), ADDREGNAMES_REGNO (index) }#define ADDREGNAMES_ARR_INDEX_2(index) \ ADDREGNAMES_ARR_INDEX_1 ((index)), ADDREGNAMES_ARR_INDEX_1 ((index)+1)#define ADDREGNAMES_ARR_INDEX_4(index) \ ADDREGNAMES_ARR_INDEX_2 ((index)), ADDREGNAMES_ARR_INDEX_2 ((index)+2)#define ADDREGNAMES_ARR_INDEX_8(index) \ ADDREGNAMES_ARR_INDEX_4 ((index)), ADDREGNAMES_ARR_INDEX_4 ((index)+4)#define ADDREGNAMES_ARR_INDEX_16(index) \ ADDREGNAMES_ARR_INDEX_8 ((index)), ADDREGNAMES_ARR_INDEX_8 ((index)+8)#define ADDREGNAMES_ARR_INDEX_32(index) \ ADDREGNAMES_ARR_INDEX_16 ((index)), ADDREGNAMES_ARR_INDEX_16 ((index)+16)#define ADDITIONAL_REGISTER_NAMES \{ \ ADDREGNAMES_ARR_INDEX_32 (0) \}/* Number of actual hardware registers. The hardware registers are assigned numbers for the compiler
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -