lua-users home
lua-l archive

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


On Wed, 14 Nov 2018 at 20:55, Dibyendu Majumdar <mobile@majumdar.org.uk> wrote:
>
> I have changed your program as follows to help Ravi:
>
> local function f()
>    local tm = os.clock()
>    local o: integer = 0
>    for j = 1, 10000 do
>       local x: integer = 0
>       for k = 1, 100000 do
>          x = x ~ (j + k)
>       end
>       o = o | x
>    end
>    print("   Result = "..o)
>    print("   CPU time = "..(os.clock() - tm))
> end

> For some reason the above modified version fails to JIT compile with
> the OMR JIT backend; I need to investigate this.

Okay its because in the OMR backend (included in Ravi Distro) I
haven't yet implemented the JITing of bitwise Ravi extension opcodes.
The standard Lua bitwise opcodes are handled via function calls in the
OMR backend, so they degrade performance.
The LLVM backend does handle all of them, although the Lua opcodes do
not tend to optimize well due to excessive branching.

I will look at adding the bitwise opcodes to the OMR backend.

Regards
Dibyendu