From 34988152bb79df994b035745b82736d57f31f894 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 8 Jun 2015 12:39:03 -0800 Subject: Recategorize several integer operations "under consideration". ctz/clz/popcount/bswap - not nicely polyfillable (ES6 will have clz, but not all browsers will have that in the timeframe of the polyfill), but quite essential in a modern ISA. These can be done in software and pattern-matched, but except maybe ctz, the patterns are sufficiently gross that I don't expect these will be controversial. rot/min/max - nice to have, but not quite as essential, so put them in FutureFeatures.md. --- AstSemantics.md | 11 ----------- FutureFeatures.md | 11 +++++++++++ PostMVP.md | 6 ++++++ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/AstSemantics.md b/AstSemantics.md index 033a182..d6b7032 100644 --- a/AstSemantics.md +++ b/AstSemantics.md @@ -321,20 +321,9 @@ since "a < b" == "b > a" and "a <= b" == "b >= a". Such equalities also hold for floating point comparisons, even considering NaN. Additional 32-bit integer Operations under consideration: - * Int32SMulHigh - signed multiplication (upper 32-bits) * Int32UMulHigh - unsigned multiplication (upper 32-bits) - * Int32Clz - count leading zeroes (defined for all values, including 0) - * Int32Ctz - count trailing zeroes (defined for all values, including 0) - * Int32Popcnt - count number of ones - * Int32BSwap - reverse bytes (endian conversion) - * Int32Rotr - bitwise rotate right - * Int32Rotl - bitwise rotate left * Int32Not - signed-less one's complement - * Int32SMin - signed minimum - * Int32SMax - signed maximum - * Int32UMin - unsigned minimum - * Int32UMax - unsigned maximum ## Floating point operations diff --git a/FutureFeatures.md b/FutureFeatures.md index f8da587..e21cba7 100644 --- a/FutureFeatures.md +++ b/FutureFeatures.md @@ -213,3 +213,14 @@ use cases: things possible. Possibly this could involve throwing or possibly by resuming execution at the trapping instruction with the execution state altered, if there can be a reasonable way to specify how that should work. + +## Additional integer operations +* The following operations can be built from other operators already present, + however in doing so they read at least one non-constant input multiple times, + breaking single-use expression tree formation. + * Int32Rotr - bitwise rotate right + * Int32Rotl - bitwise rotate left + * Int32SMin - signed minimum + * Int32SMax - signed maximum + * Int32UMin - unsigned minimum + * Int32UMax - unsigned maximum diff --git a/PostMVP.md b/PostMVP.md index 9d4347f..191eb34 100644 --- a/PostMVP.md +++ b/PostMVP.md @@ -68,3 +68,9 @@ coroutines. Coroutine support is being [caveats]: https://blog.mozilla.org/nnethercote/2011/01/18/the-dangers-of-fno-exceptions [low-level capabilities]: https://extensiblewebmanifesto.org + +## Additional integer operations + * Int32Clz - count leading zeroes (defined for all values, including 0) + * Int32Ctz - count trailing zeroes (defined for all values, including 0) + * Int32Popcnt - count number of ones + * Int32BSwap - reverse bytes (endian conversion) -- cgit v1.2.3 From 3b9e3d2c99f071899c25765ba30ec36693f4a7fc Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 8 Jun 2015 12:39:09 -0800 Subject: Remve MulHigh operators from consideration. One of the main uses for these is implementing division-by-constant optimizations, and I think we can call on JITs to do those, so we don't need WebAssembly produers doing them and emitting larger WebAssembly code. For other uses, real 64-bit integers will work fairly well when we get those. --- AstSemantics.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/AstSemantics.md b/AstSemantics.md index d6b7032..a3014f8 100644 --- a/AstSemantics.md +++ b/AstSemantics.md @@ -321,8 +321,6 @@ since "a < b" == "b > a" and "a <= b" == "b >= a". Such equalities also hold for floating point comparisons, even considering NaN. Additional 32-bit integer Operations under consideration: - * Int32SMulHigh - signed multiplication (upper 32-bits) - * Int32UMulHigh - unsigned multiplication (upper 32-bits) * Int32Not - signed-less one's complement ## Floating point operations -- cgit v1.2.3 From 35a1f2fcfcb174f9dbe3775fc75cad140e97e55e Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 8 Jun 2015 12:39:14 -0800 Subject: 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. --- AstSemantics.md | 18 +++--------------- FutureFeatures.md | 9 +++++++++ PostMVP.md | 6 ++++++ 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 -- cgit v1.2.3 From e53a18cde5ea35e5e65dca7d39e2c5eb3d6a0dc5 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 8 Jun 2015 12:39:16 -0800 Subject: Add Bang and Neg operators under consideration. Bang is unary ! Neg is unary - --- AstSemantics.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/AstSemantics.md b/AstSemantics.md index 6143c8e..896f2f6 100644 --- a/AstSemantics.md +++ b/AstSemantics.md @@ -322,6 +322,8 @@ floating point comparisons, even considering NaN. Additional 32-bit integer Operations under consideration: * Int32Not - signed-less one's complement + * Int32Neg - two's complement negation + * Int32Bang - test equality with zero ## Floating point operations -- cgit v1.2.3 From c00ddd4345019805f9c01c93c354936002e60535 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 8 Jun 2015 12:39:18 -0800 Subject: Add a few more integer operations to FutureFeatures.md. --- FutureFeatures.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/FutureFeatures.md b/FutureFeatures.md index 5d60a04..8e32bc7 100644 --- a/FutureFeatures.md +++ b/FutureFeatures.md @@ -224,6 +224,11 @@ use cases: * Int32SMax - signed maximum * Int32UMin - unsigned minimum * Int32UMax - unsigned maximum + * Int32SExt - `sext(x, y)` is `x<>y` + * Int32Abs - absolute value (`abs(INT32_MIN)` is `INT32_MIN`) + +* The following operations are just potentially interesting. + * Int32Clrs - count leading redundant sign bits (defined for all values, including 0) ## Additional floating point operations -- cgit v1.2.3 From 071bc0fd8e9ce738f00a3f699c24460806058b38 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 8 Jun 2015 12:39:21 -0800 Subject: Move floating-point libary intrinsics into FutureFeatures.md. --- AstSemantics.md | 34 ---------------------------------- FutureFeatures.md | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/AstSemantics.md b/AstSemantics.md index 896f2f6..0cc4a31 100644 --- a/AstSemantics.md +++ b/AstSemantics.md @@ -413,37 +413,3 @@ overflow to infinity or negative infinity as specified by IEEE-754. Conversion from floating point to integer where IEEE-754 would specify an invalid operation exception (e.g. when the floating point value is NaN or outside the range which rounds to an integer in range) traps. - -## Post-MVP intrinsics - -The following list of intrinsics is being considered for addition after the MVP. The -rationale is that, for the MVP, these operations can be statically linked into the -WebAssembly module by the code generator at small size cost and this avoids a -non-trivial specification burden of their semantics/precision. Adding these -intrinsics post-MVP would allow for better high-level backend optimization of -these intrinsics that require builtin knowledge of their semantics. On the other -hand, a code generator may continue to statically link in its own implementation -since this provides greater control over precision/performance tradeoffs. - - * Float64Sin - trigonometric sine - * Float64Cos - trigonometric cosine - * Float64Tan - trigonometric tangent - * Float64ASin - trigonometric arcsine - * Float64ACos - trigonometric arccosine - * Float64ATan - trigonometric arctangent - * Float64ATan2 - trigonometric arctangent with two arguments - * Float64Exp - exponentiate e - * Float64Ln - natural logarithm - * Float64Pow - exponentiate - * Float32Sin - trigonometric sine - * Float32Cos - trigonometric cosine - * Float32Tan - trigonometric tangent - * Float32ASin - trigonometric arcsine - * Float32ACos - trigonometric arccosine - * Float32ATan - trigonometric arctangent - * Float32ATan2 - trigonometric arctangent with two arguments - * Float32Exp - exponentiate e - * Float32Ln - natural logarithm - * Float32Pow - exponentiate - -The rounding behavior of these operations would need clarification. diff --git a/FutureFeatures.md b/FutureFeatures.md index 8e32bc7..7eaca32 100644 --- a/FutureFeatures.md +++ b/FutureFeatures.md @@ -238,3 +238,37 @@ use cases: * 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. + +## Floating-point library intrinsics + +These operations aren't needed because they can be implemented in WebAssembly +code and linked into WebAssembly modules as at small size cost, and this avoids +a non-trivial specification burden of their semantics/precision. Adding these +intrinsics would allow for better high-level backend optimization of these +intrinsics that require builtin knowledge of their semantics. On the other +hand, a code generator may continue to statically link in its own +implementation since this provides greater control over precision/performance +tradeoffs. + + * Float64Sin - trigonometric sine + * Float64Cos - trigonometric cosine + * Float64Tan - trigonometric tangent + * Float64ASin - trigonometric arcsine + * Float64ACos - trigonometric arccosine + * Float64ATan - trigonometric arctangent + * Float64ATan2 - trigonometric arctangent with two arguments + * Float64Exp - exponentiate e + * Float64Ln - natural logarithm + * Float64Pow - exponentiate + * Float32Sin - trigonometric sine + * Float32Cos - trigonometric cosine + * Float32Tan - trigonometric tangent + * Float32ASin - trigonometric arcsine + * Float32ACos - trigonometric arccosine + * Float32ATan - trigonometric arctangent + * Float32ATan2 - trigonometric arctangent with two arguments + * Float32Exp - exponentiate e + * Float32Ln - natural logarithm + * Float32Pow - exponentiate + +The rounding behavior of these operations would need clarification. -- cgit v1.2.3 From 1578d64ffa884dae4cb57e286e16fc1ca94311d7 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 8 Jun 2015 12:39:23 -0800 Subject: Add FMA to FutureFeatures.md. --- FutureFeatures.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FutureFeatures.md b/FutureFeatures.md index 7eaca32..c38225b 100644 --- a/FutureFeatures.md +++ b/FutureFeatures.md @@ -234,8 +234,10 @@ use cases: * Float32MinNum - minimum; if exactly one operand is NaN, returns the other operand * Float32MaxNum - maximum; if exactly one operand is NaN, returns the other operand + * Float32FMA - fused multiply-add * Float64MinNum - minimum; if exactly one operand is NaN, returns the other operand * Float64MaxNum - maximum; if exactly one operand is NaN, returns the other operand + * Float64FMA - fused multiply-add MinNum, and MaxNum operations would treat -0 as being effectively less than 0. -- cgit v1.2.3 From 79b6d14866993c57bd4a81663bf3f8059f1ce0f6 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 10 Jun 2015 05:25:22 -0700 Subject: Fold "Operations which may not be available" into other sections. And add a paragraph about 128-bit floating-point support. Also specify that FMA would be IEEE-754 or not available. --- FutureFeatures.md | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/FutureFeatures.md b/FutureFeatures.md index c38225b..fff3cc7 100644 --- a/FutureFeatures.md +++ b/FutureFeatures.md @@ -152,13 +152,6 @@ include: [a proposal in the SIMD.js repository]: https://github.com/johnmccutchan/ecmascript_simd/issues/180 -## Operations which may not be available or may not perform well on all platforms - -* Fused multiply-add. -* Reciprocal square root approximate. -* 16-bit floating point. -* and more! - ## Platform-independent Just-in-Time compilation WebAssembly is a new virtual ISA, and as such applications won't be able to @@ -234,13 +227,43 @@ use cases: * Float32MinNum - minimum; if exactly one operand is NaN, returns the other operand * Float32MaxNum - maximum; if exactly one operand is NaN, returns the other operand - * Float32FMA - fused multiply-add + * Float32FMA - fused multiply-add (results always conforming to IEEE-754) * Float64MinNum - minimum; if exactly one operand is NaN, returns the other operand * Float64MaxNum - maximum; if exactly one operand is NaN, returns the other operand - * Float64FMA - fused multiply-add + * Float64FMA - fused multiply-add (results always conforming to IEEE-754) MinNum, and MaxNum operations would treat -0 as being effectively less than 0. +Note that some operations, like FMA, may not be available or may not perform +well on all platforms. These should be guarded by +[feature tests](FeatureTest.md) so that if available, they behave consistently. + +## Floating point approximation operations + + * Float32ReciprocalApproximation - reciprocal approximation + * Float64ReciprocalApproximation - reciprocal approximation + * Float32ReciprocalSqrtApproximation - reciprocal sqrt approximation + * Float64ReciprocalSqrtApproximation - reciprocal sqrt approximation + +These operations would not required to be fully precise, but the specifics +would need clarification. + +## 16-bit and 128-bit floating-point support + +For 16-bit floating-point support, it may make sense to split the feature +into two parts: support for just converting between 16-bit and 32-bit +formats possibly folded into load and store operations, and full support +for actual 16-bit arithmetic. + +128-bit is an interesting question because hardware support for it is very +rare, so it's usually going to be implemented with software emulation anyway, +so there's nothing preventing WebAssembly applications from linking to an +appropriate emulation library and getting similarly performant results. +Emulation libraries would have more flexibility to offer approximation +techniques such as double-double arithmetic. If we standardize 128-bit +floating point in WebAssembly, it will probably be standard IEEE-754 +quadruple precision. + ## Floating-point library intrinsics These operations aren't needed because they can be implemented in WebAssembly -- cgit v1.2.3 From b12be6709e1762804793c5fd22d3468c33c40026 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 10 Jun 2015 05:26:21 -0700 Subject: Mention that it might be a good idea for Abs overflow to trap. --- FutureFeatures.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FutureFeatures.md b/FutureFeatures.md index fff3cc7..1cccb12 100644 --- a/FutureFeatures.md +++ b/FutureFeatures.md @@ -218,7 +218,7 @@ use cases: * Int32UMin - unsigned minimum * Int32UMax - unsigned maximum * Int32SExt - `sext(x, y)` is `x<>y` - * Int32Abs - absolute value (`abs(INT32_MIN)` is `INT32_MIN`) + * Int32Abs - absolute value (is `abs(INT32_MIN)` `INT32_MIN` or should it trap?) * The following operations are just potentially interesting. * Int32Clrs - count leading redundant sign bits (defined for all values, including 0) -- cgit v1.2.3 From 5cbe16179caa899e50fda07e5988d2c97c951ce7 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 10 Jun 2015 09:13:37 -0700 Subject: Also mention conversion from float16 to float64. --- FutureFeatures.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FutureFeatures.md b/FutureFeatures.md index 1cccb12..0623143 100644 --- a/FutureFeatures.md +++ b/FutureFeatures.md @@ -251,9 +251,9 @@ would need clarification. ## 16-bit and 128-bit floating-point support For 16-bit floating-point support, it may make sense to split the feature -into two parts: support for just converting between 16-bit and 32-bit -formats possibly folded into load and store operations, and full support -for actual 16-bit arithmetic. +into two parts: support for just converting between 16-bit and 32-bit or +64-bit formats possibly folded into load and store operations, and full +support for actual 16-bit arithmetic. 128-bit is an interesting question because hardware support for it is very rare, so it's usually going to be implemented with software emulation anyway, -- cgit v1.2.3 From deb41fb73483c6c4b6e91d811b5f13809a0e8030 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 10 Jun 2015 13:08:19 -0700 Subject: Promote new proposed operations to the MVP. This is inspired by the reasoning for adding Int64 to the MVP: the polyfill isn't going to be worse than what compilers would have to lower these things into otherwise, and having them there means a nicer path forward to future versions. --- AstSemantics.md | 7 +++++++ FutureFeatures.md | 2 ++ PostMVP.md | 12 ------------ 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/AstSemantics.md b/AstSemantics.md index 0cc4a31..9c69085 100644 --- a/AstSemantics.md +++ b/AstSemantics.md @@ -306,6 +306,9 @@ and 0 representing false. * Int32Sle - signed less than or equal * Int32Ult - unsigned less than * Int32Ule - unsigned less than or equal + * Int32Clz - count leading zeroes (defined for all values, including 0) + * Int32Ctz - count trailing zeroes (defined for all values, including 0) + * Int32Popcnt - count number of ones Division or remainder by zero traps. Signed division overflow (`INT32_MIN / -1`) traps. Signed remainder with a @@ -358,6 +361,8 @@ Floating point arithmetic follows the IEEE-754 standard, except that: * Float32Copysign - copysign * Float32Ceil - ceiling operation * Float32Floor - floor operation + * Float32Trunc - round to nearest integer towards zero + * Float32NearestInt - round to nearest integer, ties to even * Float32Eq - compare equal * Float32Lt - less than * Float32Le - less than or equal @@ -374,6 +379,8 @@ Floating point arithmetic follows the IEEE-754 standard, except that: * Float64Copysign - copysign * Float64Ceil - ceiling operation * Float64Floor - floor operation + * Float64Trunc - round to nearest integer towards zero + * Float64NearestInt - round to nearest integer, ties to even * Float64Eq - compare equal * Float64Lt - less than * Float64Le - less than or equal diff --git a/FutureFeatures.md b/FutureFeatures.md index 0623143..f336e54 100644 --- a/FutureFeatures.md +++ b/FutureFeatures.md @@ -219,6 +219,8 @@ use cases: * Int32UMax - unsigned maximum * Int32SExt - `sext(x, y)` is `x<>y` * Int32Abs - absolute value (is `abs(INT32_MIN)` `INT32_MIN` or should it trap?) + * Int32BSwap - reverse bytes (endian conversion) + * Int32BSwap16 - `bswap16(x)` is `((x>>8)&255)|((x&255)<<8)` * The following operations are just potentially interesting. * Int32Clrs - count leading redundant sign bits (defined for all values, including 0) diff --git a/PostMVP.md b/PostMVP.md index a88da4a..9d4347f 100644 --- a/PostMVP.md +++ b/PostMVP.md @@ -68,15 +68,3 @@ coroutines. Coroutine support is being [caveats]: https://blog.mozilla.org/nnethercote/2011/01/18/the-dangers-of-fno-exceptions [low-level capabilities]: https://extensiblewebmanifesto.org - -## Additional integer operations - * Int32Clz - count leading zeroes (defined for all values, including 0) - * 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 -- cgit v1.2.3 From fa7f66f0dff2bb91ec25f3fbe864d2e2e4bd17cd Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 11 Jun 2015 17:03:45 -0700 Subject: Drop the rest of the ops under consideration. If we don't accept !=, we'll probably want to revisit some of these. --- AstSemantics.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/AstSemantics.md b/AstSemantics.md index 9c69085..0f3f309 100644 --- a/AstSemantics.md +++ b/AstSemantics.md @@ -323,11 +323,6 @@ Note that greater-than and greater-than-or-equal operations are not required, since "a < b" == "b > a" and "a <= b" == "b >= a". Such equalities also hold for floating point comparisons, even considering NaN. -Additional 32-bit integer Operations under consideration: - * Int32Not - signed-less one's complement - * Int32Neg - two's complement negation - * Int32Bang - test equality with zero - ## Floating point operations Floating point arithmetic follows the IEEE-754 standard, except that: -- cgit v1.2.3 From b83368d73725b77c0cf636d26ec631490c489a07 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 12 Jun 2015 10:10:22 -0700 Subject: Note that the min/max here are binary operators. --- AstSemantics.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AstSemantics.md b/AstSemantics.md index 0f3f309..b8f85d0 100644 --- a/AstSemantics.md +++ b/AstSemantics.md @@ -362,8 +362,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 + * Float32Min - minimum (binary operator); if either operand is NaN, returns NaN + * Float32Max - maximum (binary operator); if either operand is NaN, returns NaN * Float64Add - addition * Float64Sub - subtraction @@ -380,8 +380,8 @@ Floating point arithmetic follows the IEEE-754 standard, except that: * Float64Lt - less than * Float64Le - less than or equal * Float64Sqrt - square root - * Float64Min - minimum; if either operand is NaN, returns NaN - * Float64Max - maximum; if either operand is NaN, returns NaN + * Float64Min - minimum (binary operator); if either operand is NaN, returns NaN + * Float64Max - maximum (binary operator); if either operand is NaN, returns NaN Min and Max operations treat -0 as being effectively less than 0. -- cgit v1.2.3 From b2c9664a0b92a7480deb8d105be517577fa6b3ba Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 12 Jun 2015 14:26:41 -0700 Subject: Fix whitespace nit. --- FutureFeatures.md | 1 + 1 file changed, 1 insertion(+) diff --git a/FutureFeatures.md b/FutureFeatures.md index f336e54..21b3524 100644 --- a/FutureFeatures.md +++ b/FutureFeatures.md @@ -208,6 +208,7 @@ use cases: altered, if there can be a reasonable way to specify how that should work. ## Additional integer operations + * The following operations can be built from other operators already present, however in doing so they read at least one non-constant input multiple times, breaking single-use expression tree formation. -- cgit v1.2.3