Interpreter: simplify mask helper

This commit is contained in:
Tillmann Karras 2016-02-20 01:01:12 +00:00
parent af5ff9941a
commit b291b0a7c2

View file

@ -33,7 +33,7 @@ u32 Interpreter::Helper_Mask(int mb, int me)
//first make 001111111111111 part
u32 begin = 0xFFFFFFFF >> mb;
//then make 000000000001111 part, which is used to flip the bits of the first one
u32 end = me < 31 ? (0xFFFFFFFF >> (me + 1)) : 0;
u32 end = 0x7FFFFFFF >> me;
//do the bitflip
u32 mask = begin ^ end;
//and invert if backwards