diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/optimize-instructions_all-features.txt | 29 | ||||
-rw-r--r-- | test/passes/optimize-instructions_all-features.wast | 19 |
2 files changed, 48 insertions, 0 deletions
diff --git a/test/passes/optimize-instructions_all-features.txt b/test/passes/optimize-instructions_all-features.txt index 80bd7a89d..15a38f267 100644 --- a/test/passes/optimize-instructions_all-features.txt +++ b/test/passes/optimize-instructions_all-features.txt @@ -19,6 +19,7 @@ (type $f32_=>_none (func (param f32))) (type $f32_f64_=>_none (func (param f32 f64))) (type $f64_=>_none (func (param f64))) + (type $f64_f32_=>_none (func (param f64 f32))) (type $f64_f64_f32_f32_=>_none (func (param f64 f64 f32 f32))) (type $none_=>_f64 (func (result f64))) (memory $0 0) @@ -4597,6 +4598,34 @@ ) ) ) + (func $optimize-float-mul-by-two (param $0 f64) (param $1 f32) + (drop + (f64.add + (local.get $0) + (local.get $0) + ) + ) + (drop + (f32.add + (local.get $1) + (local.get $1) + ) + ) + (drop + (f64.mul + (call $tee-with-unreachable-value) + (f64.const 2) + ) + ) + (drop + (f64.mul + (f64.neg + (local.get $0) + ) + (f64.const 2) + ) + ) + ) (func $duplicate-elimination (param $x i32) (param $y i32) (param $z i32) (param $w f64) (drop (f64.abs diff --git a/test/passes/optimize-instructions_all-features.wast b/test/passes/optimize-instructions_all-features.wast index c3a6aaf59..c9f071727 100644 --- a/test/passes/optimize-instructions_all-features.wast +++ b/test/passes/optimize-instructions_all-features.wast @@ -5069,6 +5069,25 @@ (i32.const -7) ;; skip )) ) + (func $optimize-float-mul-by-two (param $0 f64) (param $1 f32) + (drop (f64.mul + (local.get $0) + (f64.const 2) + )) + (drop (f32.mul + (local.get $1) + (f32.const 2) + )) + + (drop (f64.mul + (call $tee-with-unreachable-value) ;; side effect + (f64.const 2) + )) + (drop (f64.mul + (f64.neg (local.get $0)) ;; complex expression + (f64.const 2) + )) + ) (func $duplicate-elimination (param $x i32) (param $y i32) (param $z i32) (param $w f64) ;; unary (drop (f64.abs (f64.abs (local.get $w)))) |