{"action":"opened","issue":{"url":"https://api.github.com/repos/WebAssembly/design/issues/646","repository_url":"https://api.github.com/repos/WebAssembly/design","labels_url":"https://api.github.com/repos/WebAssembly/design/issues/646/labels{/name}","comments_url":"https://api.github.com/repos/WebAssembly/design/issues/646/comments","events_url":"https://api.github.com/repos/WebAssembly/design/issues/646/events","html_url":"https://github.com/WebAssembly/design/issues/646","id":146667361,"number":646,"title":"RISC-V and NaNs","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/WebAssembly/design/milestones/2","html_url":"https://github.com/WebAssembly/design/milestones/MVP","labels_url":"https://api.github.com/repos/WebAssembly/design/milestones/2/labels","id":1138963,"number":2,"title":"MVP","description":"See [here](https://github.com/WebAssembly/design/blob/master/MVP.md) for details.","creator":{"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},"open_issues":29,"closed_issues":67,"state":"open","created_at":"2015-05-29T00:13:49Z","updated_at":"2016-04-07T15:54:25Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-04-07T15:54:25Z","updated_at":"2016-04-07T15:54:25Z","closed_at":null,"body":"RISC-V is a new ISA with interesting potential. Overall, it looks like it should support WebAssembly very well. The following are two concerns regarding its handling of NaNs:\r\n\r\n - RISC-V defines its hardware-generated NaN values as all-ones. This differs from ARM, MIPS (in IEEE 754-2008 mode, which wasm already requires), Power, and x86, and could significantly complicate NaN boxing on wasm. I've posted [to the RISC-V isa-dev forum](https://groups.google.com/a/groups.riscv.org/forum/#!topic/isa-dev/g79dHlV4B_k) asking whether it's feasible to change RISC-V to be compatible, as a first step.\r\n\r\n - IEEE 754-2008 makes exemptions to its usual NaN propagation rules for min, max, and conversions. RISC-V takes advantage of these exemptions. The current wasm design does not currently have these exemptions, but they are in IEEE 754-2008, and could be added to wasm without significant practical cost, so we should consider them."}}