⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c4x.h

📁 linux下的gcc编译器
💻 H
📖 第 1 页 / 共 5 页
字号:
/* Compute the cost of computing a constant rtl expression RTX   whose rtx-code is CODE.  The body of this macro is a portion   of a switch statement.  If the code is computed here,   return it with a return statement.  Otherwise, break from the switch.   An insn is assumed to cost 4 units.   COSTS_N_INSNS (N) is defined as (N) * 4 - 2.   Some small integers are effectively free for the C40.  We should   also consider if we are using the small memory model.  With   the big memory model we require an extra insn for a constant   loaded from memory.     This is used by expand_binop to decide whether to force a constant   into a register.  If the cost is greater than 2 and the constant   is used within a short loop, it gets forced into a register.     Ideally, there should be some weighting as to how mnay times it is used   within the loop.  */#define SHIFT_CODE_P(C) ((C) == ASHIFT || (C) == ASHIFTRT || (C) == LSHIFTRT)#define LOGICAL_CODE_P(C) ((C) == NOT || (C) == AND \                           || (C) == IOR || (C) == XOR)#define NON_COMMUTATIVE_CODE_P ((C) == MINUS || (C) == COMPARE)#define CONST_COSTS(RTX,CODE,OUTER_CODE)			\	case CONST_INT:						\           if (c4x_J_constant (RTX))				\	     return 0;						\	   if (! TARGET_C3X					\	       && OUTER_CODE == AND				\               && GET_CODE (RTX) == CONST_INT			\	       && (INTVAL (RTX) == 255 || INTVAL (RTX) == 65535))	\	     return 0;						\	   if (! TARGET_C3X					\	       && (OUTER_CODE == ASHIFTRT || OUTER_CODE == LSHIFTRT)	\               && GET_CODE (RTX) == CONST_INT			\	       && (INTVAL (RTX) == 16 || INTVAL (RTX) == 24))	\	     return 0;						\           if (TARGET_C3X && SHIFT_CODE_P (OUTER_CODE))		\	     return 3;						\           if (LOGICAL_CODE_P (OUTER_CODE) 			\               ? c4x_L_constant (RTX) : c4x_I_constant (RTX))	\	     return 2;						\	case CONST:						\	case LABEL_REF:						\	case SYMBOL_REF:					\	   return 4;						\	case CONST_DOUBLE:					\	   if (c4x_H_constant (RTX))				\	     return 2;						\           if (GET_MODE (RTX) == QFmode)			\	     return 4;						\           else							\	     return 8;/* Compute the cost of an address.  This is meant to approximate the size   and/or execution delay of an insn using that address.  If the cost is   approximated by the RTL complexity, including CONST_COSTS above, as   is usually the case for CISC machines, this macro should not be defined.   For aggressively RISCy machines, only one insn format is allowed, so   this macro should be a constant.  The value of this macro only matters   for valid addresses.  We handle the most common address without    a call to c4x_address_cost.  */#define ADDRESS_COST(ADDR) (REG_P (ADDR) ? 1 : c4x_address_cost (ADDR))#define	CANONICALIZE_COMPARISON(CODE, OP0, OP1)		\if (REG_P (OP1) && ! REG_P (OP0))			\{							\  rtx tmp = OP0; OP0 = OP1 ; OP1 = tmp;			\  CODE = swap_condition (CODE);				\}#define EXT_CLASS_P(CLASS) (reg_class_subset_p (CLASS, EXT_REGS))#define ADDR_CLASS_P(CLASS) (reg_class_subset_p (CLASS, ADDR_REGS))#define INDEX_CLASS_P(CLASS) (reg_class_subset_p (CLASS, INDEX_REGS))#define EXPENSIVE_CLASS_P(CLASS) (ADDR_CLASS_P(CLASS) \                          || INDEX_CLASS_P(CLASS) || (CLASS) == SP_REG)/* Compute extra cost of moving data between one register class   and another.  */#define REGISTER_MOVE_COST(MODE, FROM, TO)	2/* Memory move cost is same as fast register move.  Maybe this should   be bumped up?.  */#define MEMORY_MOVE_COST(M,C,I)		4/* Branches are kind of expensive (even with delayed branching) so   make their cost higher.  */#define BRANCH_COST			8#define	WORD_REGISTER_OPERATIONS/* Dividing the Output into Sections.  */#define TEXT_SECTION_ASM_OP "\t.text"#define DATA_SECTION_ASM_OP "\t.data"#define READONLY_DATA_SECTION_ASM_OP "\t.sect\t\".const\""/* Do not use .init section so __main will be called on startup. This will   call __do_global_ctors and prepare for __do_global_dtors on exit.  */#if 0#define INIT_SECTION_ASM_OP  "\t.sect\t\".init\""#endif#define FINI_SECTION_ASM_OP  "\t.sect\t\".fini\""#undef EXTRA_SECTIONS#define EXTRA_SECTIONS in_init, in_fini#undef EXTRA_SECTION_FUNCTIONS#define EXTRA_SECTION_FUNCTIONS					\  INIT_SECTION_FUNCTION						\  FINI_SECTION_FUNCTION#define INIT_SECTION_FUNCTION					\extern void init_section PARAMS ((void));			\void								\init_section ()							\{								\  if (in_section != in_init)					\    {								\      fprintf (asm_out_file, ";\t.init\n");			\      in_section = in_init;					\    }								\}#define FINI_SECTION_FUNCTION					\void								\fini_section ()							\{								\  if (in_section != in_fini)					\    {								\      fprintf (asm_out_file, "%s\n", FINI_SECTION_ASM_OP);	\      in_section = in_fini;					\    }								\}#define ASM_STABS_OP "\t.stabs\t"/* Switch into a generic section.  */#define TARGET_ASM_NAMED_SECTION c4x_asm_named_section/* The TI assembler wants to have hex numbers this way.  */#undef HOST_WIDE_INT_PRINT_HEX#ifndef HOST_WIDE_INT_PRINT_HEX# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT#  define HOST_WIDE_INT_PRINT_HEX "0%xh"# else#  if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG#   define HOST_WIDE_INT_PRINT_HEX "0%lxh"#  else#   define HOST_WIDE_INT_PRINT_HEX "0%llxh"#  endif# endif#endif /* ! HOST_WIDE_INT_PRINT_HEX *//* Overall Framework of an Assembler File.  *//* We need to have a data section we can identify so that we can set   the DP register back to a data pointer in the small memory model.   This is only required for ISRs if we are paranoid that someone   may have quietly changed this register on the sly.  */#define ASM_FILE_START(FILE)					\{								\    int dspversion = 0;						\    if (TARGET_C30) dspversion = 30;				\    if (TARGET_C31) dspversion = 31;				\    if (TARGET_C32) dspversion = 32;				\    if (TARGET_C33) dspversion = 33;                            \    if (TARGET_C40) dspversion = 40;				\    if (TARGET_C44) dspversion = 44;				\    fprintf (FILE, "\t.version\t%d\n", dspversion);		\    fprintf (FILE, "\t.file\t");				\    if (TARGET_TI)						\      {								\        const char *p;						\        const char *after_dir = main_input_filename;		\	for (p = main_input_filename; *p; p++)			\	  if (*p == '/')					\	    after_dir = p + 1;					\	output_quoted_string (FILE, after_dir);			\      }								\    else							\      output_quoted_string (FILE, main_input_filename);		\    fputs ("\n\t.data\ndata_sec:\n", FILE);			\}#define ASM_COMMENT_START ";"#define ASM_APP_ON ""#define ASM_APP_OFF ""#define ASM_OUTPUT_ASCII(FILE, PTR, LEN) c4x_output_ascii (FILE, PTR, LEN)/* Output and Generation of Labels.  */#define NO_DOT_IN_LABEL		/* Only required for TI format.  *//* Globalizing directive for a label.  */#define GLOBAL_ASM_OP "\t.global\t"#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \c4x_external_ref (NAME)/* A C statement to output on FILE an assembler pseudo-op to   declare a library function named external.   (Only needed to keep asm30 happy for ___divqf3 etc.)  */#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \c4x_external_ref (XSTR (FUN, 0))#define	ASM_FILE_END(FILE) \c4x_file_end (FILE)/* The prefix to add to user-visible assembler symbols.  */#define USER_LABEL_PREFIX "_"/* This is how to output an internal numbered label where   PREFIX is the class of label and NUM is the number within the class.  */#define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM)	\	fprintf (FILE, "%s%d:\n", PREFIX, NUM)/* This is how to store into the string LABEL   the symbol_ref name of an internal numbered label where   PREFIX is the class of label and NUM is the number within the class.   This is suitable for output with `assemble_name'.  */#define ASM_GENERATE_INTERNAL_LABEL(BUFFER, PREFIX, NUM) \    sprintf (BUFFER, "*%s%d", PREFIX, NUM)/* Store in OUTPUT a string (made with alloca) containing   an assembler-name for a local static variable named NAME.   LABELNO is an integer which is different for each call.  */#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO)  \( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10),    \  sprintf ((OUTPUT), "%s$%d", (NAME), (LABELNO)))/* A C statement to output to the stdio stream STREAM assembler code which   defines (equates) the symbol NAME to have the value VALUE.  */#define ASM_OUTPUT_DEF(STREAM, NAME, VALUE) 	\do {						\  assemble_name (STREAM, NAME);			\  fprintf (STREAM, "\t.set\t%s\n", VALUE);	\} while (0)/* Output of Dispatch Tables.  *//* This is how to output an element of a case-vector that is absolute.  */#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \    fprintf (FILE, "\t.long\tL%d\n", VALUE);/* This is how to output an element of a case-vector that is relative.  */#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \    fprintf (FILE, "\t.long\tL%d-L%d\n", VALUE, REL);#undef SIZE_TYPE#define SIZE_TYPE "unsigned int"#undef PTRDIFF_TYPE#define PTRDIFF_TYPE "int"#undef WCHAR_TYPE#define WCHAR_TYPE "long int"#undef WCHAR_TYPE_SIZE#define WCHAR_TYPE_SIZE 32#define INT_TYPE_SIZE		32#define LONG_LONG_TYPE_SIZE	64#define FLOAT_TYPE_SIZE		32#define DOUBLE_TYPE_SIZE	32#define LONG_DOUBLE_TYPE_SIZE	64 /* Actually only 40.  *//* Output #ident as a .ident.  */#define ASM_OUTPUT_IDENT(FILE, NAME) \  fprintf (FILE, "\t.ident \"%s\"\n", NAME);/* Output of Uninitialized Variables.  *//* This says how to output an assembler line to define a local   uninitialized variable.  */#undef ASM_OUTPUT_LOCAL#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \( fputs ("\t.bss\t", FILE),			\  assemble_name (FILE, (NAME)),		\  fprintf (FILE, ",%u\n", (ROUNDED)))/* This says how to output an assembler line to define a global   uninitialized variable.  */#undef ASM_OUTPUT_COMMON#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \(  fputs ("\t.globl\t", FILE),	\   assemble_name (FILE, (NAME)),	\   fputs ("\n\t.bss\t", FILE),	\   assemble_name (FILE, (NAME)),	\   fprintf (FILE, ",%u\n", (ROUNDED)))#undef ASM_OUTPUT_BSS#define ASM_OUTPUT_BSS(FILE, DECL, NAME, SIZE, ALIGN)   \(  fputs ("\t.globl\t", FILE),	\   assemble_name (FILE, (NAME)),	\   fputs ("\n\t.bss\t", FILE),	\   assemble_name (FILE, (NAME)),	\   fprintf (FILE, ",%u\n", (SIZE)))/* Macros Controlling Initialization Routines.  */#define OBJECT_FORMAT_COFF#define REAL_NM_FILE_NAME "c4x-nm"/* Output of Assembler Instructions.  *//* Register names when used for integer modes.  */#define REGISTER_NAMES \{								\ "r0",   "r1", "r2",   "r3",  "r4",  "r5",  "r6",  "r7",	\ "ar0", "ar1", "ar2", "ar3", "ar4", "ar5", "ar6", "ar7",	\ "dp",  "ir0", "ir1",  "bk",  "sp",  "st", "die", "iie",	\ "iif",	 "rs",  "re",  "rc",  "r8",  "r9", "r10", "r11"		\}/* Alternate register names when used for floating point modes.  */#define FLOAT_REGISTER_NAMES \{								\ "f0",   "f1", "f2",   "f3",  "f4",  "f5",  "f6",  "f7",	\ "ar0", "ar1", "ar2", "ar3", "ar4", "ar5", "ar6", "ar7",	\ "dp",  "ir0", "ir1",  "bk",  "sp",  "st", "die", "iie",	\ "iif",	 "rs",  "re",  "rc",  "f8",  "f9", "f10", "f11"		\}#define PRINT_OPERAND(FILE, X, CODE) c4x_print_operand(FILE, X, CODE)/* Determine which codes are valid without a following integer.  These must   not be alphabetic.  */#define PRINT_OPERAND_PUNCT_VALID_P(CODE) ((CODE) == '#')#define PRINT_OPERAND_ADDRESS(FILE, X) c4x_print_operand_address(FILE, X)/* C4x specific pragmas.  */#define REGISTER_TARGET_PRAGMAS(PFILE) do {				\  cpp_register_pragma (PFILE, 0, "CODE_SECTION", c4x_pr_CODE_SECTION);	\  cpp_register_pragma (PFILE, 0, "DATA_SECTION", c4x_pr_DATA_SECTION);	\  cpp_register_pragma (PFILE, 0, "FUNC_CANNOT_INLINE", c4x_pr_ignored);	\  cpp_register_pragma (PFILE, 0, "FUNC_EXT_CALLED", c4x_pr_ignored);	\  cpp_register_pragma (PFILE, 0, "FUNC_IS_PURE", c4x_pr_FUNC_IS_PURE);	\  cpp_register_pragma (PFILE, 0, "FUNC_IS_SYSTEM", c4x_pr_ignored);	\  cpp_register_pragma (PFILE, 0, "FUNC_NEVER_RETURNS",			\		       c4x_pr_FUNC_NEVER_RETURNS);			\  cpp_register_pragma (PFILE, 0, "FUNC_NO_GL

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -