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

📄 arm.h

📁 早期freebsd实现
💻 H
📖 第 1 页 / 共 4 页
字号:
}/* DBX register number for a given compiler register number */#define DBX_REGISTER_NUMBER(REGNO)  (REGNO)/* Generate DBX debugging information.  */#define DBX_DEBUGGING_INFO  1/* Acorn dbx moans about continuation chars, so don't use any.  */#define DBX_CONTIN_LENGTH  0/* Output a label definition.  */#define ASM_OUTPUT_LABEL(STREAM,NAME)  \  arm_asm_output_label ((STREAM), (NAME))/* Output a function label definition.  */#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) \    ASM_OUTPUT_LABEL(STREAM, NAME)/* Output a globalising directive for a label.  */#define ASM_GLOBALIZE_LABEL(STREAM,NAME)  \  (fprintf (STREAM, "\t.global\t"),	  \   assemble_name (STREAM, NAME),	  \   fputc ('\n',STREAM))                   \/* Output a reference to a label.  */#define ASM_OUTPUT_LABELREF(STREAM,NAME)  \  fprintf (STREAM, "_%s", NAME)/* Make an internal label into a string.  */#define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM)  \  sprintf (STRING, "*%s%d", PREFIX, NUM)/* Output an internal label definition.  */#define ASM_OUTPUT_INTERNAL_LABEL(STREAM, PREFIX, NUM)  \  do                                    	      	   		\    {						      	   		\      char *s = (char *) alloca (11 + strlen (PREFIX));	   		\      extern int arm_target_label, arm_ccfsm_state;	   		\						           		\      if (arm_ccfsm_state == 3 && arm_target_label == (NUM))   		\	arm_ccfsm_state = 0;				        	\      strcpy (s, "*");				           		\      sprintf (&s[strlen (s)], "%s%d", (PREFIX), (NUM));   		\      arm_asm_output_label (STREAM, s);		                        \    } while (0)/* Nothing special is done about jump tables *//* #define ASM_OUTPUT_CASE_LABEL(STREAM,PREFIX,NUM,TABLE)   *//* #define ASM_OUTPUT_CASE_END(STREAM,NUM,TABLE)	    *//* Construct a private name.  */#define ASM_FORMAT_PRIVATE_NAME(OUTVAR,NAME,NUMBER)  \  ((OUTVAR) = (char *) alloca (strlen (NAME) + 10),  \   sprintf ((OUTVAR), "%s.%d", (NAME), (NUMBER)))/* Output a push or a pop instruction (only used when profiling).  */#define ASM_OUTPUT_REG_PUSH(STREAM,REGNO)   \  (arm_increase_location (4)                                   \   , fprintf(STREAM,"\tstmfd\tsp!,{%s}\n", reg_names[REGNO]))#define ASM_OUTPUT_REG_POP(STREAM,REGNO)   \  (arm_increase_location (4)                                   \   , fprintf(STREAM,"\tldmfd\tsp!,{%s}\n", reg_names[REGNO]))/* Output a relative address. Not needed since jump tables are absolute   but we must define it anyway.  */#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM,VALUE,REL)  \  fputs ("- - - ASM_OUTPUT_ADDR_DIFF_ELT called!\n", STREAM)/* Output an element of a dispatch table.  */#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM,VALUE)  \  (arm_increase_location (4)                     \   , fprintf (STREAM, "\t.word\tL%d\n", VALUE))/* Output various types of constants.  */#define ASM_OUTPUT_DOUBLE(STREAM, VALUE)  \  (arm_increase_location (sizeof (double))        \   , fprintf (STREAM, "\t.double\t%20.20f\n", VALUE))#define ASM_OUTPUT_FLOAT(STREAM, VALUE)	\  (arm_increase_location (sizeof (float))        \   , fprintf (STREAM, "\t.float\t%20.20f\n", VALUE))#define ASM_OUTPUT_INT(STREAM, EXP)  \  (fprintf (STREAM, "\t.word\t"),      \   output_addr_const (STREAM, (EXP)),  \   arm_increase_location (4),          \   fputc ('\n', STREAM))#define ASM_OUTPUT_SHORT(STREAM, EXP)  \  (fprintf (STREAM, "\t.short\t"),     \   output_addr_const (STREAM, (EXP)),  \   arm_increase_location (2),          \   fputc ('\n', STREAM))#define ASM_OUTPUT_CHAR(STREAM, EXP)  \  (fprintf (STREAM, "\t.byte\t"),      \   output_addr_const (STREAM, (EXP)),  \   arm_increase_location (1),          \   fputc ('\n', STREAM))#define ASM_OUTPUT_BYTE(STREAM, VALUE)  \  (fprintf (STREAM, "\t.byte\t%d\n", VALUE),  \   arm_increase_location (1))#define ASM_OUTPUT_ASCII(STREAM, PTR, LEN)  \  output_ascii_pseudo_op ((STREAM), (PTR), (LEN))/* Output a gap.  In fact we fill it with nulls.  */#define ASM_OUTPUT_SKIP(STREAM, NBYTES)  \  (arm_increase_location (NBYTES),              \   fprintf (STREAM, "\t.space\t%d\n", NBYTES))/* Align output to a power of two.  Horrible /bin/as.  */#define ASM_OUTPUT_ALIGN(STREAM, POWER)  \  do                                                           \    {                                                          \      register int amount = 1 << (POWER);                      \      extern int arm_text_location;			       \                                                               \      if (amount == 2)                                         \	fprintf (STREAM, "\t.even\n");                         \      else                                                     \	fprintf (STREAM, "\t.align\t%d\n", amount - 4);        \                                                               \      if (in_text_section ())                                  \	arm_text_location = ((arm_text_location + amount - 1)  \			     & ~(amount - 1));                 \    } while (0)/* Output a common block */#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED)  \  (fprintf (STREAM, "\t.comm\t"), 		     \   assemble_name ((STREAM), (NAME)),		     \   fprintf(STREAM, ", %d\t@%d\n", ROUNDED, SIZE))/* Output a local common block.  /bin/as can't do this, so hack a `.space' into   the bss segment.  Note that this is *bad* practice.  */#define ASM_OUTPUT_LOCAL(STREAM,NAME,SIZE,ROUNDED)  \  output_lcomm_directive (STREAM, NAME, SIZE, ROUNDED)/* Output a source filename for the debugger. RISCiX dbx insists that the   ``desc'' field is set to compiler version number >= 315 (sic).  */#if 0#define ASM_OUTPUT_SOURCE_FILENAME(STREAM,NAME)	 \  fprintf (STREAM, "\t.stabs\t\"%s\", %d, 0, 315, Ltext\n", (NAME), N_SOL)#endif/* Output a source line for the debugger.  *//* #define ASM_OUTPUT_SOURCE_LINE(STREAM,LINE) *//* Output a #ident directive.  */#define ASM_OUTPUT_IDENT(STREAM,STRING)  \  fprintf (STREAM,"- - - ident %s\n",STRING)/* The assembler's parentheses characters.  */#define ASM_OPEN_PAREN "("#define ASM_CLOSE_PAREN ")"/* Target characters.  */#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/* FINAL_PRESCAN_INSN is used to take a look at the insns, in order to delete   small-distance conditional branches and have ASM_OUTPUT_OPCODE make the   instructions conditional.  Suffixes like s (affect flags) and b (bytewise   load/store) need to stay suffixes, so the possible condition code comes   before these suffixes.  */#define ASM_OUTPUT_OPCODE(STREAM, PTR)  \  {					        		      \    extern int arm_ccfsm_state, arm_current_cc;			      \    extern char *arm_condition_codes[];				      \    int i;							      \								      \    fflush (STREAM);	    /* XXX for debugging only.  */	      \    if (arm_ccfsm_state == 1 || arm_ccfsm_state == 2)   	      \      {				                        	      \	fprintf (STREAM, "@ \t");				      \	arm_ccfsm_state += 2;		        		      \      }					        		             \    else if (arm_ccfsm_state == 3 || arm_ccfsm_state == 4)	             \      {					        		             \	for (i = 0; *(PTR) != ' ' && *(PTR) != '\t' && i < 3; i++, (PTR)++)  \	  putc (*(PTR), STREAM);	        		             \	fprintf (STREAM, "%s", arm_condition_codes[arm_current_cc]);         \	for (; *(PTR) != ' ' && *(PTR) != '\t'; (PTR)++)		     \	  putc (*(PTR), STREAM);					     \      }								             \  }/* Only perform branch elimination (by making instructions conditional) if   we're optimising.  Otherwise it's of no use anyway.  */#define FINAL_PRESCAN_INSN(INSN, OPVEC, NOPERANDS)  \  if (optimize)					    \    final_prescan_insn (INSN, OPVEC, NOPERANDS)/* Output an operand of an instruction.  If X is a REG and CODE is `M', output   a ldm/stm style multi-reg.  */#define PRINT_OPERAND(STREAM, X, CODE)  \{					        		\  if ((CODE) == 'R')			        		\    fputs (reg_names[REGNO (X) + 1], (STREAM));			\  else if (GET_CODE (X) == REG)		        		\    {					        		\      if ((CODE) != 'M')					\	fputs (reg_names[REGNO (X)], (STREAM));			\      else				        		\	fprintf ((STREAM), "{%s-%s}",	        		\		 reg_names[REGNO (X)],	        		\		 reg_names[REGNO (X) - 1        		\			   + ((GET_MODE_SIZE (GET_MODE (X))	\			       + GET_MODE_SIZE (SImode) - 1)	\			      / GET_MODE_SIZE (SImode))]);	\    }								\  else if (GET_CODE (X) == MEM)					\    {								\      extern int output_memory_reference_mode;			\      output_memory_reference_mode = GET_MODE (X);		\      output_address (XEXP (X, 0));				\    }								\  else if (GET_CODE(X) == CONST_DOUBLE)				\    {								\      union real_extract u;					\      u.i[0] = CONST_DOUBLE_LOW (X);				\      u.i[1] = CONST_DOUBLE_HIGH (X);				\      fprintf(STREAM,"#%20.20f",u.d);				\    }								\  else if (GET_CODE (X) == NEG)					\    {								\      fputc ('-', (STREAM));					\      output_operand ((X), 0);					\    }								\  else								\    {								\      fputc('#', STREAM);					\      output_addr_const(STREAM, X);				\    }								\}/* Output the address of an operand.  */#define PRINT_OPERAND_ADDRESS(STREAM,X)  \{									\    int is_minus = GET_CODE (X) == MINUS;				\									\    if (GET_CODE (X) == REG)						\	fprintf (STREAM, "[%s, #0]", reg_names[REGNO (X)]);		\    else if (GET_CODE (X) == PLUS || is_minus)				\      {									\	rtx base = XEXP (X, 0);						\	rtx index = XEXP (X, 1);					\	char *base_reg_name;						\	int offset = 0; 						\	int shift;							\	if (GET_CODE (base) != REG)					\	  {								\	    /* Ensure that BASE is a register (one of them must be). */	\	    rtx temp = base;						\	    base = index;						\	    index = temp;						\	  }								\	base_reg_name = reg_names[REGNO (base)];			\	switch (GET_CODE (index))					\	  {								\	  case CONST_INT:						\	    offset = INTVAL (index);					\	    if (is_minus)						\	      offset = -offset;						\	    fprintf (STREAM, "[%s, #%d]", base_reg_name, offset);	\	    break;							\									\	  case REG:							\	    fprintf (STREAM, "[%s, %s%s]", base_reg_name,		\		     is_minus ? "-" : "", reg_names[REGNO (index)] );	\	    break;							\									\	  case MULT:							\	    if (GET_CODE (XEXP (index,0)) == CONST_INT)			\	      {								\		shift = int_log2 (INTVAL (XEXP (index, 0)));		\		index = XEXP (index, 1);				\	      }								\	    else if (GET_CODE(XEXP(index,1)) == CONST_INT)		\	      {								\		shift = int_log2 (INTVAL (XEXP (index, 1)));		\		index = XEXP (index, 0);				\	      }								\	    else							\		abort();						\	    fprintf (STREAM, "[%s, %s%s, asl#%d]", base_reg_name,	\		     is_minus ? "-" : "", reg_names[REGNO (index)],	\		     shift);						\	    break;							\	    								\	  default:							\	    abort();							\	}								\    }							        	\  else if (GET_CODE (X) == PRE_INC || GET_CODE (X) == POST_INC		\	   || GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_DEC)	\    {									\      extern int output_memory_reference_mode;				\      									\      if (GET_CODE (XEXP (X, 0)) != REG)				\	abort ();							\									\      if (GET_CODE (X) == PRE_DEC || GET_CODE (X) == PRE_INC)		\	fprintf (STREAM, "[%s, #%s%d]!", reg_names[REGNO (XEXP (X, 0))],\		 GET_CODE (X) == PRE_DEC ? "-" : "",			\		 GET_MODE_SIZE (output_memory_reference_mode));		\      else								\	fprintf (STREAM, "[%s], #%s%d", reg_names[REGNO (XEXP (X, 0))],	\		 GET_CODE (X) == POST_DEC ? "-" : "",			\		 GET_MODE_SIZE (output_memory_reference_mode));		\    }									\  else output_addr_const(STREAM, X);					\}/* EOF arm.h */

⌨️ 快捷键说明

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