i32.shr_u
Pops two i32 values off the stack, shift the first value to the right by the second number of bits, and then pushes the result back on to the stack. This looks at the value as an unsigned integer (positive values only). The new bit on the left (the most significant bit) will always be a 0.
$result = $first >>> $second

Syntax

i32.shr_u

Stack In

i32 The first value to be shifted right.
i32 The second value to shift the bits by.

Stack Out

i32 The result of shifting the first value right by the second value's number of bits.

Examples

;; Push the i32 value 0b00101011 (43) onto the stack
i32.const 43

;; Push the i32 value 2 onto the stack
i32.const 2

;; Pop the two i32 values off the stack, shift the first value right
;; by the second value's number of bits and push the result
;; back onto the stack
i32.shr_u

;; The stack contains an i32 value of 0b00001010 (10)
;; Push the i32 value 0xF1234567 (4045620583) onto the stack
i32.const 0xF1234567

;; Push the i32 value 4 onto the stack
i32.const 4

;; Shift right again (it is seen as positive)
i32.shr_u

;; The stack contains an i32 value of 0x0F123456 (252851286)