Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

SIMD.%type%.splat()

この記事は編集レビューを必要としています。ぜひご協力ください

この翻訳は不完全です。英語から この記事を翻訳 してください。

This is an experimental technology, part of the ECMAScript 2016 (ES7) proposal.
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future version of browsers as the spec changes.

静的なSIMD.%type%.splat() メソッドは引数で与えられた値に設定されたレーン値をもつ新しいSIMDデータ型を生成します。

構文

SIMD.float32x4.splat(s)
SIMD.float64x2.splat(s)
SIMD.int8x16.splat(s)
SIMD.int16x8.splat(s)
SIMD.int32x4.splat(s)

引数

s Optional
すべてのレーンに設定する値。これは、int型に対してintegerであり、float型に対してdoubleです。

説明

SIMDデータ型を構築するときに、レーン値に対して複数の引数が期待されます。スプラット機能は、すべてのレーンのための単一の値を設定し、すぐに新しいSIMDデータ型を組み立てることができます。.

sを指定しない場合、int SIMD型のレーンは0に設定され、float SIMD型のレーンはNaNに設定されます。

SIMD.float32x4.splat(3);
// float32x4[3,3,3,3]

SIMD.float64x2.splat(3);
// float64x2[3,3]

SIMD.int8x16.splat(3);
// int8x16[3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]

SIMD.int16x8.splat(3);
// int16x8[3,3,3,3,3,3,3,3]

SIMD.int32x4.splat(3);
// int32x4[3,3,3,3]

仕様

SIMDはまだ公式規格文書やドラフトでサポートされていません。typed arraysに基づいた標準化作業や互換性実装のために、ecmascript_simd GitHub リポジトリを確かめて下さい。

ブラウザ実装状況

機能 Chrome Firefox (Gecko) Internet Explorer Opera Safari
基本サポート 未サポート Nightly build 未サポート 未サポート 未サポート
機能 Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
基本サポート 未サポート 未サポート Nightly build 未サポート 未サポート 未サポート

関連情報

ドキュメントのタグと貢献者

 このページの貢献者: shide55
 最終更新者: shide55,