titzer/v8-native-prototype

float min/max fail spec tests for NaN

Closed this issue · 2 comments

binji commented

Just got a chance to try out f32.min, f32.max, f64.min and f64.max. There are many failures when one of the values is NaN.

Here are the failing cases for f32.min (the others are similar):

(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -0x0p+0)))
(assert_return_nan (invoke "min" (f32.const -nan) (f32.const 0x0p+0)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const -0x0p+0)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const 0x0p+0)))
(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -0x1p-149)))
(assert_return_nan (invoke "min" (f32.const -nan) (f32.const 0x1p-149)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const -0x1p-149)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const 0x1p-149)))
(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -0x1p-126)))
(assert_return_nan (invoke "min" (f32.const -nan) (f32.const 0x1p-126)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const -0x1p-126)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const 0x1p-126)))
(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -0x1p-1)))
(assert_return_nan (invoke "min" (f32.const -nan) (f32.const 0x1p-1)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const -0x1p-1)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const 0x1p-1)))
(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -0x1p+0)))
(assert_return_nan (invoke "min" (f32.const -nan) (f32.const 0x1p+0)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const -0x1p+0)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const 0x1p+0)))
(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -0x1.921fb6p+2)))
(assert_return_nan (invoke "min" (f32.const -nan) (f32.const 0x1.921fb6p+2)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const -0x1.921fb6p+2)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const 0x1.921fb6p+2)))
(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -0x1.fffffep+127)))
(assert_return_nan (invoke "min" (f32.const -nan) (f32.const 0x1.fffffep+127)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const -0x1.fffffep+127)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const 0x1.fffffep+127)))
(assert_return_nan (invoke "min" (f32.const -nan) (f32.const -infinity)))
(assert_return_nan (invoke "min" (f32.const -nan) (f32.const infinity)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const -infinity)))
(assert_return_nan (invoke "min" (f32.const nan) (f32.const infinity)))
binji commented

Confirmed, thanks!