aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/simd.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/simd.js b/src/simd.js
index c7f5ff48..6e3e3675 100644
--- a/src/simd.js
+++ b/src/simd.js
@@ -848,8 +848,11 @@ var SIMD = (function () {
* @return {float32x4} a bit-wise copy of t as a float32x4.
*/
bitsToFloat32x4: function(t) {
- var alias = new Float32Array(t.storage_.buffer);
- return new float32x4(alias[0], alias[1], alias[2], alias[3]);
+ var temp_storage = new Int32Array([t.storage_[0], t.storage_[1], t.storage_[2], t.storage_[3]]);
+ var alias = new Float32Array(temp_storage.buffer);
+ var fx4 = float32x4.zero();
+ fx4.storage_ = alias;
+ return fx4;
},
/**
* @param {int32x4} t An instance of int32x4.