---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 9 Edition"
java_version: 9
chapter: "Chapter 4. The class File Format"
section: "4.10.1.9.lshl"
heading: "lshl, lshr, lushr"
parent: "4.10.1.9. Type Checking Instructions"
source: https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.10.1.9.lshl
id: "4.10.1.9.lshl"
url: https://jvm.obfuscated.software/jvms/se9/4.10.1.9.lshl.html
raw: https://jvm.obfuscated.software/jvms/se9/4.10.1.9.lshl.md
---

# lshl, lshr, lushr

An *lshl* instruction is type safe if one can validly replace the types `int` and `long` on the incoming operand stack with the type `long` yielding the outgoing type state.

```
instructionIsTypeSafe(lshl, Environment, _Offset, StackFrame,
                      NextStackFrame, ExceptionStackFrame) :-
    validTypeTransition(Environment, [int, long], long,
                        StackFrame, NextStackFrame),
    exceptionStackFrame(StackFrame, ExceptionStackFrame).
```

An *lshr* instruction is type safe iff the equivalent *lshl* instruction is type safe.

```
instructionHasEquivalentTypeRule(lshr, lshl).
```

An *lushr* instruction is type safe iff the equivalent *lshl* instruction is type safe.

```
instructionHasEquivalentTypeRule(lushr, lshl).
```
