---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 10 Edition"
java_version: 10
chapter: "Chapter 6. The Java Virtual Machine Instruction Set"
section: "6.5.lushr"
heading: "lushr"
parent: "6.5. Instructions"
source: https://docs.oracle.com/javase/specs/jvms/se10/html/jvms-6.html#jvms-6.5.lushr
id: "6.5.lushr"
url: https://jvm.obfuscated.software/jvms/se10/6.5.lushr.html
raw: https://jvm.obfuscated.software/jvms/se10/6.5.lushr.md
---

# lushr

## Operation

Logical shift right `long`

## Format

```
lushr
```

## Forms

*lushr* = 125 (0x7d)

## Operand Stack

..., *value1*, *value2* →

..., *result*

## Description

The *value1* must be of type `long`, and *value2* must be of type `int`. The values are popped from the operand stack. A `long` *result* is calculated by shifting *value1* right logically by *s* bit positions, with zero extension, where *s* is the value of the low 6 bits of *value2*. The *result* is pushed onto the operand stack.

## 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.
