{"action":"created","issue":{"url":"https://api.github.com/repos/WebAssembly/design/issues/790","repository_url":"https://api.github.com/repos/WebAssembly/design","labels_url":"https://api.github.com/repos/WebAssembly/design/issues/790/labels{/name}","comments_url":"https://api.github.com/repos/WebAssembly/design/issues/790/comments","events_url":"https://api.github.com/repos/WebAssembly/design/issues/790/events","html_url":"https://github.com/WebAssembly/design/issues/790","id":175044966,"number":790,"title":"Support inc_local/dec_local","user":{"login":"axic","id":20340,"avatar_url":"https://avatars.githubusercontent.com/u/20340?v=3","gravatar_id":"","url":"https://api.github.com/users/axic","html_url":"https://github.com/axic","followers_url":"https://api.github.com/users/axic/followers","following_url":"https://api.github.com/users/axic/following{/other_user}","gists_url":"https://api.github.com/users/axic/gists{/gist_id}","starred_url":"https://api.github.com/users/axic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/axic/subscriptions","organizations_url":"https://api.github.com/users/axic/orgs","repos_url":"https://api.github.com/users/axic/repos","events_url":"https://api.github.com/users/axic/events{/privacy}","received_events_url":"https://api.github.com/users/axic/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-05T10:43:49Z","updated_at":"2016-09-06T18:26:06Z","closed_at":"2016-09-06T18:26:06Z","body":"There was as discussion about `i32.inc`/`i32.dec` [here](https://github.com/WebAssembly/design/issues/293).\r\n\r\nI would like to revive this issue with the following question: since many CPUs support inc/dec as a separate opcode, are we expecting JITs to do static analysis and replace `(set_local $x (i32.add (get_local $x) (i32.const 1))` with an inc opcode? Or would it make sense considering the inclusion of `inc`/`dec` one more time?\r\n\r\nMore specifically having `inc_local` and `dec_local` (as opposed to `i32.inc`/`i32.dec`). I think it would be really useful in loops."},"comment":{"url":"https://api.github.com/repos/WebAssembly/design/issues/comments/245043530","html_url":"https://github.com/WebAssembly/design/issues/790#issuecomment-245043530","issue_url":"https://api.github.com/repos/WebAssembly/design/issues/790","id":245043530,"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},"created_at":"2016-09-06T18:26:05Z","updated_at":"2016-09-06T18:26:05Z","body":"Same as for the other one: I don't think there's much of a point to this. It's easy to detect add / sub with immediate 1 (the JIT doesn't get better with a wasm instruction for it), and inc / dec instructions aren't necessarily a win in performance (so the JIT may not even want to emit inc / dec depending on architecture, e.g. inc / dec cause partial flag sets by preserving CF while add / sub touch all the flags, and lea touches none, and then check Agner for latencies / uops)."}}
{"actor":{"display_login":"jfbastien"}}