📄 bfin.h
字号:
#define BITS_BIG_ENDIAN 0/* Define this if most significant byte of a word is the lowest numbered. We can't access bytes but if we could we would in the Big Endian order. */#define BYTES_BIG_ENDIAN 0/* Define this if most significant word of a multiword number is numbered. */#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. */#define BITS_PER_WORD 32/* Width of a word, in units (bytes). */#define UNITS_PER_WORD 4/* Size of a vector for autovectorization. */#define UNITS_PER_SIMD_WORD 4/* Width in bits of a pointer. See also the macro `Pmode1' defined below. */#define POINTER_SIZE 32/* Allocation boundary (in *bits*) for storing pointers in memory. */#define POINTER_BOUNDARY 32/* 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/* 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 BITS_PER_WORD/* No data type wants to be aligned rounder than this. */#define BIGGEST_ALIGNMENT 32/* Define this if move instructions will actually fail to work when given unaligned data. */#define STRICT_ALIGNMENT 1/* (shell-command "rm c-decl.o stor-layout.o") * never define PCC_BITFIELD_TYPE_MATTERS * really cause some alignment problem */#define UNITS_PER_FLOAT ((FLOAT_TYPE_SIZE + BITS_PER_UNIT - 1) / \ BITS_PER_UNIT)#define UNITS_PER_DOUBLE ((DOUBLE_TYPE_SIZE + BITS_PER_UNIT - 1) / \ BITS_PER_UNIT)/* what is the 'type' of size_t */#define SIZE_TYPE "long unsigned int"/* Define this as 1 if `char' should by default be signed; else as 0. */#define DEFAULT_SIGNED_CHAR 1#define FLOAT_TYPE_SIZE BITS_PER_WORD#define SHORT_TYPE_SIZE 16 #define CHAR_TYPE_SIZE 8#define INT_TYPE_SIZE 32#define LONG_TYPE_SIZE 32#define LONG_LONG_TYPE_SIZE 64 /* Note: Fix this to depend on target switch. -- lev *//* Note: Try to implement double and force long double. -- tonyko * #define __DOUBLES_ARE_FLOATS__ * #define DOUBLE_TYPE_SIZE FLOAT_TYPE_SIZE * #define LONG_DOUBLE_TYPE_SIZE DOUBLE_TYPE_SIZE * #define DOUBLES_ARE_FLOATS 1 */#define DOUBLE_TYPE_SIZE 64#define LONG_DOUBLE_TYPE_SIZE 64/* `PROMOTE_MODE (M, UNSIGNEDP, TYPE)' A macro to update M and UNSIGNEDP when an object whose type is TYPE and which has the specified mode and signedness is to be stored in a register. This macro is only called when TYPE is a scalar type. On most RISC machines, which only have operations that operate on a full register, define this macro to set M to `word_mode' if M is an integer mode narrower than `BITS_PER_WORD'. In most cases, only integer modes should be widened because wider-precision floating-point operations are usually more expensive than their narrower counterparts. For most machines, the macro definition does not change UNSIGNEDP. However, some machines, have instructions that preferentially handle either signed or unsigned quantities of certain modes. For example, on the DEC Alpha, 32-bit loads from memory and 32-bit add instructions sign-extend the result to 64 bits. On such machines, set UNSIGNEDP according to which kind of extension is more efficient. Do not define this macro if it would never modify M.*/#define BFIN_PROMOTE_MODE_P(MODE) \ (!TARGET_DSP && GET_MODE_CLASS (MODE) == MODE_INT \ && GET_MODE_SIZE (MODE) < UNITS_PER_WORD)#define PROMOTE_MODE(MODE, UNSIGNEDP, TYPE) \ if (BFIN_PROMOTE_MODE_P(MODE)) \ { \ if (MODE == QImode) \ UNSIGNEDP = 1; \ else if (MODE == HImode) \ UNSIGNEDP = 0; \ (MODE) = SImode; \ }/* Describing Relative Costs of Operations *//* Do not put function addr into constant pool */#define NO_FUNCTION_CSE 1/* A C expression for the cost of moving data from a register in class FROM to one in class TO. The classes are expressed using the enumeration values such as `GENERAL_REGS'. A value of 2 is the default; other values are interpreted relative to that. It is not required that the cost always equal 2 when FROM is the same as TO; on some machines it is expensive to move between registers if they are not general registers. */#define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \ bfin_register_move_cost ((MODE), (CLASS1), (CLASS2))/* A C expression for the cost of moving data of mode M between a register and memory. A value of 2 is the default; this cost is relative to those in `REGISTER_MOVE_COST'. If moving between registers and memory is more expensive than between two registers, you should define this macro to express the relative cost. */#define MEMORY_MOVE_COST(MODE, CLASS, IN) \ bfin_memory_move_cost ((MODE), (CLASS), (IN))/* Specify the machine mode that this machine uses for the index in the tablejump instruction. */#define CASE_VECTOR_MODE SImode#define JUMP_TABLES_IN_TEXT_SECTION flag_pic/* Define if operations between registers always perform the operation on the full register even if a narrower mode is specified. #define WORD_REGISTER_OPERATIONS*/#define CONST_18UBIT_IMM_P(VALUE) ((VALUE) >= 0 && (VALUE) <= 262140)#define CONST_16BIT_IMM_P(VALUE) ((VALUE) >= -32768 && (VALUE) <= 32767)#define CONST_16UBIT_IMM_P(VALUE) ((VALUE) >= 0 && (VALUE) <= 65535)#define CONST_7BIT_IMM_P(VALUE) ((VALUE) >= -64 && (VALUE) <= 63)#define CONST_7NBIT_IMM_P(VALUE) ((VALUE) >= -64 && (VALUE) <= 0)#define CONST_5UBIT_IMM_P(VALUE) ((VALUE) >= 0 && (VALUE) <= 31)#define CONST_4BIT_IMM_P(VALUE) ((VALUE) >= -8 && (VALUE) <= 7)#define CONST_4UBIT_IMM_P(VALUE) ((VALUE) >= 0 && (VALUE) <= 15)#define CONST_3BIT_IMM_P(VALUE) ((VALUE) >= -4 && (VALUE) <= 3)#define CONST_3UBIT_IMM_P(VALUE) ((VALUE) >= 0 && (VALUE) <= 7)#define CONSTRAINT_LEN(C, STR) \ ((C) == 'P' || (C) == 'M' || (C) == 'N' ? 2 \ : (C) == 'K' ? 3 \ : DEFAULT_CONSTRAINT_LEN ((C), (STR)))#define CONST_OK_FOR_P(VALUE, STR) \ ((STR)[1] == '0' ? (VALUE) == 0 \ : (STR)[1] == '1' ? (VALUE) == 1 \ : (STR)[1] == '2' ? (VALUE) == 2 \ : (STR)[1] == '3' ? (VALUE) == 3 \ : (STR)[1] == '4' ? (VALUE) == 4 \ : 0)#define CONST_OK_FOR_K(VALUE, STR) \ ((STR)[1] == 'u' \ ? ((STR)[2] == '3' ? CONST_3UBIT_IMM_P (VALUE) \ : (STR)[2] == '4' ? CONST_4UBIT_IMM_P (VALUE) \ : (STR)[2] == '5' ? CONST_5UBIT_IMM_P (VALUE) \ : (STR)[2] == 'h' ? CONST_16UBIT_IMM_P (VALUE) \ : 0) \ : (STR)[1] == 's' \ ? ((STR)[2] == '3' ? CONST_3BIT_IMM_P (VALUE) \ : (STR)[2] == '4' ? CONST_4BIT_IMM_P (VALUE) \ : (STR)[2] == '7' ? CONST_7BIT_IMM_P (VALUE) \ : (STR)[2] == 'h' ? CONST_16BIT_IMM_P (VALUE) \ : 0) \ : (STR)[1] == 'n' \ ? ((STR)[2] == '7' ? CONST_7NBIT_IMM_P (VALUE) \ : 0) \ : 0)#define CONST_OK_FOR_M(VALUE, STR) \ ((STR)[1] == '1' ? (VALUE) == 255 \ : (STR)[1] == '2' ? (VALUE) == 65535 \ : 0)/* The letters I, J, K, L and M 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. bfin constant operands are as follows J 2**N 5bit imm scaled Ks7 -64 .. 63 signed 7bit imm Ku5 0..31 unsigned 5bit imm Ks4 -8 .. 7 signed 4bit imm Ks3 -4 .. 3 signed 3bit imm Ku3 0 .. 7 unsigned 3bit imm Pn 0, 1, 2 constants 0, 1 or 2, corresponding to n*/#define CONST_OK_FOR_CONSTRAINT_P(VALUE, C, STR) \ ((C) == 'J' ? (log2constp (VALUE)) \ : (C) == 'K' ? CONST_OK_FOR_K (VALUE, STR) \ : (C) == 'L' ? log2constp (~(VALUE)) \ : (C) == 'M' ? CONST_OK_FOR_M (VALUE, STR) \ : (C) == 'P' ? CONST_OK_FOR_P (VALUE, STR) \ : 0) /*Constant Output Formats */#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ ((C) == 'H' ? 1 : 0)#define EXTRA_CONSTRAINT(VALUE, D) \ ((D) == 'Q' ? GET_CODE (VALUE) == SYMBOL_REF : 0)/* `FINALIZE_PIC' By generating position-independent code, when two different programs (A and B) share a common library (libC.a), the text of the library can be shared whether or not the library is linked at the same address for both programs. In some of these environments, position-independent code requires not only the use of different addressing modes, but also special code to enable the use of these addressing modes. The `FINALIZE_PIC' macro serves as a hook to emit these special codes once the function is being compiled into assembly code, but not before. (It is not done before, because in the case of compiling an inline function, it would lead to multiple PIC prologues being included in functions which used inline functions and were compiled to assembly language.) */#define FINALIZE_PIC do {} while (0)/* Switch into a generic section. */#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section#define PRINT_OPERAND(FILE, RTX, CODE) print_operand (FILE, RTX, CODE)#define PRINT_OPERAND_ADDRESS(FILE, RTX) print_address_operand (FILE, RTX)typedef enum sections { CODE_DIR, DATA_DIR, LAST_SECT_NM} SECT_ENUM_T;typedef enum directives { LONG_CONST_DIR, SHORT_CONST_DIR, BYTE_CONST_DIR, SPACE_DIR, INIT_DIR, LAST_DIR_NM} DIR_ENUM_T;#define TEXT_SECTION_ASM_OP ".text;"#define DATA_SECTION_ASM_OP ".data;"#define ASM_APP_ON ""#define ASM_APP_OFF ""#define ASM_GLOBALIZE_LABEL1(FILE, NAME) \ do { fputs (".global ", FILE); \ assemble_name (FILE, NAME); \ fputc (';',FILE); \ fputc ('\n',FILE); \ } while (0)#define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \ do { \ fputs (".type ", FILE); \ assemble_name (FILE, NAME); \ fputs (", STT_FUNC", FILE); \ fputc (';',FILE); \ fputc ('\n',FILE); \ ASM_OUTPUT_LABEL(FILE, NAME); \ } while (0)#define ASM_OUTPUT_LABEL(FILE, NAME) \ do { assemble_name (FILE, NAME); \ fputs (":\n",FILE); \ } while (0)#define ASM_OUTPUT_LABELREF(FILE,NAME) \ do { fprintf (FILE, "_%s", NAME); \ } while (0)#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ do { \ int len = strlen (NAME); \ char *temp = (char *) alloca (len + 4); \ temp[0] = 'L'; \ temp[1] = '_'; \ strcpy (&temp[2], (NAME)); \ temp[len + 2] = '_'; \ temp[len + 3] = 0; \ (OUTPUT) = (char *) alloca (strlen (NAME) + 13); \ sprintf (OUTPUT, "_%s$%d", temp, LABELNO); \ } while (0)#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \do { char __buf[256]; \ fprintf (FILE, "\t.dd\t"); \ ASM_GENERATE_INTERNAL_LABEL (__buf, "L", VALUE); \ assemble_name (FILE, __buf); \ fputc (';', FILE); \ fputc ('\n', FILE); \ } while (0)#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ MY_ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)#define MY_ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \ do { \ char __buf[256]; \ fprintf (FILE, "\t.dd\t"); \ ASM_GENERATE_INTERNAL_LABEL (__buf, "L", VALUE); \ assemble_name (FILE, __buf); \ fputs (" - ", FILE); \ ASM_GENERATE_INTERNAL_LABEL (__buf, "L", REL); \ assemble_name (FILE, __buf); \ fputc (';', FILE); \ fputc ('\n', FILE); \ } while (0)#define ASM_OUTPUT_ALIGN(FILE,LOG) \ do { \ fprintf (FILE, ".align %d\n", LOG); \ } while (0)#define ASM_OUTPUT_SKIP(FILE,SIZE) \ do { \ asm_output_skip (FILE, SIZE); \ } while (0)#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \do { \ data_section(); \ if ((SIZE) >= (unsigned int) 4 ) ASM_OUTPUT_ALIGN(FILE,2); \ ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, SIZE); \ ASM_OUTPUT_LABEL (FILE, NAME); \ fprintf (FILE, "%s %ld;\n", ASM_SPACE, \ (ROUNDED) > (unsigned int) 1 ? (ROUNDED) : 1); \} while (0)#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ do { \ ASM_GLOBALIZE_LABEL1(FILE,NAME); \ ASM_OUTPUT_LOCAL (FILE, NAME, SIZE, ROUNDED); } while(0)#define ASM_COMMENT_START "//"#define FUNCTION_PROFILER(FILE, LABELNO) \ do {\ fprintf (FILE, "\tP1.l =LP$%d; P1.h =LP$%d; call mcount;\n", \ LABELNO, LABELNO);\ } while(0)#define ASM_OUTPUT_REG_PUSH(FILE, REGNO) fprintf (FILE, "[SP--] = %s;\n", reg_names[REGNO])#define ASM_OUTPUT_REG_POP(FILE, REGNO) fprintf (FILE, "%s = [SP++];\n", reg_names[REGNO])extern struct rtx_def *bfin_compare_op0, *bfin_compare_op1;extern struct rtx_def *bfin_cc_rtx, *bfin_rets_rtx;/* This works for GAS and some other assemblers. */#define SET_ASM_OP ".set "/* Don't know how to order these. UNALIGNED_WORD_ASM_OP is in dwarf2.out. */#define UNALIGNED_WORD_ASM_OP ".4byte"/* DBX register number for a given compiler register number */#define DBX_REGISTER_NUMBER(REGNO) (REGNO) #define SIZE_ASM_OP "\t.size\t"#endif /* _BFIN_CONFIG */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -