summaryrefslogtreecommitdiff
path: root/test/passes/optimize-instructions.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/passes/optimize-instructions.wast')
-rw-r--r--test/passes/optimize-instructions.wast70
1 files changed, 70 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions.wast b/test/passes/optimize-instructions.wast
index 8362453e9..c26aad196 100644
--- a/test/passes/optimize-instructions.wast
+++ b/test/passes/optimize-instructions.wast
@@ -2496,4 +2496,74 @@
(i32.const 4098) ;; 2 bits effectively
)
)
+ (func $mix-shifts (result i32)
+ (i32.shr_s
+ (i32.shl
+ (i32.const 23)
+ (i32.const -61)
+ )
+ (i32.const 168)
+ )
+ )
+ (func $actually-no-shifts (result i32)
+ (i32.add
+ (i32.shl
+ (i32.const 23)
+ (i32.const 32) ;; really 0
+ )
+ (i32.const 10)
+ )
+ )
+ (func $less-shifts-than-it-seems (param $x i32) (result i32)
+ (i32.add
+ (i32.shl
+ (i32.const 200)
+ (i32.const 36) ;; really 4
+ )
+ (i32.shl
+ (i32.const 100)
+ (i32.const 4)
+ )
+ )
+ )
+ (func $and-popcount32 (result i32)
+ (i32.and
+ (i32.popcnt
+ (i32.const -1)
+ )
+ (i32.const 31)
+ )
+ )
+ (func $and-popcount32-big (result i32)
+ (i32.and
+ (i32.popcnt
+ (i32.const -1)
+ )
+ (i32.const 63)
+ )
+ )
+ (func $and-popcount64 (result i64) ;; these are TODOs
+ (i64.and
+ (i64.popcnt
+ (i64.const -1)
+ )
+ (i64.const 63)
+ )
+ )
+ (func $and-popcount64-big (result i64)
+ (i64.and
+ (i64.popcnt
+ (i64.const -1)
+ )
+ (i64.const 127)
+ )
+ )
+ (func $and-popcount64-bigger (result i64)
+ (i64.and
+ (i64.popcnt
+ (i64.const -1)
+ )
+ (i64.const 255)
+ )
+ )
)