diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/l-macro-imp-optimize.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/l-macro-imp-optimize.lua | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/l-macro-imp-optimize.lua b/Master/texmf-dist/tex/context/base/mkiv/l-macro-imp-optimize.lua index e04b37eab3c..7d7fafefde2 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/l-macro-imp-optimize.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/l-macro-imp-optimize.lua @@ -46,17 +46,22 @@ if LUAVERSION >= 5.3 and lua.macros then -- #define rshift(a,b) ((a >> b) & 0xFFFFFFFF) -- ]] - lua.macros.resolvestring [[ - #define band(a,b) (a&b) - #define bnot(a) (~a&0xFFFFFFFF) - #define bor(a,b) ((a|b)&0xFFFFFFFF) - #define btest(a,b) ((a&b)~=0) - #define bxor(a,b) ((a~b)&0xFFFFFFFF) - #define rshift(a,b) ((a&b)~=0) - #define extract(a,b,c) ((a>>b)&~(-1<<c)) - #define extract(a,b) ((a>>b)&0x1)) - #define lshift(a,b) ((a<<b)&0xFFFFFFFF) - #define rshift(a,b) ((a>>b)&0xFFFFFFFF) - ]] +lua.macros.resolvestring [[ +#define band(a,b) ((a)&(b)) +#define bnot(a) (~(a)&0xFFFFFFFF) +#define bor(a,b) (((a)|(b))&0xFFFFFFFF) +#define btest(a,b) (((a)&(b))~=0) +#define bxor(a,b) (((a)~(b))&0xFFFFFFFF) +#define rshift(a,b) (((a)&(b))~=0) +#define extract(a,b,c) (((a)>>(b))&~(-1<<(c))) +#define extract(a,b) (((a)>>(b))&0x1) +#define extract1(a,b) ((a >> b) & 0x01) +#define extract2(a,b) ((a >> b) & 0x03) +#define extract4(a,b) ((a >> b) & 0x0F) +#define lshift(a,b) (((a)<<(b))&0xFFFFFFFF) +#define rshift(a,b) (((a)>>(b))&0xFFFFFFFF) +#define intdiv(a,b) ((a)//(b)) +#define idiv(a,b) ((a)//(b)) +]] end |