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

📄 alpha.h

📁 早期freebsd实现
💻 H
📖 第 1 页 / 共 4 页
字号:
   We define this on the Alpha so that gen_call and gen_call_value   get to see the SYMBOL_REF (for the hint field of the jsr).  It will   then copy it into a register, thus actually letting the address be   cse'ed.  */#define NO_FUNCTION_CSE/* Define this if shift instructions ignore all but the low-order   few bits. */#define SHIFT_COUNT_TRUNCATED/* 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.   We only care about the cost if it is valid in an insn, so all constants   are cheap.  */#define CONST_COSTS(RTX,CODE,OUTER_CODE) \  case CONST_INT:						\  case CONST_DOUBLE:						\    return 0;							\  case CONST:							\  case SYMBOL_REF:						\  case LABEL_REF:						\    return 6;							\    /* Provide the costs of a rtl expression.  This is in the body of a   switch on CODE.  */   #define RTX_COSTS(X,CODE,OUTER_CODE)			\  case PLUS:						\  case MINUS:						\    if (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT)	\      return COSTS_N_INSNS (6);				\    break;						\  case MULT:						\    if (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT)	\      return COSTS_N_INSNS (6);				\    else						\      return COSTS_N_INSNS (21);			\  case DIV:						\  case UDIV:						\  case MOD:						\  case UMOD:						\    if (GET_MODE (X) == SFmode)				\      return COSTS_N_INSNS (34);			\    else if (GET_MODE (X) == DFmode)			\      return COSTS_N_INSNS (63);			\    else						\      return COSTS_N_INSNS (70);			\  case MEM:						\    return COSTS_N_INSNS (3);/* Control the assembler format that we output.  *//* Output at beginning of assembler file.  */#define ASM_FILE_START(FILE)					\{ extern char *version_string;					\  char *p, *after_dir = main_input_filename;			\								\  fprintf (FILE, "\t.verstamp 9 0 ");				\  for (p = version_string; *p != ' ' && *p != 0; p++)		\    fprintf (FILE, "%c", *p == '.' ? ' ' : *p);			\  fprintf (FILE, "\n\t.set noreorder\n");			\  fprintf (FILE, "\t.set noat\n");				\  for (p = main_input_filename; *p; p++)			\    if (*p == '/')						\      after_dir = p + 1;					\  fprintf (FILE, "\n\t.file 2 \"%s\"\n", after_dir);	        \}/* 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 ""#define TEXT_SECTION_ASM_OP ".text"/* Output before read-only data.  */#define READONLY_DATA_SECTION_ASM_OP ".rdata"/* Output before writable data.  */#define DATA_SECTION_ASM_OP ".data"/* Define an extra section for read-only data, a routine to enter it, and   indicate that it is for read-only data.  */#define EXTRA_SECTIONS	readonly_data#define EXTRA_SECTION_FUNCTIONS					\void								\literal_section ()						\{								\  if (in_section != readonly_data)				\    {								\      fprintf (asm_out_file, "%s\n", READONLY_DATA_SECTION_ASM_OP); \      in_section = readonly_data;				\    }								\}								\#define READONLY_DATA_SECTION	literal_section/* How to refer to registers in assembler output.   This sequence is indexed by compiler's hard-register-number (see above).  */#define REGISTER_NAMES						\{"$0", "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8",		\ "$9", "$10", "$11", "$12", "$13", "$14", "$15",		\ "$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23",	\ "$24", "$25", "$26", "$27", "$28", "$29", "$30", "$31",	\ "$f0", "$f1", "$f2", "$f3", "$f4", "$f5", "$f6", "$f7", "$f8",	\ "$f9", "$f10", "$f11", "$f12", "$f13", "$f14", "$f15",		\ "$f16", "$f17", "$f18", "$f19", "$f20", "$f21", "$f22", "$f23",\ "$f24", "$f25", "$f26", "$f27", "$f28", "$f29", "$f30", "$f31"}/* 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 ("\t.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)	\  if ((PREFIX)[0] == 'L')				\    fprintf (FILE, "$%s%d:\n", & (PREFIX)[1], NUM + 32); \  else							\    fprintf (FILE, "%s%d:\n", PREFIX, NUM);/* This is how to output a label for a jump table.  Arguments are the same as   for ASM_OUTPUT_INTERNAL_LABEL, except the insn for the jump table is   passed. */#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN)	\{ ASM_OUTPUT_ALIGN (FILE, 2); ASM_OUTPUT_INTERNAL_LABEL (FILE, 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)	\  if ((PREFIX)[0] == 'L')				\    sprintf (LABEL, "*$%s%d", & (PREFIX)[1], NUM + 32);	\  else							\    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.t_floating %.20e\n", (VALUE))/* This is how to output an assembler line defining a `float' constant.  */#define ASM_OUTPUT_FLOAT(FILE,VALUE)		\  fprintf (FILE, "\t.s_floating %.20e\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"))/* This is how to output an assembler line defining a `long' constant.  */#define ASM_OUTPUT_DOUBLE_INT(FILE,VALUE)	\( fprintf (FILE, "\t.quad "),			\  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"))/* We use the default ASCII-output routine, except that we don't write more   than 50 characters since the assembler doesn't support very long lines.  */#define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \  do {									      \    FILE *_hide_asm_out_file = (MYFILE);				      \    unsigned char *_hide_p = (unsigned char *) (MYSTRING);		      \    int _hide_thissize = (MYLENGTH);					      \    int _size_so_far = 0;						      \    {									      \      FILE *asm_out_file = _hide_asm_out_file;				      \      unsigned char *p = _hide_p;					      \      int thissize = _hide_thissize;					      \      int i;								      \      fprintf (asm_out_file, "\t.ascii \"");				      \									      \      for (i = 0; i < thissize; i++)					      \	{								      \	  register int c = p[i];					      \									      \	  if (_size_so_far ++ > 50 && i < thissize - 4)			      \	    _size_so_far = 0, fprintf (asm_out_file, "\"\n\t.ascii \"");      \									      \	  if (c == '\"' || c == '\\')					      \	    putc ('\\', asm_out_file);					      \	  if (c >= ' ' && c < 0177)					      \	    putc (c, asm_out_file);					      \	  else								      \	    {								      \	      fprintf (asm_out_file, "\\%o", c);			      \	      /* After an octal-escape, if a digit follows,		      \		 terminate one string constant and start another.	      \		 The Vax assembler fails to stop reading the escape	      \		 after three digits, so this is the only way we		      \		 can get it to parse the data properly.  */		      \	      if (i < thissize - 1					      \		  && p[i + 1] >= '0' && p[i + 1] <= '9')		      \		fprintf (asm_out_file, "\"\n\t.ascii \"");		      \	  }								      \	}								      \      fprintf (asm_out_file, "\"\n");					      \    }									      \  }									      \  while (0)/* This is how to output an insn to push a register on the stack.   It need not be very fast code.  */#define ASM_OUTPUT_REG_PUSH(FILE,REGNO)					\ fprintf (FILE, "\tsubq $30,8,$30\n\tst%s $%s%d,0($30)\n",		\	  (REGNO) > 32 ? "t" : "q", (REGNO) > 32 ? "f" : "",		\	  (REGNO) & 31);/* 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%s $%s%d,0($30)\n\taddq $30,8,$30\n",		\	  (REGNO) > 32 ? "t" : "q", (REGNO) > 32 ? "f" : "",		\	  (REGNO) & 31);/* 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 an element of a case-vector that is absolute.  */#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE)  \  fprintf (FILE, "\t.gprel32 $%d\n", (VALUE) + 32)/* This is how to output an element of a case-vector that is relative.   (Alpha does not use such vectors, but we must define this macro anyway.)  */#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL)  abort ()/* 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);/* This is how to advance the location counter by SIZE bytes.  */#define ASM_OUTPUT_SKIP(FILE,SIZE)  \  fprintf (FILE, "\t.space %d\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 ("\t.comm ", (FILE)),			\  assemble_name ((FILE), (NAME)),		\  fprintf ((FILE), ",%d\n", (SIZE)))/* This says how to output an assembler line   to define a local common symbol.  */#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE,ROUNDED)	\( fputs ("\t.lcomm ", (FILE)),				\  assemble_name ((FILE), (NAME)),			\  fprintf ((FILE), ",%d\n", (SIZE)))/* 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.  */#define PRINT_OPERAND(FILE, X, CODE)  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) 0/* Print a memory address as an operand to reference that memory location.  */#define PRINT_OPERAND_ADDRESS(FILE, ADDR)		\{ rtx addr = (ADDR);					\  int basereg = 31;					\  HOST_WIDE_INT offset = 0;				\							\  if (GET_CODE (addr) == AND)				\    addr = XEXP (addr, 0);				\							\  if (GET_CODE (addr) == REG)				\    basereg = REGNO (addr);				\  else if (GET_CODE (addr) == CONST_INT)		\    offset = INTVAL (addr);				\  else if (GET_CODE (addr) == PLUS			\	   && GET_CODE (XEXP (addr, 0)) == REG		\	   && GET_CODE (XEXP (addr, 1)) == CONST_INT)	\    basereg = REGNO (XEXP (addr, 0)), offset = INTVAL (XEXP (addr, 1)); \  else							\    abort ();						\							\  fprintf (FILE, "%d($%d)", offset, basereg);		\}/* Define the codes that are matched by predicates in alpha.c.  */#define PREDICATE_CODES \  {"reg_or_0_operand", {SUBREG, REG, CONST_INT}},	\  {"reg_or_8bit_operand", {SUBREG, REG, CONST_INT}},	\  {"reg_or_cint_operand", {SUBREG, REG, CONST_INT}},	\  {"add_operand", {SUBREG, REG, CONST_INT}},		\  {"sext_add_operand", {SUBREG, REG, CONST_INT}},	\  {"const48_operand", {CONST_INT}},			\  {"and_operand", {SUBREG, REG, CONST_INT}},		\  {"mode_mask_operand", {CONST_INT}},			\  {"mul8_operand", {CONST_INT}},			\  {"mode_width_operand", {CONST_INT}},			\  {"reg_or_fp0_operand", {SUBREG, REG, CONST_DOUBLE}},	\  {"alpha_comparison_operator", {EQ, LE, LT, LEU, LTU}}, \  {"signed_comparison_operator", {EQ, NE, LE, LT, GE, GT}}, \  {"fp0_operand", {CONST_DOUBLE}},			\  {"input_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE,	\		     SYMBOL_REF, CONST, LABEL_REF}},	\  {"aligned_memory_operand", {MEM}},			\  {"unaligned_memory_operand", {MEM}},			\  {"any_memory_operand", {MEM}},

⌨️ 快捷键说明

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