diff options
author | Alon Zakai <azakai@google.com> | 2022-11-14 17:18:22 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-15 01:18:22 +0000 |
commit | 8225e485a24c5fa6fffb0c9f0a3ee8615bcfa0d9 (patch) | |
tree | d819d652ff357543a31a7e879057afab59e6003a /test/lit/passes | |
parent | a221b01b89ced3aa6335723e68bf17ea97377a08 (diff) | |
download | binaryen-8225e485a24c5fa6fffb0c9f0a3ee8615bcfa0d9.tar.gz binaryen-8225e485a24c5fa6fffb0c9f0a3ee8615bcfa0d9.tar.bz2 binaryen-8225e485a24c5fa6fffb0c9f0a3ee8615bcfa0d9.zip |
Add a pass to lower sign-ext operations to MVP (#5254)
Fixes #5250
Diffstat (limited to 'test/lit/passes')
-rw-r--r-- | test/lit/passes/signext-lowering.wast | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/test/lit/passes/signext-lowering.wast b/test/lit/passes/signext-lowering.wast new file mode 100644 index 000000000..f17479e53 --- /dev/null +++ b/test/lit/passes/signext-lowering.wast @@ -0,0 +1,66 @@ +;; NOTE: Assertions have been generated by update_lit_checks.py --all-items and should not be edited. + +;; RUN: wasm-opt %s --signext-lowering --enable-sign-ext -S -o - | filecheck %s + +(module + ;; CHECK: (type $0 (func)) + (type $0 (func)) + ;; CHECK: (func $signext + ;; CHECK-NEXT: (local $0 i32) + ;; CHECK-NEXT: (local $1 i64) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 24) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 24) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i64.shr_s + ;; CHECK-NEXT: (i64.shl + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i64.const 56) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i64.const 56) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i64.shr_s + ;; CHECK-NEXT: (i64.shl + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i64.const 48) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i64.const 48) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i64.shr_s + ;; CHECK-NEXT: (i64.shl + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i64.const 32) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i64.const 32) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $signext (type $0) + (local $0 i32) + (local $1 i64) + (drop (i32.extend8_s (local.get $0))) + (drop (i32.extend16_s (local.get $0))) + (drop (i64.extend8_s (local.get $1))) + (drop (i64.extend16_s (local.get $1))) + (drop (i64.extend32_s (local.get $1))) + ) +) |