i64.extend32_s
Pops an i64 value off the stack, only looks at the first 32 bits, converts it into an i64 value, and then pushes it back on to the stack. This only looks at the first 32 bits of the 64 bit integer. The other bits are lost. The 32th bit is used as a sign flag, therefore it is treated as a signed 32 bit number.

Syntax

i64.extend32_s

Stack In

i64 The value to be converted.

Stack Out

i64 The i64 version of the first 32 bits of the i64 value.

Examples

;; Convert i64 0x00000001 (1) into an i64 value
i64.const 1
i64.extend32_s

;; The stack contains an i64 value of 0x00000001
;; Convert i64 0x3224BA83AB124129 into an i64 value
i64.const 0x3224BA83AB124129
i64.extend32_s

;; The stack contains an i64 value of 0x00000000AB124129
;; Convert i64 0x32C56B21FB12F129 (0xFB12F129 = -82644695 as signed 16 bit)
;; into an i64 value
i64.const 0x32C56B21FB12F129
i64.extend16_s

;; The stack contains an i64 value of 0xFFFFFFFFFB12F129 (-82644695
;; as signed 64 bit integer)