W3cubDocs

/JavaScript

SIMD.fromFloat64x2Bits

SIMD.js has been taken out of active development in TC39 and removed from Stage 3. It is not being pursued by web browsers for implementation anymore. SIMD operations exposed to the web are under active development within WebAssembly, with operations based on the SIMD.js operations.

Note: The Float64x2 type is currently not part of the SIMD specification draft.

The static SIMD.%type%.fromFloat64x2Bits() method creates a new SIMD data type with a bit-wise copy from a Float64x2.

Syntax

SIMD.Float32x4.fromFloat64x2Bits(t)

SIMD.Int32x4.fromFloat64x2Bits(t)
SIMD.Int16x8.fromFloat64x2Bits(t)
SIMD.Int8x16.fromFloat64x2Bits(t)

SIMD.Uint32x4.fromFloat64x2Bits(t)
SIMD.Uint16x8.fromFloat64x2Bits(t)
SIMD.Uint8x16.fromFloat64x2Bits(t)

Parameters

t
A Float64x2 SIMD type to convert from (bitwise).

Return value

A new SIMD data type with a bit-wise copy from a Float64x2.

Examples

SIMD.Float32x4.fromFloat64x2Bits

var t = SIMD.Float64x2(2.0, 1.875);
SIMD.Float32x4.fromFloat64x2Bits(t);
// Float32x4[0, 2.0, 0, 1.984375]

SIMD.Int32x4.fromFloat64x2Bits

var t = SIMD.Float64x2(1.0, 2.0);
SIMD.Int32x4.fromFloat64x2Bits(t);
// Int32x4[0, 1072693248, 0, 1073741824]

SIMD.Int16x8.fromFloat64x2Bits

var t = SIMD.Float64x2(1.0, 2.0);
SIMD.Int16x8.fromFloat64x2Bits(t);
// Int16x8[0, 0, 0, 16368, 0, 0, 0, 16384]

SIMD.Int8x16.fromFloat64x2Bits

var t = SIMD.Float64x2(1.0, 2.0);
SIMD.Int8x16.fromFloat64x2Bits(t);
// Int8x16[0,0,0,0,0,0,-16,63,0,0,0,0,0,0,0,64]

Specifications

SIMD is not yet part of an official standards document or draft. For standardization work and a Polyfill implementation based on typed arrays, see the ecmascript_simd GitHub repository.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support No support Nightly build No support No support No support
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support No support No support Nightly build No support No support No support

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SIMD/fromFloat64x2Bits