aboutsummaryrefslogtreecommitdiff
path: root/AstSemantics.md
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 /AstSemantics.md
parent61e60c57b34a360d43cbe6c46d9d96f018ae00d9 (diff)
parent18da0d7f629be0d95e0cb7d1053fcf1fda2dd943 (diff)
downloadnanowasm-design-c8137d9a6bdefd015f5daadd3f0eb233dc6996b6.tar.gz
Merge pull request #462 from mbodart/rotate
Move rotate instructions from FutureFeatures to AstSemantics.
Diffstat (limited to 'AstSemantics.md')
-rw-r--r--AstSemantics.md7
1 files changed, 7 insertions, 0 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`.