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

📄 i386.h

📁 早期freebsd实现
💻 H
📖 第 1 页 / 共 4 页
字号:
   return it with a return statement.  Otherwise, break from the switch.  */#define CONST_COSTS(RTX,CODE,OUTER_CODE) \  case CONST_INT:						\  case CONST:							\  case LABEL_REF:						\  case SYMBOL_REF:						\    return flag_pic && SYMBOLIC_CONST (RTX) ? 2 : 0;		\  case CONST_DOUBLE:						\    {								\      int code = standard_80387_constant_p (RTX);		\      return code == 1 ? 0 :					\	     code == 2 ? 1 :					\			 2;					\    }/* 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.   For i386, it is better to use a complex address than let gcc copy   the address into a reg and make a new pseudo.  But not if the address   requires to two regs - that would mean more pseudos with longer   lifetimes.  */#define ADDRESS_COST(RTX) \  ((CONSTANT_P (RTX)						\    || (GET_CODE (RTX) == PLUS && CONSTANT_P (XEXP (RTX, 1))	\	&& REG_P (XEXP (RTX, 0)))) ? 0				\   : REG_P (RTX) ? 1						\   : 2)/* Add any extra modes needed to represent the condition code.   For the i386, we need separate modes when floating-point equality   comparisons are being done.  */#define EXTRA_CC_MODES CCFPEQmode/* Define the names for the modes specified above.  */#define EXTRA_CC_NAMES "CCFPEQ"/* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,   return the mode to be used for the comparison.   For floating-point equality comparisons, CCFPEQmode should be used.   VOIDmode should be used in all other cases.  */#define SELECT_CC_MODE(OP,X,Y) \  (GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT			\   && ((OP) == EQ || (OP) == NE) ? CCFPEQmode : CCmode)/* Define the information needed to generate branch and scc insns.  This is   stored from the compare operation.  Note that we can't use "rtx" here   since it hasn't been defined!  */extern struct rtx_def *i386_compare_op0, *i386_compare_op1;extern struct rtx_def *(*i386_compare_gen)(), *(*i386_compare_gen_eq)();/* Tell final.c how to eliminate redundant test instructions.  *//* Here we define machine-dependent flags and fields in cc_status   (see `conditions.h').  *//* Set if the cc value is actually in the 80387, so a floating point   conditional branch must be output.  */#define CC_IN_80387 04000/* Set if the CC value was stored in a nonstandard way, so that   the state of equality is indicated by zero in the carry bit.  */#define CC_Z_IN_NOT_C 010000/* 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.  */#define NOTICE_UPDATE_CC(EXP, INSN) \  notice_update_cc((EXP))/* Output a signed jump insn.  Use template NORMAL ordinarily, or   FLOAT following a floating point comparison.   Use NO_OV following an arithmetic insn that set the cc's   before a test insn that was deleted.   NO_OV may be zero, meaning final should reinsert the test insn   because the jump cannot be handled properly without it.  */#define OUTPUT_JUMP(NORMAL, FLOAT, NO_OV)			\{								\  if (cc_prev_status.flags & CC_IN_80387)			\    return FLOAT;						\  if (cc_prev_status.flags & CC_NO_OVERFLOW)			\    return NO_OV;						\  return NORMAL;						\}/* Control the assembler format that we output, to the extent   this does not vary between assemblers.  *//* How to refer to registers in assembler output.   This sequence is indexed by compiler's hard-register-number (see above). *//* In order to refer to the first 8 regs as 32 bit regs prefix an "e"   For non floating point regs, the following are the HImode names.   For float regs, the stack top is sometimes referred to as "%st(0)"   instead of just "%st".  PRINT_REG handles this with the "y" code.  */#define HI_REGISTER_NAMES \{"ax","dx","cx","bx","si","di","bp","sp",          \ "st","st(1)","st(2)","st(3)","st(4)","st(5)","st(6)","st(7)","" }#define REGISTER_NAMES HI_REGISTER_NAMES/* Table of additional register names to use in user input.  */#define ADDITIONAL_REGISTER_NAMES \{ "eax", 0, "edx", 1, "ecx", 2, "ebx", 3,	\  "esi", 4, "edi", 5, "ebp", 6, "esp", 7,	\  "al", 0, "dl", 1, "cl", 2, "bl", 3,		\  "ah", 0, "dh", 1, "ch", 2, "bh", 3 }/* Note we are omitting these since currently I don't know howto get gcc to use these, since they want the same but differentnumber as al, and ax.*//* note the last four are not really qi_registers, but   the md will have to never output movb into one of them   only a movw .  There is no movb into the last four regs */#define QI_REGISTER_NAMES \{"al", "dl", "cl", "bl", "si", "di", "bp", "sp",}/* These parallel the array above, and can be used to access bits 8:15   of regs 0 through 3. */#define QI_HIGH_REGISTER_NAMES \{"ah", "dh", "ch", "bh", }/* How to renumber registers for dbx and gdb.  *//* {0,2,1,3,6,7,4,5,12,13,14,15,16,17}  */#define DBX_REGISTER_NUMBER(n) \((n) == 0 ? 0 : \ (n) == 1 ? 2 : \ (n) == 2 ? 1 : \ (n) == 3 ? 3 : \ (n) == 4 ? 6 : \ (n) == 5 ? 7 : \ (n) == 6 ? 4 : \ (n) == 7 ? 5 : \ (n) + 4)/* 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)	\  (assemble_name (FILE, NAME), fputs (":\n", FILE))/* This is how to output an assembler line defining a `double' constant.  */#define ASM_OUTPUT_DOUBLE(FILE,VALUE)  \  fprintf (FILE, "%s %.22e\n", ASM_DOUBLE, (VALUE))/* This is how to output an assembler line defining a `float' constant.  */#define ASM_OUTPUT_FLOAT(FILE,VALUE)  \do { union { float f; long l;} tem;			\     tem.f = (VALUE);					\     fprintf((FILE), "%s 0x%x\n", ASM_LONG, tem.l);	\   } while (0)/* 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)))/* This is how to output an assembler line defining an `int' constant.  */#define ASM_OUTPUT_INT(FILE,VALUE)  \( fprintf (FILE, "%s ", ASM_LONG),		\  output_addr_const (FILE,(VALUE)),		\  putc('\n',FILE))/* Likewise for `char' and `short' constants.  *//* is this supposed to do align too?? */#define ASM_OUTPUT_SHORT(FILE,VALUE)  \( fprintf (FILE, "%s ", ASM_SHORT),		\  output_addr_const (FILE,(VALUE)),		\  putc('\n',FILE))/*#define ASM_OUTPUT_SHORT(FILE,VALUE)  \( fprintf (FILE, "%s ", ASM_BYTE_OP),		\  output_addr_const (FILE,(VALUE)),		\  fputs (",", FILE),		      		\  output_addr_const (FILE,(VALUE)),		\  fputs (" >> 8\n",FILE))*/#define ASM_OUTPUT_CHAR(FILE,VALUE)  \( fprintf (FILE, "%s ", ASM_BYTE_OP),		\  output_addr_const (FILE, (VALUE)),		\  putc ('\n', FILE))/* This is how to output an assembler line for a numeric constant byte.  */#define ASM_OUTPUT_BYTE(FILE,VALUE)  \  fprintf ((FILE), "%s 0x%x\n", ASM_BYTE_OP, (VALUE))/* 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, "\tpushl e%s\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, "\tpopl e%s\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, "%s %s%d\n", ASM_LONG, LPREFIX, VALUE)/* This is how to output an element of a case-vector that is relative.   We don't use these on the 386 yet, because the ATT assembler can't do   forward reference the differences.   */#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \  fprintf (FILE, "\t.word %s%d-%s%d\n",LPREFIX, VALUE,LPREFIX, REL)/* 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.   The CODE z takes the size of operand from the following digit, and   outputs b,w,or l respectively.   On the 80386, we use several such letters:   f -- float insn (print a CONST_DOUBLE as a float rather than in hex).   L,W,B,Q,S -- print the opcode suffix for specified size of operand.   R -- print the prefix for register names.   z -- print the opcode suffix for the size of the current operand.   * -- print a star (in certain assembler syntax)   w -- print the operand as if it's a "word" (HImode) even if it isn't.   b -- print the operand as if it's a byte (QImode) even if it isn't.   c -- don't print special prefixes before constant operands.  */#define PRINT_OPERAND_PUNCT_VALID_P(CODE)				\  ((CODE) == '*')/* Print the name of a register based on its machine mode and number.   If CODE is 'w', pretend the mode is HImode.   If CODE is 'b', pretend the mode is QImode.   If CODE is 'k', pretend the mode is SImode.   If CODE is 'h', pretend the reg is the `high' byte register.   If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op. */extern char *hi_reg_name[];extern char *qi_reg_name[];extern char *qi_high_reg_name[];#define PRINT_REG(X, CODE, FILE) \  do { if (REGNO (X) == ARG_POINTER_REGNUM)		\	 abort ();					\       fprintf (FILE, "%s", RP);			\       switch ((CODE == 'w' ? 2 			\		: CODE == 'b' ? 1			\		: CODE == 'k' ? 4			\		: CODE == 'y' ? 3			\		: CODE == 'h' ? 0			\		: GET_MODE_SIZE (GET_MODE (X))))	\	 {						\	 case 3:					\	   if (STACK_TOP_P (X))				\	     {						\	       fputs ("st(0)", FILE);			\	       break;					\	     }						\	 case 4:					\	 case 8:					\	   if (! FP_REG_P (X)) fputs ("e", FILE);	\	 case 2:					\	   fputs (hi_reg_name[REGNO (X)], FILE);	\	   break;					\	 case 1:					\	   fputs (qi_reg_name[REGNO (X)], FILE);	\	   break;					\	 case 0:					\	   fputs (qi_high_reg_name[REGNO (X)], FILE);	\	   break;					\	 }						\     } while (0)#define PRINT_OPERAND(FILE, X, CODE)  \  print_operand (FILE, X, CODE)#define PRINT_OPERAND_ADDRESS(FILE, ADDR)  \  print_operand_address (FILE, ADDR)/* Print the name of a register for based on its machine mode and number.   This macro is used to print debugging output.   This macro is different from PRINT_REG in that it may be used in   programs that are not linked with aux-output.o.  */#define DEBUG_PRINT_REG(X, CODE, FILE) \  do { static char *hi_name[] = HI_REGISTER_NAMES;	\       static char *qi_name[] = QI_REGISTER_NAMES;	\       fprintf (FILE, "%s", RP);			\       if (REGNO (X) == ARG_POINTER_REGNUM)		\	 { fputs ("argp", FILE); break; }		\       if (STACK_TOP_P (X))				\	 { fputs ("st(0)", FILE); break; }		\       switch (GET_MODE_SIZE (GET_MODE (X)))		\	 {						\	 case 8:					\	 case 4:					\	   if (! FP_REG_P (X)) fputs ("e", FILE);	\	 case 2:					\	   fputs (hi_name[REGNO (X)], FILE);		\	   break;					\	 case 1:					\	   fputs (qi_name[REGNO (X)], FILE);		\	   break;					\	 }						\     } while (0)/* Output the prefix for an immediate operand, or for an offset operand.  */#define PRINT_IMMED_PREFIX(FILE)  fputs (IP, (FILE))#define PRINT_OFFSET_PREFIX(FILE)  fputs (IP, (FILE))/* Routines in libgcc that return floats must return them in an fp reg,   just as other functions do which return such values.   These macros make that happen.  */#define FLOAT_VALUE_TYPE float#define INTIFY(FLOATVAL) FLOATVAL/* Nonzero if INSN magically clobbers register REGNO.  *//* #define INSN_CLOBBERS_REGNO_P(INSN, REGNO)	\    (FP_REGNO_P (REGNO)				\     && (GET_CODE (INSN) == JUMP_INSN || GET_CODE (INSN) == BARRIER))*//* a letter which is not needed by the normal asm syntax, which   we can use for operand syntax in the extended asm */#define ASM_OPERAND_LETTER '#'#define RET return ""#define AT_SP(mode) (gen_rtx (MEM, (mode), stack_pointer_rtx))/*Local variables:version-control: tEnd:*/

⌨️ 快捷键说明

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