lua-users home
lua-l archive

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


On Fri, Jun 28, 2019 at 4:14 PM Egor Skriptunoff <egor.skriptunoff@gmail.com> wrote:
On Thu, Jun 13, 2019 at 4:36 PM Luiz Henrique de Figueiredo wrote:
We also welcome feedback on the listings output by luac -l -l, because
luac has been rewritten to account for the new VM instructions.



Shifts are displayed in non-user-friendly way.
What do 126 and 128 mean?

local x
local a, b = x<<1, x>>1

        1       [1]     VARARGPREP      0
        2       [1]     LOADNIL         0 0     ; 1 out
        3       [2]     SHRI            1 0 126
        4       [2]     SHRI            2 0 128
        5       [2]     RETURN          3 1 1   ; 0 out


I imagine they're expressed in excess-127, much like the exponents of IEEE floating-point numbers.

/s/ Adam