MDN self-hosted library · e01.org

demote_f64x2_zero: Wasm SIMD conversion instruction

The demotef64x2zero SIMD conversion instruction converts the lanes of a v128 f64x2 value interpretation into an f32x4 value interpretation. The two higher lanes of the result are initialized to zero.

no runnable cells webassembly-instruction upstream source

The demote_f64x2_zero SIMD conversion instruction converts the lanes of a v128 f64x2 value interpretation into an f32x4 value interpretation. The two higher lanes of the result are initialized to zero.

tabbed-taller

```wat interactive-example (module (import "console" "log" (func $log (param f32))) (func $main v128.const f64x2 0x3 0x3a

f32x4.demote_f64x2_zero
f32x4.extract_lane 1
call $log ;; log the result

) (start $main) )


```js interactive-example
WebAssembly.instantiateStreaming(fetch("{%wasm-url%}"), { console });

Syntax

value_type.demote_f64x2_zero
  • value_type
  • : The type of value the instruction is being run on. The following v128 value interpretations support demote_f64x2_zero:
    • f32x4
  • demote_f64x2_zero
  • : The demote_f64x2_zero instruction. Must always be included after the value_type and a period (.).

Type

[input] -> [output]
  • input
  • : The input v128 f64x2 value interpretation.
  • output
  • : The output v128 f32x4 value interpretation.

Binary encoding

Instruction Binary format Example text => binary
f32x4.demote_f64x2_zero 0xfd 94:u32 f32x4.demote_f64x2_zero => 0xfd 0x5e

Specifications

Browser compatibility