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

📄 tm-spur.h

📁 这是完整的gcc源代码
💻 H
📖 第 1 页 / 共 3 页
字号:
   It is always safe for this macro to do nothing.  It exists to recognize   opportunities to optimize the output.  *//* On SPUR, change REG+N into REG+REG, and REG+(X*Y) into REG+REG.  */#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN)	\{ if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 1)))	\    (X) = gen_rtx (PLUS, SImode, XEXP (X, 0),			\		   copy_to_mode_reg (SImode, XEXP (X, 1)));	\  if (GET_CODE (X) == PLUS && CONSTANT_ADDRESS_P (XEXP (X, 0)))	\    (X) = gen_rtx (PLUS, SImode, XEXP (X, 1),			\		   copy_to_mode_reg (SImode, XEXP (X, 0)));	\  if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == MULT)	\    (X) = gen_rtx (PLUS, SImode, XEXP (X, 1),			\		   force_operand (XEXP (X, 0), 0));		\  if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == MULT)	\    (X) = gen_rtx (PLUS, SImode, XEXP (X, 0),			\		   force_operand (XEXP (X, 1), 0));		\  if (memory_address_p (MODE, X))				\    goto WIN; }/* Go to LABEL if ADDR (a legitimate address expression)   has an effect that depends on the machine mode it is used for.   On the SPUR this is never true.  */#define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL)/* Specify the machine mode that this machine uses   for the index in the tablejump instruction.  */#define CASE_VECTOR_MODE SImode/* Define this if the tablejump instruction expects the table   to contain offsets from the address of the table.   Do not define this if the table should contain absolute addresses.  *//* #define CASE_VECTOR_PC_RELATIVE *//* Specify the tree operation to be used to convert reals to integers.  */#define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR/* This is the kind of divide that is easiest to do in the general case.  */#define EASY_DIV_EXPR TRUNC_DIV_EXPR/* Define this as 1 if `char' should by default be signed; else as 0.  */#define DEFAULT_SIGNED_CHAR 0/* Max number of bytes we can move from memory to memory   in one reasonably fast instruction.  */#define MOVE_MAX 4/* Nonzero if access to memory by bytes is slow and undesirable.  */#define SLOW_BYTE_ACCESS 1/* This is BSD, so it wants DBX format.  */#define DBX_DEBUGGING_INFO/* Do not break .stabs pseudos into continuations.  */#define DBX_CONTIN_LENGTH 0/* Don't try to use the `x' type-cross-reference character in DBX data.   Also has the consequence of putting each struct, union or enum   into a separate .stabs, containing only cross-refs to the others.  */#define DBX_NO_XREFS/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits   is done just by pretending it is already truncated.  */#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1/* Specify the machine mode that pointers have.   After generation of rtl, the compiler makes no further distinction   between pointers and any other objects of this machine mode.  */#define Pmode SImode/* A function address in a call instruction   is a byte address (for indexing purposes)   so give the MEM rtx a byte's mode.  */#define FUNCTION_MODE SImode/* Define this if addresses of constant functions   shouldn't be put through pseudo regs where they can be cse'd.   Desirable on machines where ordinary constants are expensive   but a CALL with constant address is cheap.  */#define NO_FUNCTION_CSE/* 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.  */#define CONST_COSTS(RTX,CODE) \  case CONST_INT:						\    if (INTVAL (RTX) < 0x2000 && INTVAL (RTX) >= -0x2000) return 1; \  case CONST:							\  case LABEL_REF:						\  case SYMBOL_REF:						\    return 2;							\  case CONST_DOUBLE:						\    return 4;/* Tell final.c how to eliminate redundant test instructions.  *//* Here we define machine-dependent flags and fields in cc_status   (see `conditions.h').  *//* (None are needed on SPUR.)  *//* Store in cc_status the expressions   that the condition codes will describe   after execution of an instruction whose pattern is EXP.   Do not alter them if the instruction would not alter the cc's.  *//* The SPUR does not really have a condition code.  */#define NOTICE_UPDATE_CC(EXP, INSN) \{ CC_STATUS_INIT; }/* Control the assembler format that we output.  *//* Output at beginning of assembler file.  */#define ASM_FILE_START(FILE)/* Output to assembler file text saying following lines   may contain character constants, extra white space, comments, etc.  */#define ASM_APP_ON ""/* Output to assembler file text saying following lines   no longer contain unusual constructs.  */#define ASM_APP_OFF ""/* Output before read-only data.  */#define TEXT_SECTION_ASM_OP ".text"/* Output before writable data.  */#define DATA_SECTION_ASM_OP ".data"/* How to refer to registers in assembler output.   This sequence is indexed by compiler's hard-register-number (see above).  */#define REGISTER_NAMES \{"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",								\ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9",	\ "f10", "f11", "f12", "f13", "f14" }/* How to renumber registers for dbx and gdb.  */#define DBX_REGISTER_NUMBER(REGNO) (REGNO)/* This is how to output the definition of a user-level label named NAME,   such as the label on a static function or variable NAME.  */#define ASM_OUTPUT_LABEL(FILE,NAME)	\  do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0)/* This is how to output a command to make the user-level label named NAME   defined for reference from other files.  */#define ASM_GLOBALIZE_LABEL(FILE,NAME)	\  do { fputs (".globl ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0)/* This is how to output a reference to a user-level label named NAME.   `assemble_name' uses this.  */#define ASM_OUTPUT_LABELREF(FILE,NAME)	\  fprintf (FILE, "_%s", NAME)/* 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(LABEL,PREFIX,NUM)	\  sprintf (LABEL, "*%s%d", PREFIX, NUM)/* This is how to output an assembler line defining a `double' constant.  */#define ASM_OUTPUT_DOUBLE(FILE,VALUE)  \  fprintf (FILE, "\t.double %.20e\n", (VALUE))/* This is how to output an assembler line defining a `float' constant.  */#define ASM_OUTPUT_FLOAT(FILE,VALUE)  \  fprintf (FILE, "\t.single %.12e\n", (VALUE))/* This is how to output an assembler line defining an `int' constant.  */#define ASM_OUTPUT_INT(FILE,VALUE)  \( fprintf (FILE, "\t.long "),			\  output_addr_const (FILE, (VALUE)),		\  fprintf (FILE, "\n"))/* Likewise for `char' and `short' constants.  */#define ASM_OUTPUT_SHORT(FILE,VALUE)  \( fprintf (FILE, "\t.word "),			\  output_addr_const (FILE, (VALUE)),		\  fprintf (FILE, "\n"))#define ASM_OUTPUT_CHAR(FILE,VALUE)  \( fprintf (FILE, "\t.byte "),			\  output_addr_const (FILE, (VALUE)),		\  fprintf (FILE, "\n"))/* This is how to output an assembler line for a numeric constant byte.  */#define ASM_OUTPUT_BYTE(FILE,VALUE)  \  fprintf (FILE, "\t.byte 0x%x\n", (VALUE))/* This is how to output code to push a register on the stack.   It need not be very fast code.  */#define ASM_OUTPUT_REG_PUSH(FILE,REGNO)  \  fprintf (FILE, "\tadd_nt r4,r4,$-4\n\tst_32 %s,r4,$0\n", reg_names[REGNO])/* This is how to output an insn to pop a register from the stack.   It need not be very fast code.  */#define ASM_OUTPUT_REG_POP(FILE,REGNO)  \  fprintf (FILE, "\tld_32 %s,r4,$0\n\tadd_nt r4,r4,$4\n", reg_names[REGNO])/* 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 L%d\n", VALUE)/* This is how to output an element of a case-vector that is relative.   (SPUR does not use such vectors,   but we must define this macro anyway.)  */#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)  \  fprintf (FILE, "\t.word L%d-L%d\n", VALUE, REL)/* This is how to output an assembler line   that says to advance the location counter   to a multiple of 2**LOG bytes.  */#define ASM_OUTPUT_ALIGN(FILE,LOG)	\  if ((LOG) != 0)			\    fprintf (FILE, "\t.align %d\n", (LOG))#define ASM_OUTPUT_SKIP(FILE,SIZE)  \  fprintf (FILE, "\t.space %u\n", (SIZE))/* This says how to output an assembler line   to define a global common symbol.  */#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \( fputs (".comm ", (FILE)),			\  assemble_name ((FILE), (NAME)),		\  fprintf ((FILE), ",%u\n", (ROUNDED)))/* This says how to output an assembler line   to define a local common symbol.  */#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \( fputs (".lcomm ", (FILE)),			\  assemble_name ((FILE), (NAME)),		\  fprintf ((FILE), ",%u\n", (ROUNDED)))/* 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)))/* Define the parentheses used to group arithmetic operations   in assembler code.  */#define ASM_OPEN_PAREN "("#define ASM_CLOSE_PAREN ")"/* 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/* Print operand X (an rtx) in assembler syntax to file FILE.   CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified.   For `%' followed by punctuation, CODE is the punctuation and X is null.   On SPUR, the CODE can be `r', meaning this is a register-only operand   and an immediate zero should be represented as `r0'.  */#define PRINT_OPERAND(FILE, X, CODE)  \{ if (GET_CODE (X) == REG)						\    fprintf (FILE, "%s", reg_names[REGNO (X)]);				\  else if (GET_CODE (X) == MEM)						\    output_address (XEXP (X, 0));					\  else if (GET_CODE (X) == CONST_DOUBLE)				\    abort ();								\  else if ((CODE) == 'r' && (X) == const0_rtx)				\    fprintf (FILE, "r0");						\  else { putc ('$', FILE); output_addr_const (FILE, X); }}/* Print a memory address as an operand to reference that memory location.  */#define PRINT_OPERAND_ADDRESS(FILE, ADDR)  \{ register rtx base, index = 0;					\  int offset = 0;						\  register rtx addr = ADDR;					\  if (GET_CODE (addr) == REG)					\    {								\      fprintf (FILE, "%s,$0", reg_names[REGNO (addr)]);		\    }								\  else if (GET_CODE (addr) == PLUS)				\    {								\      if (GET_CODE (XEXP (addr, 0)) == CONST_INT)		\	offset = INTVAL (XEXP (addr, 0)), base = XEXP (addr, 1);\      else if (GET_CODE (XEXP (addr, 1)) == CONST_INT)		\	offset = INTVAL (XEXP (addr, 1)), base = XEXP (addr, 0);\      else							\	base = XEXP (addr, 0), index = XEXP (addr, 1);		\      fprintf (FILE, "%s,", reg_names[REGNO (base)]);		\      if (index == 0)						\	fprintf (FILE, "$%d", offset);				\      else							\	fprintf (FILE, "%s,", reg_names[REGNO (index)]);	\    }								\  else								\    {								\      fprintf (FILE, "r24,$(");					\      output_addr_const (FILE, addr);				\      fprintf (FILE, "-0b)");					\    }								\}

⌨️ 快捷键说明

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