View | Details | Raw Unified | Return to bug 19680 | Differences between
and this patch

Collapse All | Expand All | Context: (Patch / File /
)

(-)gcc/gcc/config/i386/i386-protos.h (-1 / +2 lines)
 Lines 180-186   extern rtx ix86_force_to_memory (enum ma Link Here 
180
extern void ix86_free_from_memory (enum machine_mode);
180
extern void ix86_free_from_memory (enum machine_mode);
181
extern void ix86_split_fp_branch (enum rtx_code code, rtx, rtx,
181
extern void ix86_split_fp_branch (enum rtx_code code, rtx, rtx,
182
				  rtx, rtx, rtx, rtx);
182
				  rtx, rtx, rtx, rtx);
183
extern int ix86_hard_regno_mode_ok (int, enum machine_mode);
183
extern bool ix86_hard_regno_mode_ok (int, enum machine_mode);
184
extern bool ix86_modes_tieable_p (enum machine_mode, enum machine_mode);
184
extern int ix86_register_move_cost (enum machine_mode, enum reg_class,
185
extern int ix86_register_move_cost (enum machine_mode, enum reg_class,
185
				    enum reg_class);
186
				    enum reg_class);
186
extern int ix86_secondary_memory_needed (enum reg_class, enum reg_class,
187
extern int ix86_secondary_memory_needed (enum reg_class, enum reg_class,
(-)gcc/gcc/config/i386/i386.c (-1 / +63 lines)
 Lines 14997-15003   ix86_register_move_cost (enum machine_mo Link Here 
14997
}
15031
}
14998
15032
14999
/* Return 1 if hard register REGNO can hold a value of machine-mode MODE.  */
15033
/* Return 1 if hard register REGNO can hold a value of machine-mode MODE.  */
15000
int
15034
15035
bool
15001
ix86_hard_regno_mode_ok (int regno, enum machine_mode mode)
15036
ix86_hard_regno_mode_ok (int regno, enum machine_mode mode)
15002
{
15037
{
15003
  /* Flags and only flags can only hold CCmode values.  */
15038
  /* Flags and only flags can only hold CCmode values.  */
 Lines 15038-15043   ix86_hard_regno_mode_ok (int regno, enum Link Here 
15038
  return reload_in_progress || reload_completed || !TARGET_PARTIAL_REG_STALL;
15073
  return reload_in_progress || reload_completed || !TARGET_PARTIAL_REG_STALL;
15039
}
15074
}
15040
15075
15076
/* A subroutine of ix86_modes_tieable_p.  Return true if MODE is a 
15077
   tieable integer mode.  */
15078
15079
static bool
15080
ix86_tieable_integer_mode_p (enum machine_mode mode)
15081
{
15082
  switch (mode)
15083
    {
15084
    case HImode:
15085
    case SImode:
15086
      return true;
15087
15088
    case QImode:
15089
      return TARGET_64BIT || !TARGET_PARTIAL_REG_STALL;
15090
15091
    case DImode:
15092
      return TARGET_64BIT;
15093
15094
    default:
15095
      return false;
15096
    }
15097
}
15098
15099
/* Return true if MODE1 is accessible in a register that can hold MODE2
15100
   without copying.  That is, all register classes that can hold MODE2
15101
   can also hold MODE1.  */
15102
15103
bool
15104
ix86_modes_tieable_p (enum machine_mode mode1, enum machine_mode mode2)
15105
{
15106
  if (mode1 == mode2)
15107
    return true;
15108
15109
  if (ix86_tieable_integer_mode_p (mode1)
15110
      && ix86_tieable_integer_mode_p (mode2))
15111
    return true;
15112
15113
  /* MODE2 being XFmode implies fp stack or general regs, which means we
15114
     can tie any smaller floating point modes to it.  Note that we do not
15115
     tie this with TFmode.  */
15116
  if (mode2 == XFmode)
15117
    return mode1 == SFmode || mode1 == DFmode;
15118
15119
  /* MODE2 being DFmode implies fp stack, general or sse regs, which means
15120
     that we can tie it with SFmode.  */
15121
  if (mode2 == DFmode)
15122
    return mode1 == SFmode;
15123
15124
  /* If MODE2 is only appropriate for an SSE register, then tie with 
15125
     any other mode acceptable to SSE registers.  */
15126
  if (SSE_REG_MODE_P (mode2))
15127
    return ix86_hard_regno_mode_ok (FIRST_SSE_REG, mode1);
15128
15129
  /* If MODE2 is appropriate for an MMX (or SSE) register, then tie
15130
     with any other mode acceptable to MMX registers.  */
15131
  if (MMX_REG_MODE_P (mode2))
15132
    return ix86_hard_regno_mode_ok (FIRST_MMX_REG, mode1);
15133
15134
  return false;
15135
}
15136
15041
/* Return the cost of moving data of mode M between a
15137
/* Return the cost of moving data of mode M between a
15042
   register and memory.  A value of 2 is the default; this cost is
15138
   register and memory.  A value of 2 is the default; this cost is
15043
   relative to those in `REGISTER_MOVE_COST'.
15139
   relative to those in `REGISTER_MOVE_COST'.
(-)gcc/gcc/config/i386/i386.h (-10 / +1 lines)
 Lines 1122-1137   do { \ Link Here 
1122
   If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
1122
   If HARD_REGNO_MODE_OK could produce different values for MODE1 and MODE2,
1123
   for any hard reg, then this must be 0 for correct output.  */
1123
   for any hard reg, then this must be 0 for correct output.  */
1124
1124
1125
#define MODES_TIEABLE_P(MODE1, MODE2)				\
1125
#define MODES_TIEABLE_P(MODE1, MODE2)  ix86_modes_tieable_p (MODE1, MODE2)
1126
  ((MODE1) == (MODE2)						\
1127
   || (((MODE1) == HImode || (MODE1) == SImode			\
1128
	|| ((MODE1) == QImode					\
1129
	    && (TARGET_64BIT || !TARGET_PARTIAL_REG_STALL))	\
1130
        || ((MODE1) == DImode && TARGET_64BIT))			\
1131
       && ((MODE2) == HImode || (MODE2) == SImode		\
1132
	   || ((MODE2) == QImode				\
1133
	       && (TARGET_64BIT || !TARGET_PARTIAL_REG_STALL))	\
1134
	   || ((MODE2) == DImode && TARGET_64BIT))))
1135
1126
1136
/* It is possible to write patterns to move flags; but until someone
1127
/* It is possible to write patterns to move flags; but until someone
1137
   does it,  */
1128
   does it,  */

Return to bug 19680