Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/webassembly/reference/numeric/left_shift/index.md
6510 views
---
title: Left shift slug: WebAssembly/Reference/Numeric/Left_shift
---

{{WebAssemblySidebar}}

The shl instructions, short for shift-left, are used for performing a bitwise left-shift, similar to the << operator in other languages.

{{EmbedInteractiveExample("pages/wat/shl.html", "tabbed-taller")}}

Syntax

;; load two numbers onto the stack i32.const 7 ;; 00000111 i32.const 1 ;; left shift one spot ;; perform a bitwise left-shift i32.shl ;; the top item on the stack will now be 14 (00001110)
InstructionBinary opcode
i32.shl0x74
i64.shl0x86