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: Porting gcc for F-CPU without direct JMP


On Dec 10, 2002, Hans-Peter Nilsson <hp@bitrange.com> wrote:

> On Tue, 10 Dec 2002, devik wrote:
>> I just tried to port GCC 3.2 to free CPU design
>> (www.f-cpu.org). The cpu is different in sense that
>> there is no direct jump (only indirect jump to preloaded
>> address in register).

> Have a look at the sh64 port hiding inside the sh port.
> It has the same trait; it needs branch targets in special branch
> target registers.  You should be able to use the same solution.

FWIW, the `solution´, that I'm not entirely proud of, is to leave it
up to reload to fix up branches, hope the scheduler will move the PT
instruction sufficiently away from the branches (i.e., no hoisting)
and forbidding branch redirections after reload through the target
hook TARGET_CANNOT_MODIFY_JUMPS_P.

Ideally, we should have tests to tell whether a branch can be
redirected, and even some form of emitting such branches that might
attempt to find a branch-target register available, but I haven't got
that far.  Currently, a lot of code just assumes that branches can be
redirected, and it's then hard to revert the effects when we get to
the point of realizing it was not possible to redirect the branch,
after all.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


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