Skip to content

Commit

Permalink
Test a case observed on some GPUs.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Apr 18, 2016
1 parent c60d40c commit 5f83081
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ml-proto/test/float_exprs.wast
Original file line number Diff line number Diff line change
Expand Up @@ -1247,3 +1247,15 @@
(assert_return (invoke "thepast0" (f64.const 0x1p-1021) (f64.const 0x1.fffffffffffffp-1) (f64.const 0x1p1) (f64.const 0x1p-1)) (f64.const 0x1.fffffffffffffp-1022))
(assert_return (invoke "thepast1" (f64.const 0x1p-54) (f64.const 0x1.fffffffffffffp-1) (f64.const 0x1p-54)) (f64.const -0x1p-107))
(assert_return (invoke "thepast2" (f32.const 0x1p-125) (f32.const 0x1p-1) (f32.const 0x1p0)) (f32.const 0x1p-126))

;; Test for floating point tolerances observed in some GPUs.
;; https://community.amd.com/thread/145582

(module
(func $inverse (param $x f32) (result f32)
(f32.div (f32.const 1.0) (get_local $x))
)
(export "inverse" $inverse)
)

(assert_return (invoke "inverse" (f32.const 96.0)) (f32.const 0x1.555556p-7))

0 comments on commit 5f83081

Please sign in to comment.