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]
Other format: [Raw text]

Re: Machine description


Jean Christophe Beyler <jean.christophe.beyler@gmail.com> writes:

> I've been working on the Machine description of my target and was
> wondering if you could help me out here.
>
> I've been trying to force GCC out of it's habit of generating this code :
> (insn 28 8 10 2 glob.c:13 (set (reg:DI 9 r9)
>         (mem/s:DI (symbol_ref:DI ("data") <var_decl 0xb7e39688 data>)
> [4 data+0 S8 A64])) 71 {*movdi_internal1} (nil))
>
> -> Load r9, 0(data)
>
> Because, in my target it's costly to do so, I would prefer :
>
> Mov r10, data
> Load r9, 0(r10)
>
> This way, GCC can optimize this by taking the first move out of the
> loop for example. Otherwise, I have do a final pass but that's too
> late for all the optimizations.
>
> My problem is that I've defined the define_expand "movdi" and it only
> sees the right case after reload is in progress or completed.
> Therefore, I can't create any new pseudos.
>
> Any ideas on how to do this, I've been looking at the other
> architectures but haven't seen anything that resembles this,

This looks somewhat difficcult.  I would suggest having the movMM
expander generate the two instruction sequence when can_create_pseudo_p
returns true.  Then set the costs so that a load from an address plus an
offset is expensive.

Ian


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