diff --git a/tests/compiler/std/math.debug.wat b/tests/compiler/std/math.debug.wat index 51d3e84d49..6e4a6de403 100644 --- a/tests/compiler/std/math.debug.wat +++ b/tests/compiler/std/math.debug.wat @@ -19,6 +19,7 @@ (type $f64_i32_f64_f64_i32_=>_i32 (func (param f64 i32 f64 f64 i32) (result i32))) (type $f32_i32_f32_f32_i32_=>_i32 (func (param f32 i32 f32 f32 i32) (result i32))) (type $f64_i64_=>_i32 (func (param f64 i64) (result i32))) + (type $f64_f64_=>_i32 (func (param f64 f64) (result i32))) (type $i64_=>_i64 (func (param i64) (result i64))) (type $i32_=>_i32 (func (param i32) (result i32))) (type $i64_=>_none (func (param i64))) @@ -10567,6 +10568,28 @@ i32.const 0 end ) + (func $~lib/object/Object.is (param $x f64) (param $y f64) (result i32) + i32.const 1 + drop + i32.const 8 + i32.const 8 + i32.eq + drop + local.get $x + local.get $x + f64.ne + local.get $y + local.get $y + f64.ne + i32.and + local.get $x + i64.reinterpret_f64 + local.get $y + i64.reinterpret_f64 + i64.eq + i32.or + return + ) (func $~lib/math/NativeMathf.pow (param $x f32) (param $y f32) (result f32) (local $var$2 f32) (local $var$3 f32) @@ -43070,7 +43093,9 @@ f64.const 1 call $~lib/math/NativeMath.pow f64.const 0 - f64.eq + call $~lib/object/Object.is + i32.const 0 + i32.ne i32.eqz if i32.const 0 @@ -43084,7 +43109,9 @@ f64.const 1 call $~lib/math/NativeMath.pow f64.const -0 - f64.eq + call $~lib/object/Object.is + i32.const 0 + i32.ne i32.eqz if i32.const 0 @@ -43228,7 +43255,9 @@ f64.const -1 call $~lib/math/NativeMath.pow f64.const 0 - f64.eq + call $~lib/object/Object.is + i32.const 0 + i32.ne i32.eqz if i32.const 0 @@ -43243,7 +43272,9 @@ f64.const -1 call $~lib/math/NativeMath.pow f64.const -0 - f64.eq + call $~lib/object/Object.is + i32.const 0 + i32.ne i32.eqz if i32.const 0 diff --git a/tests/compiler/std/math.release.wat b/tests/compiler/std/math.release.wat index 591eb72158..4aee7d432c 100644 --- a/tests/compiler/std/math.release.wat +++ b/tests/compiler/std/math.release.wat @@ -40016,8 +40016,9 @@ f64.const 0 f64.const 1 call $~lib/math/NativeMath.pow - f64.const 0 - f64.ne + i64.reinterpret_f64 + i64.const 0 + i64.ne if i32.const 0 i32.const 1056 @@ -40029,8 +40030,9 @@ f64.const -0 f64.const 1 call $~lib/math/NativeMath.pow - f64.const -0 - f64.ne + i64.reinterpret_f64 + i64.const -9223372036854775808 + i64.ne if i32.const 0 i32.const 1056 @@ -40160,8 +40162,9 @@ f64.const inf f64.const -1 call $~lib/math/NativeMath.pow - f64.const 0 - f64.ne + i64.reinterpret_f64 + i64.const 0 + i64.ne if i32.const 0 i32.const 1056 @@ -40173,8 +40176,9 @@ f64.const -inf f64.const -1 call $~lib/math/NativeMath.pow - f64.const -0 - f64.ne + i64.reinterpret_f64 + i64.const -9223372036854775808 + i64.ne if i32.const 0 i32.const 1056 diff --git a/tests/compiler/std/math.ts b/tests/compiler/std/math.ts index 7bad7a7291..9b8ec7f3e7 100644 --- a/tests/compiler/std/math.ts +++ b/tests/compiler/std/math.ts @@ -2695,8 +2695,8 @@ assert(NativeMath.pow(+Infinity, 0.0) == 1.0); assert(NativeMath.pow(-Infinity, 0.0) == 1.0); assert(NativeMath.pow(NaN, 0.0) == 1.0); -assert(NativeMath.pow(+0.0,+1.0) == +0.0); -assert(NativeMath.pow(-0.0,+1.0) == -0.0); +assert(Object.is(NativeMath.pow(+0.0,+1.0), +0.0)); +assert(Object.is(NativeMath.pow(-0.0,+1.0), -0.0)); assert(NativeMath.pow(-1.0, 1.0) == -1.0); assert(NativeMath.pow(+Infinity, 1.0) == +Infinity); assert(NativeMath.pow(-Infinity, 1.0) == -Infinity); @@ -2707,8 +2707,8 @@ assert(NativeMath.pow(-0.0,-1.0) == -Infinity); assert(NativeMath.pow(-1.0,-1.0) == -1.0); assert(NativeMath.pow( 0.5,-1.0) == +2.0); assert(NativeMath.pow( 1.0,-1.0) == +1.0); -assert(NativeMath.pow(+Infinity,-1.0) == +0.0); -assert(NativeMath.pow(-Infinity,-1.0) == -0.0); +assert(Object.is(NativeMath.pow(+Infinity,-1.0), +0.0)); +assert(Object.is(NativeMath.pow(-Infinity,-1.0), -0.0)); assert(isNaN(NativeMath.pow(NaN,-1.0))); assert(NativeMath.pow(+0.0, 2.0) == +0.0);