From db64c53579dd925fc48260d4979d1bb9c1dfed9f Mon Sep 17 00:00:00 2001 From: Max Graey Date: Thu, 12 Nov 2020 20:18:44 +0200 Subject: Some refactorings in addition to #3338 (#3336) See discussion in #3303 --- .../passes/optimize-instructions_all-features.wast | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'test/passes/optimize-instructions_all-features.wast') diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast index 5804c1b2a..24e8a9d61 100644 --- a/test/passes/optimize-instructions_all-features.wast +++ b/test/passes/optimize-instructions_all-features.wast @@ -5360,6 +5360,58 @@ ) (i32.const 0) )) + ;; i32(x - 0x80000000) == 0 -> x == 0x80000000 + (drop (i32.eq + (i32.sub + (local.get $x) + (i32.const 0x80000000) + ) + (i32.const 0) + )) + ;; i32(x - 0x80000000) != 0 -> x == 0x80000000 + (drop (i32.ne + (i32.sub + (local.get $x) + (i32.const 0x80000000) + ) + (i32.const 0) + )) + ;; i32(x - { 0x80000000 }) < 0 -> skip + (drop (i32.lt_s + (i32.sub + (local.get $x) + (i32.const 0x80000000) + ) + (i32.const 0) + )) + ;; i32(x - { 0x80000000 }) >= 0 -> skip + (drop (i32.ge_s + (i32.sub + (local.get $x) + (i32.const 0x80000000) + ) + (i32.const 0) + )) + ;; i32(x - { 0x80000000 }) > 0 -> skip + (drop (i32.gt_s + (i32.sub + (local.get $x) + (block (result i32) + (i32.const 0x80000000) + ) + ) + (i32.const 0) + )) + ;; i32(x - { 0x80000000 }) <= 0 -> skip + (drop (i32.gt_s + (i32.sub + (local.get $x) + (block (result i32) + (i32.const 0x80000000) + ) + ) + (i32.const 0) + )) ) (func $unsigned-context (param $x i32) (param $y i64) (drop (i32.div_s -- cgit v1.2.3