[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Lua on the PlayStation2
- From: Chris Chapman <Chris.chapman@...>
- Date: Mon, 6 Oct 2003 14:07:46 +0100
Sorry, I thought immediately after I sent it that I should have stated
version. We are using lua-4.0.1 which has double in a few places. On
browsing over the 5.0 code it seems they have been fixed. :)
We are hoping to upgrade to 5.0 as soon as possible, but when I tried it
last time there was an obscure crash and I couldn't easily track it in the
limited time available. Would I be right to hazard a guess that 5.0 is a bit
more PS2 friendly that 4.0.1 then? If so I will prioritise upgrading over
tracking this obscure GC/64-bit operation bug.
From: Luiz Henrique de Figueiredo [mailto:firstname.lastname@example.org]
Sent: 06 October 2003 13:56
Subject: Re: Lua on the PlayStation2
>What seems to be happening is that the 64-bit unsigned integers in the lua
>state (->GCthreshold and ->nblocks) are being corrupted, because as far as
>can see the compilers are generating 32-bit arithmetic instructions for the
>garbage collection/ string table resizing routines.
I'm not sure where the problem lies or whether it's the compiler's fault,
if something can be done in the source code to avoid this, we'd like to hear
We definitely want to see Lua running on the PS2 as smoothly as possible.
Lua on the PS2 has been mentioned before in this list. I think it ran ok.
>When we ran our game through the Performance Analyser, Lua showed up as the
>worst single culprit for performance, and a lot of that was due to double
>precision operations. Even after defining LUA_NUM_TYPE to be float instead
>of double, there are still many functions both in the API and internally
>which expect double precision arguments.
That's odd. There's no mention of double in the code. Perhaps you mean the
use of strtod in lua_str2number and sprintf in lua_number2str. These can be
redefined if necessary.
>Does anyone know what the
>implications of a global search and replace for float to double would be?
Like I said, there are no explict doubles. (What version of Lua are you
>How many of the 64 bit values (long is 64 bit on a PlayStation2) used
>throughout the library are actually required to be 64-bit?
None. See lu_hash and lu_mem in llimits.h.