lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Sun, Feb 5, 2012 at 11:10 PM, Adam Strzelecki <> wrote:
> Another experiment is on making madd function that takes 2x16 arguments and returns 16 results shows that LuaJIT working on stack only is super fast ("done in 0.104428 seconds.") and produces clear and short assembly code, but the source code is really obscure.

I remember Francesco and I talking about preprocessing options. I did
a similar thing using LuaMacro:

Basically you define a macro factory which can generate individual
macros, so that 'local a = b' would expand as:

local a11, a21, a31, a41,a12, a22, a32, a42,a13, a23, a33, a43,a14,
a24, a34, a44 =  b11, b21, b31, b41,b12, b22, b32, b42,a13, b23, b33,
b43,b14, b24, b34, b44

I'll do some experiments and come up with a shorter notation.

steve d.