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

📄 rs6000.c

📁 gcc3.2.1源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
  if (TARGET_MULTIPLE_SET)    target_flags = (target_flags & ~MASK_MULTIPLE) | multiple;  /* If -mstring or -mno-string was explicitly used, don't override     with the processor default.  */  if (TARGET_STRING_SET)    target_flags = (target_flags & ~MASK_STRING) | string;  /* Don't allow -mmultiple or -mstring on little endian systems     unless the cpu is a 750, because the hardware doesn't support the     instructions used in little endian mode, and causes an alignment     trap.  The 750 does not cause an alignment trap (except when the     target is unaligned).  */  if (! BYTES_BIG_ENDIAN && rs6000_cpu != PROCESSOR_PPC750)    {      if (TARGET_MULTIPLE)	{	  target_flags &= ~MASK_MULTIPLE;	  if (TARGET_MULTIPLE_SET)	    warning ("-mmultiple is not supported on little endian systems");	}      if (TARGET_STRING)	{	  target_flags &= ~MASK_STRING;	  if (TARGET_STRING_SET)	    warning ("-mstring is not supported on little endian systems");	}    }  if (flag_pic != 0 && DEFAULT_ABI == ABI_AIX)    {      flag_pic = 0;      if (extra_warnings)	warning ("-f%s ignored (all code is position independent)",		 (flag_pic > 1) ? "PIC" : "pic");    }#ifdef XCOFF_DEBUGGING_INFO  if (flag_function_sections && (write_symbols != NO_DEBUG)      && DEFAULT_ABI == ABI_AIX)    {      warning ("-ffunction-sections disabled on AIX when debugging");      flag_function_sections = 0;    }  if (flag_data_sections && (DEFAULT_ABI == ABI_AIX))    {      warning ("-fdata-sections not supported on AIX");      flag_data_sections = 0;    }#endif  /* Set debug flags */  if (rs6000_debug_name)    {      if (! strcmp (rs6000_debug_name, "all"))	rs6000_debug_stack = rs6000_debug_arg = 1;      else if (! strcmp (rs6000_debug_name, "stack"))	rs6000_debug_stack = 1;      else if (! strcmp (rs6000_debug_name, "arg"))	rs6000_debug_arg = 1;      else	error ("unknown -mdebug-%s switch", rs6000_debug_name);    }  /* Set size of long double */  rs6000_long_double_type_size = 64;  if (rs6000_long_double_size_string)    {      char *tail;      int size = strtol (rs6000_long_double_size_string, &tail, 10);      if (*tail != '\0' || (size != 64 && size != 128))	error ("Unknown switch -mlong-double-%s",	       rs6000_long_double_size_string);      else	rs6000_long_double_type_size = size;    }  /* Handle -mabi= options.  */  rs6000_parse_abi_options ();#ifdef TARGET_REGNAMES  /* If the user desires alternate register names, copy in the     alternate names now.  */  if (TARGET_REGNAMES)    memcpy (rs6000_reg_names, alt_reg_names, sizeof (rs6000_reg_names));#endif#ifdef SUBTARGET_OVERRIDE_OPTIONS  SUBTARGET_OVERRIDE_OPTIONS;#endif#ifdef SUBSUBTARGET_OVERRIDE_OPTIONS  SUBSUBTARGET_OVERRIDE_OPTIONS;#endif  /* Set TARGET_AIX_STRUCT_RET last, after the ABI is determined.     If -maix-struct-return or -msvr4-struct-return was explicitly     used, don't override with the ABI default.  */  if (!(target_flags & MASK_AIX_STRUCT_RET_SET))    {      if (DEFAULT_ABI == ABI_V4 && !DRAFT_V4_STRUCT_RET)	target_flags = (target_flags & ~MASK_AIX_STRUCT_RET);      else	target_flags |= MASK_AIX_STRUCT_RET;    }  /* Register global variables with the garbage collector.  */  rs6000_add_gc_roots ();  /* Allocate an alias set for register saves & restores from stack.  */  rs6000_sr_alias_set = new_alias_set ();  if (TARGET_TOC)     ASM_GENERATE_INTERNAL_LABEL (toc_label_name, "LCTOC", 1);  /* We can only guarantee the availability of DI pseudo-ops when     assembling for 64-bit targets.  */  if (!TARGET_64BIT)    {      targetm.asm_out.aligned_op.di = NULL;      targetm.asm_out.unaligned_op.di = NULL;    }  /* Arrange to save and restore machine status around nested functions.  */  init_machine_status = rs6000_init_machine_status;  free_machine_status = rs6000_free_machine_status;}/* Handle -mabi= options.  */static voidrs6000_parse_abi_options (){  if (rs6000_abi_string == 0)    return;  else if (! strcmp (rs6000_abi_string, "altivec"))    rs6000_altivec_abi = 1;  else if (! strcmp (rs6000_abi_string, "no-altivec"))    rs6000_altivec_abi = 0;  else    error ("unknown ABI specified: '%s'", rs6000_abi_string);}voidoptimization_options (level, size)     int level ATTRIBUTE_UNUSED;     int size ATTRIBUTE_UNUSED;{}/* Do anything needed at the start of the asm file.  */voidrs6000_file_start (file, default_cpu)     FILE *file;     const char *default_cpu;{  size_t i;  char buffer[80];  const char *start = buffer;  struct rs6000_cpu_select *ptr;  if (flag_verbose_asm)    {      sprintf (buffer, "\n%s rs6000/powerpc options:", ASM_COMMENT_START);      rs6000_select[0].string = default_cpu;      for (i = 0; i < ARRAY_SIZE (rs6000_select); i++)	{	  ptr = &rs6000_select[i];	  if (ptr->string != (char *)0 && ptr->string[0] != '\0')	    {	      fprintf (file, "%s %s%s", start, ptr->name, ptr->string);	      start = "";	    }	}#ifdef USING_ELFOS_H      switch (rs6000_sdata)	{	case SDATA_NONE: fprintf (file, "%s -msdata=none", start); start = ""; break;	case SDATA_DATA: fprintf (file, "%s -msdata=data", start); start = ""; break;	case SDATA_SYSV: fprintf (file, "%s -msdata=sysv", start); start = ""; break;	case SDATA_EABI: fprintf (file, "%s -msdata=eabi", start); start = ""; break;	}      if (rs6000_sdata && g_switch_value)	{	  fprintf (file, "%s -G %d", start, g_switch_value);	  start = "";	}#endif      if (*start == '\0')	putc ('\n', file);    }}/* Create a CONST_DOUBLE from a string.  */struct rtx_def *rs6000_float_const (string, mode)     const char *string;     enum machine_mode mode;{  REAL_VALUE_TYPE value;  value = REAL_VALUE_ATOF (string, mode);  return immed_real_const_1 (value, mode);}/* Return non-zero if this function is known to have a null epilogue.  */intdirect_return (){  if (reload_completed)    {      rs6000_stack_t *info = rs6000_stack_info ();      if (info->first_gp_reg_save == 32	  && info->first_fp_reg_save == 64	  && info->first_altivec_reg_save == LAST_ALTIVEC_REGNO + 1	  && ! info->lr_save_p	  && ! info->cr_save_p	  && info->vrsave_mask == 0	  && ! info->push_p)	return 1;    }  return 0;}/* Returns 1 always.  */intany_operand (op, mode)     rtx op ATTRIBUTE_UNUSED;     enum machine_mode mode ATTRIBUTE_UNUSED;{  return 1;}/* Returns 1 if op is the count register.  */intcount_register_operand (op, mode)     rtx op;     enum machine_mode mode ATTRIBUTE_UNUSED;{  if (GET_CODE (op) != REG)    return 0;  if (REGNO (op) == COUNT_REGISTER_REGNUM)    return 1;  if (REGNO (op) > FIRST_PSEUDO_REGISTER)    return 1;  return 0;}/* Returns 1 if op is an altivec register.  */intaltivec_register_operand (op, mode)     rtx op;     enum machine_mode mode ATTRIBUTE_UNUSED;{    return (register_operand (op, mode)	  && (GET_CODE (op) != REG	      || REGNO (op) > FIRST_PSEUDO_REGISTER	      || ALTIVEC_REGNO_P (REGNO (op))));}intxer_operand (op, mode)     rtx op;     enum machine_mode mode ATTRIBUTE_UNUSED;{  if (GET_CODE (op) != REG)    return 0;  if (XER_REGNO_P (REGNO (op)))    return 1;  return 0;}/* Return 1 if OP is a signed 8-bit constant.  Int multiplication   by such constants completes more quickly.  */ints8bit_cint_operand (op, mode)     rtx op;     enum machine_mode mode ATTRIBUTE_UNUSED;{  return ( GET_CODE (op) == CONST_INT	  && (INTVAL (op) >= -128 && INTVAL (op) <= 127));}/* Return 1 if OP is a constant that can fit in a D field.  */intshort_cint_operand (op, mode)     rtx op;     enum machine_mode mode ATTRIBUTE_UNUSED;{  return (GET_CODE (op) == CONST_INT	  && CONST_OK_FOR_LETTER_P (INTVAL (op), 'I'));}/* Similar for an unsigned D field.  */intu_short_cint_operand (op, mode)     rtx op;     enum machine_mode mode ATTRIBUTE_UNUSED;{  return (GET_CODE (op) == CONST_INT	  && CONST_OK_FOR_LETTER_P (INTVAL (op) & GET_MODE_MASK (mode), 'K'));}/* Return 1 if OP is a CONST_INT that cannot fit in a signed D field.  */intnon_short_cint_operand (op, mode)     rtx op;     enum machine_mode mode ATTRIBUTE_UNUSED;{  return (GET_CODE (op) == CONST_INT	  && (unsigned HOST_WIDE_INT) (INTVAL (op) + 0x8000) >= 0x10000);}/* Returns 1 if OP is a CONST_INT that is a positive value   and an exact power of 2.  */intexact_log2_cint_operand (op, mode)     rtx op;     enum machine_mode mode ATTRIBUTE_UNUSED;{  return (GET_CODE (op) == CONST_INT	  && INTVAL (op) > 0	  && exact_log2 (INTVAL (op)) >= 0);}/* Returns 1 if OP is a register that is not special (i.e., not MQ,   ctr, or lr).  */intgpc_reg_operand (op, mode)     rtx op;     enum machine_mode mode;{  return (register_operand (op, mode)	  && (GET_CODE (op) != REG	      || (REGNO (op) >= ARG_POINTER_REGNUM 		  && !XER_REGNO_P (REGNO (op)))	      || REGNO (op) < MQ_REGNO));}/* Returns 1 if OP is either a pseudo-register or a register denoting a   CR field.  */intcc_reg_operand (op, mode)     rtx op;     enum machine_mode mode;{  return (register_operand (op, mode)	  && (GET_CODE (op) != REG	      || REGNO (op) >= FIRST_PSEUDO_REGISTER	      || CR_REGNO_P (REGNO (op))));}/* Returns 1 if OP is either a pseudo-register or a register denoting a   CR field that isn't CR0.  */intcc_reg_not_cr0_operand (op, mode)     rtx op;     enum machine_mode mode;{  return (register_operand (op, mode)	  && (GET_CODE (op) != REG	      || REGNO (op) >= FIRST_PSEUDO_REGISTER	      || CR_REGNO_NOT_CR0_P (REGNO (op))));}/* Returns 1 if OP is either a constant integer valid for a D-field or   a non-special register.  If a register, it must be in the proper   mode unless MODE is VOIDmode.  */intreg_or_short_operand (op, mode)      rtx op;      enum machine_mode mode;{  return short_cint_operand (op, mode) || gpc_reg_operand (op, mode);}/* Similar, except check if the negation of the constant would be   valid for a D-field.  */intreg_or_neg_short_operand (op, mode)      rtx op;      enum machine_mode mode;{  if (GET_CODE (op) == CONST_INT)    return CONST_OK_FOR_LETTER_P (INTVAL (op), 'P');  return gpc_reg_operand (op, mode);}/* Returns 1 if OP is either a constant integer valid for a DS-field or   a non-special register.  If a register, it must be in the proper   mode unless MODE is VOIDmode.  */intreg_or_aligned_short_operand (op, mode)      rtx op;      enum machine_mode mode;{  if (gpc_reg_operand (op, mode))    return 1;  else if (short_cint_operand (op, mode) && !(INTVAL (op) & 3))    return 1;  return 0;}/* Return 1 if the operand is either a register or an integer whose   high-order 16 bits are zero.  */intreg_or_u_short_operand (op, mode)     rtx op;     enum machine_mode mode;{  return u_short_cint_operand (op, mode) || gpc_reg_operand (op, mode);}/* Return 1 is the operand is either a non-special register or ANY   constant integer.  */intreg_or_cint_operand (op, mode)    rtx op;    enum machine_mode mode;

⌨️ 快捷键说明

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