|
A point for occasional readers:"patched" means Enrico's local patch. LNUM aka "integer patch" does not need bytecode conversion since it fully supports both integer and floating point numbers. It's just optimizing for the integer speed, whereas Enrico's case is running entirely integers only (my guess).
-asko Enrico Colombini kirjoitti 26.10.2007 kello 23:42:
Luiz Henrique de Figueiredo wrote:Just to be clear, if the sizes of double and the endianness in both platforms match, then this should work: static lua_Number LoadNumber(LoadState* S) { double x; LoadVar(S,x); return (lua_Number) x; } But you still need to change LoadHeader to skip some bytes: IF (memcmp(h,s,LUAC_HEADERSIZE-2)!=0, "bad header");Thanks. That's interesting because I could use the same compiled files with patched (to use ints) and unpatched interpreters. I wonder how slow the double-->int conversion will be on a machine without fp coprocessor, but I'll find out.Enrico