aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeidi Pan <heidi.pan@intel.com>2013-12-06 17:45:50 -0800
committerHeidi Pan <heidi.pan@intel.com>2013-12-06 17:45:50 -0800
commitfd3763f54ee3b576f634c17ae45e3211faacd616 (patch)
tree5b777e51a19ac4e862fce8f32f7698f8cb9cdb47 /src
parenteb083723747a90cb6ab9853fec8d6e8ef54748bc (diff)
updated simd.js to fix nan canonicalization issue for bitcasts
Diffstat (limited to 'src')
-rw-r--r--src/simd.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/simd.js b/src/simd.js
index c7f5ff48..818d9047 100644
--- a/src/simd.js
+++ b/src/simd.js
@@ -16,8 +16,6 @@
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
-
- https://github.com/johnmccutchan/ecmascript_simd/blob/master/src/ecmascript_simd.js
*/
"use strict";
@@ -848,8 +846,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.