Skip to content

Sign-extension Operators

These operators widen integers while preserving the sign of the smaller type.

(module
(func (export "ext8") (param $x i32) (result i32)
(i32.extend8_s (local.get $x)))
(func (export "ext16") (param $x i32) (result i32)
(i32.extend16_s (local.get $x)))
(func (export "ext32") (param $x i64) (result i64)
(i64.extend32_s (local.get $x)))
)