{"action":"created","issue":{"url":"https://api.github.com/repos/WebAssembly/design/issues/281","labels_url":"https://api.github.com/repos/WebAssembly/design/issues/281/labels{/name}","comments_url":"https://api.github.com/repos/WebAssembly/design/issues/281/comments","events_url":"https://api.github.com/repos/WebAssembly/design/issues/281/events","html_url":"https://github.com/WebAssembly/design/issues/281","id":96873221,"number":281,"title":"Non-storable bool type","user":{"login":"jfbastien","id":298127,"avatar_url":"https://avatars.githubusercontent.com/u/298127?v=3","gravatar_id":"","url":"https://api.github.com/users/jfbastien","html_url":"https://github.com/jfbastien","followers_url":"https://api.github.com/users/jfbastien/followers","following_url":"https://api.github.com/users/jfbastien/following{/other_user}","gists_url":"https://api.github.com/users/jfbastien/gists{/gist_id}","starred_url":"https://api.github.com/users/jfbastien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfbastien/subscriptions","organizations_url":"https://api.github.com/users/jfbastien/orgs","repos_url":"https://api.github.com/users/jfbastien/repos","events_url":"https://api.github.com/users/jfbastien/events{/privacy}","received_events_url":"https://api.github.com/users/jfbastien/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-23T18:18:17Z","updated_at":"2015-07-23T19:22:41Z","closed_at":null,"body":"AstSemantics.md currently uses integers to hold comparison results. I'd much rather have a non-storable boolean type (call it `i1`) which is returned by comparisons. It's convertible to/from other integer types, but cannot be loaded or stored.\r\n\r\nIt can be used for `select`, and once we have SIMD you can construct non-storable `i1` vectors.\r\n\r\nThis is nice because it keeps the type information in the IR, making things easier to track and in the case of SIMD easier to optimize because different ISAs represent SIMD comparisons differently."},"comment":{"url":"https://api.github.com/repos/WebAssembly/design/issues/comments/124217048","html_url":"https://github.com/WebAssembly/design/issues/281#issuecomment-124217048","issue_url":"https://api.github.com/repos/WebAssembly/design/issues/281","id":124217048,"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-07-23T19:22:41Z","updated_at":"2015-07-23T19:22:41Z","body":"If we add a scalar bool type, I suggest `bool` instead of `i1` or `int1' because I don't believe we'd plan to give it basic integer operations like `add`, `sub`, etc.\r\n\r\nI like this because it's human-friendly, it enables some fun (though not game-changing) optimizations, and it eliminates a pesky asymmetry where we just use `int32` to hold booleans, however I don't feel I have any arguments which conclusively outweigh the downsides of adding another type. In particular, it's feasible to have a SIMD bool type without having a scalar bool type."}}