aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <sunfish@mozilla.com>2015-06-08 12:39:14 -0800
committerDan Gohman <sunfish@mozilla.com>2015-06-12 14:26:17 -0700
commit35a1f2fcfcb174f9dbe3775fc75cad140e97e55e (patch)
tree7b6e9240a62c57749f355093e9fea749f3cb217b
parent3b9e3d2c99f071899c25765ba30ec36693f4a7fc (diff)
downloadnanowasm-design-35a1f2fcfcb174f9dbe3775fc75cad140e97e55e.tar.gz
Recategorize the floating-point operations "under consideration".
min/max - Promote these to base; they are all trivially polyfillable, and are useful things to have in the base platform besides. nearestInt - This is not trivially polyfillable (JavaScript's Math.round does tie-breaking wrong), so put it in EssentialPostMVPFeatures.md so it can join floor/ceil. trunc - This is not trivially polyfillable (in ES6, but not in all the browsers we need the polyfill to support), so put it in EssentialPostMVPFeatures.md so it can join floor/ceil/nearestInt in providing rouding to integer via all the standard roundings. minNum/maxNum - Put these in FutureFeatures.md for future consideration. They're not trivially polyfillable, and they're not obviously essential at this point, though they do have uses.
-rw-r--r--AstSemantics.md18
-rw-r--r--FutureFeatures.md9
-rw-r--r--PostMVP.md6
3 files changed, 18 insertions, 15 deletions
diff --git a/AstSemantics.md b/AstSemantics.md
index a3014f8..6143c8e 100644
--- a/AstSemantics.md
+++ b/AstSemantics.md
@@ -360,6 +360,8 @@ Floating point arithmetic follows the IEEE-754 standard, except that:
* Float32Lt - less than
* Float32Le - less than or equal
* Float32Sqrt - square root
+ * Float32Min - minimum; if either operand is NaN, returns NaN
+ * Float32Max - maximum; if either operand is NaN, returns NaN
* Float64Add - addition
* Float64Sub - subtraction
@@ -374,24 +376,10 @@ Floating point arithmetic follows the IEEE-754 standard, except that:
* Float64Lt - less than
* Float64Le - less than or equal
* Float64Sqrt - square root
-
-Operations under consideration:
-
- * Float32Min - minimum; if either operand is NaN, returns NaN
- * Float32Max - maximum; if either operand is NaN, returns NaN
- * Float32MinNum - minimum; if exactly one operand is NaN, returns the other operand
- * Float32MaxNum - maximum; if exactly one operand is NaN, returns the other operand
- * Float32Trunc - round to nearest integer towards zero
- * Float32NearestInt - round to nearest integer, ties to even
-
* Float64Min - minimum; if either operand is NaN, returns NaN
* Float64Max - maximum; if either operand is NaN, returns NaN
- * Float64MinNum - minimum; if exactly one operand is NaN, returns the other operand
- * Float64MaxNum - maximum; if exactly one operand is NaN, returns the other operand
- * Float64Trunc - round to nearest integer towards zero
- * Float64NearestInt - round to nearest integer, ties to even
-Min, Max, MinNum, and MaxNum operations would treat -0 as being effectively less than 0.
+Min and Max operations treat -0 as being effectively less than 0.
## Datatype conversions, truncations, reinterpretations, promotions, and demotions
diff --git a/FutureFeatures.md b/FutureFeatures.md
index e21cba7..5d60a04 100644
--- a/FutureFeatures.md
+++ b/FutureFeatures.md
@@ -224,3 +224,12 @@ use cases:
* Int32SMax - signed maximum
* Int32UMin - unsigned minimum
* Int32UMax - unsigned maximum
+
+## Additional floating point operations
+
+ * Float32MinNum - minimum; if exactly one operand is NaN, returns the other operand
+ * Float32MaxNum - maximum; if exactly one operand is NaN, returns the other operand
+ * Float64MinNum - minimum; if exactly one operand is NaN, returns the other operand
+ * Float64MaxNum - maximum; if exactly one operand is NaN, returns the other operand
+
+MinNum, and MaxNum operations would treat -0 as being effectively less than 0.
diff --git a/PostMVP.md b/PostMVP.md
index 191eb34..a88da4a 100644
--- a/PostMVP.md
+++ b/PostMVP.md
@@ -74,3 +74,9 @@ coroutines. Coroutine support is being
* Int32Ctz - count trailing zeroes (defined for all values, including 0)
* Int32Popcnt - count number of ones
* Int32BSwap - reverse bytes (endian conversion)
+
+## Additional floating point operations
+ * Float32Trunc - round to nearest integer towards zero
+ * Float32NearestInt - round to nearest integer, ties to even
+ * Float64Trunc - round to nearest integer towards zero
+ * Float64NearestInt - round to nearest integer, ties to even