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

{{WebAssemblySidebar}}

The rotl instructions, short for rotate-left, are used for performing a bitwise left-rotate.

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

Syntax

;; load two numbers onto the stack i32.const 3758096384 ;; 11100000_00000000_00000000_00000000 i32.const 1 ;; left rotate one spot ;; perform a bitwise left-rotate i32.rotl ;; the top item on the stack will now be 3221225473 ;; (11000000_00000000_00000000_00000001)
InstructionBinary opcode
i32.rotl0x77
i64.rotl0x89