On 2011-03-04, at 4:40 PM, Erick Lavoie wrote:
Bootstrapping on 64 bits won't be trivial as I've found two issues today:
- It is not possible to do a call/jump with a 64 bits relative offset.
It breaks the way we implemented static calls so far (by computing an offset between the destination address and the call site at linking time). We need this to call malloc/free/exit/puts because they are mapped too far in the address space of the process. Maxime suggested that we always do a move in a register before the call/jump. This way we can move a 64 bits absolute address into a 64 bits register, avoiding the relative offset problem. The function call protocol needs to be changed to support this.
I don't see a problem here. 32 bit relative addresses are sufficient. We can assume programs will never have more than 2 GB of code.
- We assumed sizeof(int) == sizeof(void *) in the d8 extensions we
wrote and in the Tachyon C proxy generation. We will need to change it to adequately support 64 bits.
That should be easy to fix.
At this point, I don't know if those are the only issues we will encounter to allow bootstrapping on 64 bits in addition to debugging latent bugs. It might be faster to go the GC way and come back after for 64 bits support. What do you guys think?
Do the 64 bit port first. I don't think it will be more than a day of work, and the changes needed will be fairly permanent (i.e. not just a quick workaround).
Marc