This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RFC: caller_save.c and i386


Hi
Current scheme of caller_save.c is to use HARD_REGNO_CALLER_SAVE_MODE to
determine mode to save register in.  This macro has two argument - hard regno
we want to save and how many next regnos we want.

Whole trick behind this interface is to allow saving of multiple registers
using single move, if architecture has such instructions.

For i386 (and other architectures) this brings however quite unpleasant results
comming from the fact, that register is always caller saved in the widest mode
given pseudo supports. For integers this brings partial register stalls, for
floats this hurts since XFmode spills are expensive and for SSE it hurts, since
128bit moves are deadly slow and it brings reformating penalty.

So I need way out.  Sadly changing current interface don't seems to be trivial.
My best idea is to introduce HARD_REGNO_CALLER_SAVE_SCHEME (REGNO, MODE, TRY_COMBINE, OUTMODE)
this macro will be called before each spill.  If we want to try combine, it
just sets TRY_COMBINE to nonzero and we will fall back to old code.  Otherwise
it sets TRY_COMBINE to 0 and OUTMODE to mode we want.

If move instruction don't exist (we can't caller save), we can just set OUTMODE
to VOIDmode.

Unlike with current scheme, we will not ensure that move instruction exist in
case we want

Does such solution sound sensible? Or someone does have idea of less
obfstructated interface?

Honza


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]