[Yhc] YHC on AMD64
shackell at cs.york.ac.uk
Thu Mar 9 17:23:43 EST 2006
Michał Pałka wrote:
> I've managed to run hello world with YHC on AMD64. This required
> changing the definition of UShort type from HALF_TYPE which is 32-bit
> int to short. The problem lied in mutator.c where jTable variable was
> meant to contain 2-byte integers but contained 4-byte integers on AMD64
> and jumps were calculated wrong.
Thanks indeed, I don't imagine that bug would have been easy to find.
> The patch I've attached is only for reference. I don't know what is the
> correct type for UShort (or maybe jTable shouldn't be UShort * ?).
Gah, that was a foolish oversight of mine! No the jtable shouldn't use a
UShort it should use a UInt16, it's always 2 bytes irrespective of
platform word size.
I'm tempted to kill UShort altogether and rename it UHalf, I've made
several mistakes using the wrong one. I'm amazed that HelloWorld still
worked with UShort as a 16bit int on a 64bit platform. I would have
expected that to break it.
> I wanted to run some tests and was pointed to src/tester by Neil.
> However, all the test failed because of some Makefile problems. Output
Well they don't quite all have make errors, but that is rather more than
> Do you have any nontrivial code that runs on YHC/i386? I would like to
> test it on my machine.
I don't know much about Neil's tester, so I'll let him answer that one ...
More information about the Yhc