LaTeX format for LuaMetaTeX
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

21 lines
431 B

local mask32 = 0xFFFFFFFF
return {
rshift = function(i, s)
return (mask32 & i) >> s
end,
lshift = function(i, s)
return mask32 & (i << s)
end,
band = function(i, j)
return i & j & mask32
end,
bor = function(i, j)
return (i | j) & mask32
end,
bor = function(i, j)
return (i ^ j) & mask32
end,
extract = function(v, shift, count)
return ((mask32 & v) >> shift) & ((1<<count)-1)
end,
}