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

📄 alpha.c

📁 Mac OS X 10.4.9 for x86 Source Code gcc 实现源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
  }  /* Default the definition of "small data" to 8 bytes.  */  if (!g_switch_set)    g_switch_value = 8;  /* Infer TARGET_SMALL_DATA from -fpic/-fPIC.  */  if (flag_pic == 1)    target_flags |= MASK_SMALL_DATA;  else if (flag_pic == 2)    target_flags &= ~MASK_SMALL_DATA;  /* Align labels and loops for optimal branching.  */  /* ??? Kludge these by not doing anything if we don't optimize and also if     we are writing ECOFF symbols to work around a bug in DEC's assembler.  */  if (optimize > 0 && write_symbols != SDB_DEBUG)    {      if (align_loops <= 0)	align_loops = 16;      if (align_jumps <= 0)	align_jumps = 16;    }  if (align_functions <= 0)    align_functions = 16;  /* Acquire a unique set number for our register saves and restores.  */  alpha_sr_alias_set = new_alias_set ();  /* Register variables and functions with the garbage collector.  */  /* Set up function hooks.  */  init_machine_status = alpha_init_machine_status;  /* Tell the compiler when we're using VAX floating point.  */  if (TARGET_FLOAT_VAX)    {      REAL_MODE_FORMAT (SFmode) = &vax_f_format;      REAL_MODE_FORMAT (DFmode) = &vax_g_format;      REAL_MODE_FORMAT (TFmode) = NULL;    }}/* Returns 1 if VALUE is a mask that contains full bytes of zero or ones.  */intzap_mask (HOST_WIDE_INT value){  int i;  for (i = 0; i < HOST_BITS_PER_WIDE_INT / HOST_BITS_PER_CHAR;       i++, value >>= 8)    if ((value & 0xff) != 0 && (value & 0xff) != 0xff)      return 0;  return 1;}/* Return true if OP is valid for a particular TLS relocation.   We are already guaranteed that OP is a CONST.  */inttls_symbolic_operand_1 (rtx op, int size, int unspec){  op = XEXP (op, 0);  if (GET_CODE (op) != UNSPEC || XINT (op, 1) != unspec)    return 0;  op = XVECEXP (op, 0, 0);  if (GET_CODE (op) != SYMBOL_REF)    return 0;  if (SYMBOL_REF_LOCAL_P (op))    {      if (alpha_tls_size > size)	return 0;    }  else    {      if (size != 64)	return 0;    }  switch (SYMBOL_REF_TLS_MODEL (op))    {    case TLS_MODEL_LOCAL_DYNAMIC:      return unspec == UNSPEC_DTPREL;    case TLS_MODEL_INITIAL_EXEC:      return unspec == UNSPEC_TPREL && size == 64;    case TLS_MODEL_LOCAL_EXEC:      return unspec == UNSPEC_TPREL;    default:      abort ();    }}/* Used by aligned_memory_operand and unaligned_memory_operand to   resolve what reload is going to do with OP if it's a register.  */rtxresolve_reload_operand (rtx op){  if (reload_in_progress)    {      rtx tmp = op;      if (GET_CODE (tmp) == SUBREG)	tmp = SUBREG_REG (tmp);      if (GET_CODE (tmp) == REG	  && REGNO (tmp) >= FIRST_PSEUDO_REGISTER)	{	  op = reg_equiv_memory_loc[REGNO (tmp)];	  if (op == 0)	    return 0;	}    }  return op;}/* Implements CONST_OK_FOR_LETTER_P.  Return true if the value matches   the range defined for C in [I-P].  */boolalpha_const_ok_for_letter_p (HOST_WIDE_INT value, int c){  switch (c)    {    case 'I':      /* An unsigned 8 bit constant.  */      return (unsigned HOST_WIDE_INT) value < 0x100;    case 'J':      /* The constant zero.  */      return value == 0;    case 'K':      /* A signed 16 bit constant.  */      return (unsigned HOST_WIDE_INT) (value + 0x8000) < 0x10000;    case 'L':      /* A shifted signed 16 bit constant appropriate for LDAH.  */      return ((value & 0xffff) == 0              && ((value) >> 31 == -1 || value >> 31 == 0));    case 'M':      /* A constant that can be AND'ed with using a ZAP insn.  */      return zap_mask (value);    case 'N':      /* A complemented unsigned 8 bit constant.  */      return (unsigned HOST_WIDE_INT) (~ value) < 0x100;    case 'O':      /* A negated unsigned 8 bit constant.  */      return (unsigned HOST_WIDE_INT) (- value) < 0x100;    case 'P':      /* The constant 1, 2 or 3.  */      return value == 1 || value == 2 || value == 3;    default:      return false;    }}/* Implements CONST_DOUBLE_OK_FOR_LETTER_P.  Return true if VALUE   matches for C in [GH].  */boolalpha_const_double_ok_for_letter_p (rtx value, int c){  switch (c)    {    case 'G':      /* The floating point zero constant.  */      return (GET_MODE_CLASS (GET_MODE (value)) == MODE_FLOAT	      && value == CONST0_RTX (GET_MODE (value)));    case 'H':      /* A valid operand of a ZAP insn.  */      return (GET_MODE (value) == VOIDmode	      && zap_mask (CONST_DOUBLE_LOW (value))	      && zap_mask (CONST_DOUBLE_HIGH (value)));    default:      return false;    }}/* Implements CONST_DOUBLE_OK_FOR_LETTER_P.  Return true if VALUE   matches for C.  */boolalpha_extra_constraint (rtx value, int c){  switch (c)    {    case 'Q':      return normal_memory_operand (value, VOIDmode);    case 'R':      return direct_call_operand (value, Pmode);    case 'S':      return (GET_CODE (value) == CONST_INT	      && (unsigned HOST_WIDE_INT) INTVAL (value) < 64);    case 'T':      return GET_CODE (value) == HIGH;    case 'U':      return TARGET_ABI_UNICOSMK && symbolic_operand (value, VOIDmode);    case 'W':      return (GET_CODE (value) == CONST_VECTOR	      && value == CONST0_RTX (GET_MODE (value)));    default:      return false;    }}/* The scalar modes supported differs from the default check-what-c-supports   version in that sometimes TFmode is available even when long double   indicates only DFmode.  On unicosmk, we have the situation that HImode   doesn't map to any C type, but of course we still support that.  */static boolalpha_scalar_mode_supported_p (enum machine_mode mode){  switch (mode)    {    case QImode:    case HImode:    case SImode:    case DImode:    case TImode: /* via optabs.c */      return true;    case SFmode:    case DFmode:      return true;    case TFmode:      return TARGET_HAS_XFLOATING_LIBS;    default:      return false;    }}/* Alpha implements a couple of integer vector mode operations when   TARGET_MAX is enabled.  We do not check TARGET_MAX here, however,   which allows the vectorizer to operate on e.g. move instructions,   or when expand_vector_operations can do something useful.  */static boolalpha_vector_mode_supported_p (enum machine_mode mode){  return mode == V8QImode || mode == V4HImode || mode == V2SImode;}/* Return 1 if this function can directly return via $26.  */intdirect_return (void){  return (! TARGET_ABI_OPEN_VMS && ! TARGET_ABI_UNICOSMK	  && reload_completed	  && alpha_sa_size () == 0	  && get_frame_size () == 0	  && current_function_outgoing_args_size == 0	  && current_function_pretend_args_size == 0);}/* Return the ADDR_VEC associated with a tablejump insn.  */rtxalpha_tablejump_addr_vec (rtx insn){  rtx tmp;  tmp = JUMP_LABEL (insn);  if (!tmp)    return NULL_RTX;  tmp = NEXT_INSN (tmp);  if (!tmp)    return NULL_RTX;  if (GET_CODE (tmp) == JUMP_INSN      && GET_CODE (PATTERN (tmp)) == ADDR_DIFF_VEC)    return PATTERN (tmp);  return NULL_RTX;}/* Return the label of the predicted edge, or CONST0_RTX if we don't know.  */rtxalpha_tablejump_best_label (rtx insn){  rtx jump_table = alpha_tablejump_addr_vec (insn);  rtx best_label = NULL_RTX;  /* ??? Once the CFG doesn't keep getting completely rebuilt, look     there for edge frequency counts from profile data.  */  if (jump_table)    {      int n_labels = XVECLEN (jump_table, 1);      int best_count = -1;      int i, j;      for (i = 0; i < n_labels; i++)	{	  int count = 1;	  for (j = i + 1; j < n_labels; j++)	    if (XEXP (XVECEXP (jump_table, 1, i), 0)		== XEXP (XVECEXP (jump_table, 1, j), 0))	      count++;	  if (count > best_count)	    best_count = count, best_label = XVECEXP (jump_table, 1, i);	}    }  return best_label ? best_label : const0_rtx;}/* Return the TLS model to use for SYMBOL.  */static enum tls_modeltls_symbolic_operand_type (rtx symbol){  enum tls_model model;  if (GET_CODE (symbol) != SYMBOL_REF)    return 0;  model = SYMBOL_REF_TLS_MODEL (symbol);  /* Local-exec with a 64-bit size is the same code as initial-exec.  */  if (model == TLS_MODEL_LOCAL_EXEC && alpha_tls_size == 64)    model = TLS_MODEL_INITIAL_EXEC;  return model;}/* Return true if the function DECL will share the same GP as any   function in the current unit of translation.  */static booldecl_has_samegp (tree decl){  /* Functions that are not local can be overridden, and thus may     not share the same gp.  */  if (!(*targetm.binds_local_p) (decl))    return false;  /* If -msmall-data is in effect, assume that there is only one GP     for the module, and so any local symbol has this property.  We     need explicit relocations to be able to enforce this for symbols     not defined in this unit of translation, however.  */  if (TARGET_EXPLICIT_RELOCS && TARGET_SMALL_DATA)    return true;  /* Functions that are not external are defined in this UoT.  */  /* ??? Irritatingly, static functions not yet emitted are still     marked "external".  Apply this to non-static functions only.  */  return !TREE_PUBLIC (decl) || !DECL_EXTERNAL (decl);}/* Return true if EXP should be placed in the small data section.  */static boolalpha_in_small_data_p (tree exp){  /* We want to merge strings, so we never consider them small data.  */  if (TREE_CODE (exp) == STRING_CST)    return false;  /* Functions are never in the small data area.  Duh.  */  if (TREE_CODE (exp) == FUNCTION_DECL)    return false;  if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))    {      const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp));      if (strcmp (section, ".sdata") == 0	  || strcmp (section, ".sbss") == 0)	return true;    }  else    {      HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (exp));      /* If this is an incomplete type with size 0, then we can't put it	 in sdata because it might be too big when completed.  */      if (size > 0 && (unsigned HOST_WIDE_INT) size <= g_switch_value)	return true;    }  return false;}#if TARGET_ABI_OPEN_VMSstatic boolalpha_linkage_symbol_p (const char *symname){  int symlen = strlen (symname);  if (symlen > 4)    return strcmp (&symname [symlen - 4], "..lk") == 0;  return false;}#define LINKAGE_SYMBOL_REF_P(X) \  ((GET_CODE (X) == SYMBOL_REF   \    && alpha_linkage_symbol_p (XSTR (X, 0))) \   || (GET_CODE (X) == CONST                 \       && GET_CODE (XEXP (X, 0)) == PLUS     \       && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF \       && alpha_linkage_symbol_p (XSTR (XEXP (XEXP (X, 0), 0), 0))))#endif/* legitimate_address_p recognizes an RTL expression that is a valid   memory address for an instruction.  The MODE argument is the   machine mode for the MEM expression that wants to use this address.   For Alpha, we have either a constant address or the sum of a   register and a constant address, or just a register.  For DImode,   any of those forms can be surrounded with an AND that clear the   low-order three bits; this is an "unaligned" access.  */boolalpha_legitimate_address_p (enum machine_mode mode, rtx x, int strict){  /* If this is an ldq_u type address, discard the outer AND.  */  if (mode == DImode      && GET_CODE (x) == AND      && GET_CODE (XEXP (x, 1)) == CONST_INT      && INTVAL (XEXP (x, 1)) == -8)    x = XEXP (x, 0);  /* Discard non-paradoxical subregs.  */  if (GET_CODE (x) == SUBREG      && (GET_MODE_SIZE (GET_MODE (x))	  < GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))))    x = SUBREG_REG (x);  /* Unadorned general registers are valid.  */  if (REG_P (x)      && (strict	  ? STRICT_REG_OK_FOR_BASE_P (x)	  : NONSTRICT_REG_OK_FOR_BASE_P (x)))    return true;  /* Constant addresses (i.e. +/- 32k) are valid.  */  if (CONSTANT_ADDRESS_P (x))    return true;#if TARGET_ABI_OPEN_VMS  if (LINKAGE_SYMBOL_REF_P (x))    return true;#endif  /* Register plus a small constant offset is valid.  */  if (GET_CODE (x) == PLUS)    {      rtx ofs = XEXP (x, 1);      x = XEXP (x, 0);      /* Discard non-paradoxical subregs.  */      if (GET_CODE (x) == SUBREG          && (GET_MODE_SIZE (GET_MODE (x))	      < GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))))	x = SUBREG_REG (x);      if (REG_P (x))

⌨️ 快捷键说明

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