CSE fold_rtx subreg patch
John Wehle
john@feith.com
Mon Jul 13 15:26:00 GMT 1998
> Well, I guess what I want to know is exactly why you changed < to <=.
> The rest was pure speculation about why you might have changed it and
> possibilities for avoiding that change.
Your speculation was right on the money in this case. I changed < to <=
because COSTS returned the same value for the REG and the equivalent
SUBREG for the example in question.
> Maybe we should change this -- a SUBREG which narrows an operand may
> be a win on machines like the x86, m68k and maybe others when compared
> to the wider register.
Maybe. Sounds like a large change (in terms of possible side effects).
Currently COST returns:
0 (REG && CHEAP_REG) || (SUBREG && CHEAP_REG (SUBREG_REG))
1 (REG && !CHEAP_REG && REGNO >= FIRST_PSEUDO_REGISTER)
|| (SUBREG && !CHEAP_REG (SUBREG_REG)
&& REGNO (SUBREG_REG) >= FIRST_PSEUDO_REGISTER)
2 (REG && !CHEAP_REG && REGNO < FIRST_PSEUDO_REGISTER
|| (SUBREG && !CHEAP_REG (SUBREG_REG)
&& REGNO (SUBREG_REG) < FIRST_PSEUDO_REGISTER)
and doesn't call rtx_cost for a REG or a TRULY_NOOP_TRUNCATION SUBREG.
COST would have to be changed so it calls rtx_cost for a REG or a
TRULY_NOOP_TRUNCATION SUBREG and rtx_cost would have be changed
so that RTX_COSTS could override the default REG and SUBREG
costs.
Currently rtx_cost returns:
0 REG && CHEAP_REG
1 REG && !CHEAP_REG
2 SUBREG && MODES_TIEABLE_P
It would have to be changed to return:
0 SUBREG && MODES_TIEABLE_P && SUBREG is better than REG
1 REG && CHEAP_REG
2 REG && !CHEAP_REG
3 SUBREG && MODES_TIEABLE_P && SUBREG is worse than REG
This could be done either by changing the defaults to be:
1 REG && CHEAP_REG
2 REG && !CHEAP_REG
3 SUBREG && MODES_TIEABLE_P
and have i386.h override the SUBREG && MODES_TIEABLE_P case which
means that all the files which define RTX_COSTS will have to be
updated (since the meaning of the range associated with RTX_COSTS
has changed). Or by leaving the defaults alone and have i386.h
override the three cases which means that the i386 will be using
a different meaning for the range for RTX_COSTS than other processors.
-- John
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------
More information about the Gcc-patches
mailing list