diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-10-29 18:38:52 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-10-29 18:52:24 -0700 |
commit | 0154b1effe2cde0ad81a1adcbe83b7c9d018dbbd (patch) | |
tree | 1dee9c9ad2edc3d860dc4deebb0696376a70b1ce /src/preamble.js | |
parent | 2e50e7ca8ae5f6e18894c74fe4d33c90e404c6bc (diff) |
add test for precise float32 support, allow 3 modes of precise float32 support, and rename option to PRECISE_F32 to be consistent with other precision options
Diffstat (limited to 'src/preamble.js')
-rw-r--r-- | src/preamble.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/preamble.js b/src/preamble.js index f00e59e0..8ab6d604 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -1074,8 +1074,13 @@ Math['imul'] = function(a, b) { #endif Math.imul = Math['imul']; -#if FROUND +#if PRECISE_F32 +#if PRECISE_F32 == 1 +var froundBuffer = new Float32Array(1); +if (!Math['fround']) Math['fround'] = function(x) { froundBuffer[0] = x; return froundBuffer[0] }; +#else // 2 if (!Math['fround']) Math['fround'] = function(x) { return x }; +#endif Math.fround = Math['fround']; #endif |