aboutsummaryrefslogtreecommitdiff
path: root/src/settings.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-29 18:38:52 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-10-29 18:52:24 -0700
commit0154b1effe2cde0ad81a1adcbe83b7c9d018dbbd (patch)
tree1dee9c9ad2edc3d860dc4deebb0696376a70b1ce /src/settings.js
parent2e50e7ca8ae5f6e18894c74fe4d33c90e404c6bc (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/settings.js')
-rw-r--r--src/settings.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/settings.js b/src/settings.js
index 3ea513cb..de9ab46c 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -115,7 +115,13 @@ var PRECISE_I64_MATH = 1; // If enabled, i64 addition etc. is emulated - which i
var PRECISE_I32_MUL = 1; // If enabled, i32 multiplication is done with full precision, which means it is
// correct even if the value exceeds the JS double-integer limit of ~52 bits (otherwise,
// rounding will occur above that range).
-var FROUND = 0; // Use Math.fround (polyfilling when necessary)
+var PRECISE_F32 = 0; // 0: Use JS numbers for floating-point values. These are 64-bit and do not model C++
+ // floats exactly, which are 32-bit.
+ // 1: Model C++ floats precisely, using Math.fround, polyfilling when necessary. This
+ // can be slow if the polyfill is used on heavy float32 computation.
+ // 2: Model C++ floats precisely using Math.fround if available in the JS engine, otherwise
+ // use an empty polyfill. This will have less of a speed penalty than using the full
+ // polyfill in cases where engine support is not present.
var CLOSURE_ANNOTATIONS = 0; // If set, the generated code will be annotated for the closure
// compiler. This potentially lets closure optimize the code better.