[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [f-cpu] new cjump instruction



hi,

devik wrote:

A few ideas from sw point of view. 12 bit "replacement"
part would force jump to fixed point within page unless
linker would fix it.
GCC could generate page aligned loop bodies but it will
need rewrite of BB reorg pass and will lead to suboptimal
branches sometimes.
Regarding MD's note about assembler labels - gcc has
provision for handling dynamic code size in order to
fix jumps in last compile stage.

On other side, register based jumps are pain in code with
many branches as they consume 1/3 of all insns.
I'd really like to see some kind of fast forward jump
in range about 8-32 insns.
For loops, register based jump is not so bad because
it can be loaded once and used many times. It doesn't
hold for small "switches" or frequent conditional branches
linked end to end (like in GCC source code generated from
..md).
Maybe jump within insn buffers ?

i would gladly have relative short jumps inside the Fetcher's buffer
but it ends up with most of the same problems (or lack of enhancements)
as the "replacement" (well, "displacement" and "replacement" are
two similar words, hence similar properties ? :-D)

"replacement" within 8 instructions (within the same line) is no problem at all,
because there is no check to do. Well, it won't go far.
Now, considering that any "touch" of a Fetcher's line triggers the fetch
of the next line, a "replacement" within 16 instructions becomes probable
but increases the number of checks : for example, if the short jump is
in the 1st instruction of the line, the increment of the line's base address,
thus the carry and the TLB have not even been checked so we don't know
whether it is possible to execute the branch. In order to avoid problems,
this situation must be detected, and any check requires time and resources,
increasing latency.

+/-32 range is possible because the register field uses 6 bits.
Negative jump is probable, given that the instructions have already been executed.
Now, there are increasing chances that something strange has appeared or will
appear, which increases the complexity of the checks....
For example, what about jumping to instruction -20 if there have been several
breaks in instruction flow ?

Unfortunately i can't discuss much about this now,
and i don't want to give false hopes.
jumps are bitches anyway ...

devik

YG

*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/