{"action":"created","issue":{"url":"https://api.github.com/repos/WebAssembly/v8-native-prototype/issues/99","labels_url":"https://api.github.com/repos/WebAssembly/v8-native-prototype/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/WebAssembly/v8-native-prototype/issues/99/comments","events_url":"https://api.github.com/repos/WebAssembly/v8-native-prototype/issues/99/events","html_url":"https://github.com/WebAssembly/v8-native-prototype/issues/99","id":120437888,"number":99,"title":"f32.neg spec tests failures w/ NaN","user":{"login":"binji","id":1245315,"avatar_url":"https://avatars.githubusercontent.com/u/1245315?v=3","gravatar_id":"","url":"https://api.github.com/users/binji","html_url":"https://github.com/binji","followers_url":"https://api.github.com/users/binji/followers","following_url":"https://api.github.com/users/binji/following{/other_user}","gists_url":"https://api.github.com/users/binji/gists{/gist_id}","starred_url":"https://api.github.com/users/binji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binji/subscriptions","organizations_url":"https://api.github.com/users/binji/orgs","repos_url":"https://api.github.com/users/binji/repos","events_url":"https://api.github.com/users/binji/events{/privacy}","received_events_url":"https://api.github.com/users/binji/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-04T16:34:56Z","updated_at":"2015-12-11T22:29:36Z","closed_at":null,"body":"The following spec tests fail:\r\n```\r\n(func $f32.neg (param $x f32) (result f32) (f32.neg (get_local $x)))\r\n(export \"f32.neg\" $f32.neg)\r\n...\r\n(assert_return (invoke \"f32.neg\" (f32.const nan)) (f32.const -nan))\r\n(assert_return (invoke \"f32.neg\" (f32.const -nan)) (f32.const nan))\r\n(assert_return (invoke \"f32.neg\" (f32.const nan:0x0f1e2)) (f32.const -nan:0x0f1e2))\r\n(assert_return (invoke \"f32.neg\" (f32.const -nan:0x0f1e2)) (f32.const nan:0x0f1e2))\r\n\r\n(assert_return (invoke \"f64.neg\" (f64.const nan)) (f64.const -nan))\r\n(assert_return (invoke \"f64.neg\" (f64.const -nan)) (f64.const nan))\r\n(assert_return (invoke \"f64.neg\" (f64.const nan:0x0f1e27a6b)) (f64.const -nan:0x0f1e27a6b))\r\n(assert_return (invoke \"f64.neg\" (f64.const -nan:0x0f1e27a6b)) (f64.const nan:0x0f1e27a6b))\r\n```\r\nI evaluate them in sexpr-wasm by generating something like the following:\r\n```\r\n(i32.eq (i32.reinterpret/f32 (call ...)) (i32.reinterpret/f32 (f32.const ...)))\r\n```"},"comment":{"url":"https://api.github.com/repos/WebAssembly/v8-native-prototype/issues/comments/164066621","html_url":"https://github.com/WebAssembly/v8-native-prototype/issues/99#issuecomment-164066621","issue_url":"https://api.github.com/repos/WebAssembly/v8-native-prototype/issues/99","id":164066621,"user":{"login":"sunfishcode","id":4503403,"avatar_url":"https://avatars.githubusercontent.com/u/4503403?v=3","gravatar_id":"","url":"https://api.github.com/users/sunfishcode","html_url":"https://github.com/sunfishcode","followers_url":"https://api.github.com/users/sunfishcode/followers","following_url":"https://api.github.com/users/sunfishcode/following{/other_user}","gists_url":"https://api.github.com/users/sunfishcode/gists{/gist_id}","starred_url":"https://api.github.com/users/sunfishcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunfishcode/subscriptions","organizations_url":"https://api.github.com/users/sunfishcode/orgs","repos_url":"https://api.github.com/users/sunfishcode/repos","events_url":"https://api.github.com/users/sunfishcode/events{/privacy}","received_events_url":"https://api.github.com/users/sunfishcode/received_events","type":"User","site_admin":false},"created_at":"2015-12-11T22:29:36Z","updated_at":"2015-12-11T22:29:36Z","body":"The spec, IEEE 754, and these tests all agree that the payload bits of a NaN are preserved by floating-point `neg`. `assert_return` is not part of the spec, but it is expected to do a bitwise comparison, as in @binji's example above."}}