Some ppc jit questions

Wim Lewis wiml at hhhh.org
Mon Mar 16 09:08:09 UTC 2009


So I decided to introduce myself to the parrot internals by looking  
at the JIT. (Partly because I had to tweak it a bit to get it to run  
on my machine.) After looking at it a bit, I have some questions,  
mostly of the form "wouldn't it be better if X were done like Y?",  
and I hope that if the answer is "no, because of Z", or "no, it  
really doesn't matter", that my questions will not be taken amiss. :)  
Otherwise, perhaps I'll try to put together some patches.


- When loading 32-bit constants, the jit backend uses oris+ori,  
keeping a zero in r31 to base it off of. From reading compiler  
output, I'm more accustomed to seeing lis+ori, or li+addis, etc..,  
which seems simpler; it might also not consume an ALU cycle (I'm not  
familiar enough with ppc pipelining to know). Is there a reason for  
the oris+ori method?

- Likewise, r31 is used as a zero register, but many ppc instructions  
automatically read r0 as zero (for exactly this purpose, AIUI: li is  
actually addi ?,r0,?). Would it be helpful to free up r31 for general  
use? (Or is there not much register pressure in practice?)

- When emitting calls to Parrot_foo() functions, the code genrator  
loads the procedure address as a constant and calls it (via bctrl).  
For actual JIT use, this is fine, but for exec_save use, this seems  
like a pretty big potential lose. Would it be a bad thing to emit  
relocation entries for these calls?


Wim.




More information about the parrot-dev mailing list