aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJF Bastien <github@jfbastien.com>2016-02-29 09:03:13 -0500
committerJF Bastien <github@jfbastien.com>2016-02-29 09:03:13 -0500
commitc8137d9a6bdefd015f5daadd3f0eb233dc6996b6 (patch)
tree90d29c8f661d55cf01df88356ea346c91408c27d
parent61e60c57b34a360d43cbe6c46d9d96f018ae00d9 (diff)
parent18da0d7f629be0d95e0cb7d1053fcf1fda2dd943 (diff)
downloadnanowasm-design-c8137d9a6bdefd015f5daadd3f0eb233dc6996b6.tar.gz
Merge pull request #462 from mbodart/rotate
Move rotate instructions from FutureFeatures to AstSemantics.
-rw-r--r--AstSemantics.md7
-rw-r--r--FutureFeatures.md2
2 files changed, 7 insertions, 2 deletions
diff --git a/AstSemantics.md b/AstSemantics.md
index 267c2d3..8e2128b 100644
--- a/AstSemantics.md
+++ b/AstSemantics.md
@@ -382,6 +382,8 @@ results into the result type.
* `i32.shl`: sign-agnostic shift left
* `i32.shr_u`: zero-replicating (logical) shift right
* `i32.shr_s`: sign-replicating (arithmetic) shift right
+ * `i32.rotl`: sign-agnostic rotate left
+ * `i32.rotr`: sign-agnostic rotate right
* `i32.eq`: sign-agnostic compare equal
* `i32.ne`: sign-agnostic compare unequal
* `i32.lt_s`: signed less than
@@ -401,6 +403,11 @@ in the value to be shifted, as an unsigned quantity. For example, in a 32-bit
shift, only the least 5 significant bits of the count affect the result. In a
64-bit shift, only the least 6 significant bits of the count affect the result.
+Rotate counts are treated as unsigned. A count value greater than or equal
+to the number of bits in the value to be rotated yields the same result as
+if the count was wrapped to its least significant N bits, where N is 5 for
+an i32 value or 6 for an i64 value.
+
All comparison operators yield 32-bit integer results with `1` representing
`true` and `0` representing `false`.
diff --git a/FutureFeatures.md b/FutureFeatures.md
index 85ab6d9..31119f5 100644
--- a/FutureFeatures.md
+++ b/FutureFeatures.md
@@ -237,8 +237,6 @@ use cases:
* The following operators 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.
- * `i32.rotr`: sign-agnostic bitwise rotate right
- * `i32.rotl`: sign-agnostic bitwise rotate left
* `i32.min_s`: signed minimum
* `i32.max_s`: signed maximum
* `i32.min_u`: unsigned minimum