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

{{WebAssemblySidebar}}

The rotr instructions, short for rotate-right, are used for performing a bitwise right-rotate.

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

Syntax

;; load two numbers onto the stack i32.const 7 ;; 00000000_00000000_00000000_00000111 i32.const 1 ;; right rotate one spot ;; perform a bitwise right-rotate i32.rotr ;; the top item on the stack will now be 2147483651 ;; (10000000_00000000_00000000_00000011)
InstructionBinary opcode
i32.rotr0x78
i64.rotr0x8a