Long integer logical shift right
Bytecode
Type | Description |
u1 | lushr opcode = 0x7D (125) |
Stack ..., value1.word1, value1.word2, value2 => ..., result.word1, result.word2
Description
Pops an integer and a long integer and from the stack. Shifts value2 (the long
integer) right by the amount indicated in the low six bits of value1 (an int). The
long integer result is then pushed back onto the stack. The value is shifted
logically (ignoring the sign extension - useful for unsigned values).
; This is like the Java code: ; long x; ; x >>>= 3; ; lload_1 ; load long in local variable 1 onto stack iconst_3 ; push the integer 3 onto the stack lushr ; logical shift right lstore_1 ; store the long result in local variable 1
Notes
If value1 is positive and s
is value2
& 0x3f, the result is the same as that of value1 \>\> s
; if value1
is negative, the result is equal to the value of the expression (value1 \>\> s
)
+ (2L << ~s). The addition of the (2L << ~
s) term cancels out the propagated sign bit. The shift
distance actually used is always in the range 0 to 63, inclusive.