{"action":"created","issue":{"url":"https://api.github.com/repos/dolphin-emu/dolphin/issues/3968","repository_url":"https://api.github.com/repos/dolphin-emu/dolphin","labels_url":"https://api.github.com/repos/dolphin-emu/dolphin/issues/3968/labels{/name}","comments_url":"https://api.github.com/repos/dolphin-emu/dolphin/issues/3968/comments","events_url":"https://api.github.com/repos/dolphin-emu/dolphin/issues/3968/events","html_url":"https://github.com/dolphin-emu/dolphin/pull/3968","id":163149202,"number":3968,"title":"Jit: Remove unsafe MOV optimization","user":{"login":"hthh","id":9006595,"avatar_url":"https://avatars.githubusercontent.com/u/9006595?v=3","gravatar_id":"","url":"https://api.github.com/users/hthh","html_url":"https://github.com/hthh","followers_url":"https://api.github.com/users/hthh/followers","following_url":"https://api.github.com/users/hthh/following{/other_user}","gists_url":"https://api.github.com/users/hthh/gists{/gist_id}","starred_url":"https://api.github.com/users/hthh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hthh/subscriptions","organizations_url":"https://api.github.com/users/hthh/orgs","repos_url":"https://api.github.com/users/hthh/repos","events_url":"https://api.github.com/users/hthh/events{/privacy}","received_events_url":"https://api.github.com/users/hthh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-06-30T12:05:34Z","updated_at":"2016-06-30T15:32:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dolphin-emu/dolphin/pulls/3968","html_url":"https://github.com/dolphin-emu/dolphin/pull/3968","diff_url":"https://github.com/dolphin-emu/dolphin/pull/3968.diff","patch_url":"https://github.com/dolphin-emu/dolphin/pull/3968.patch"},"body":"This optimization broke arithXex in rare cases by emitting XOR where MOV was expected.\r\n\r\nWe could instead enforce locking of flags around MOV operations, but I'd prefer for the low level XEmitter interface to not optimize things.\r\n\r\nOptimistically, this might fix https://dolp.in/i9661 but I haven't tried it.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/dolphin-emu/dolphin/3968)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/dolphin-emu/dolphin/issues/comments/229696288","html_url":"https://github.com/dolphin-emu/dolphin/pull/3968#issuecomment-229696288","issue_url":"https://api.github.com/repos/dolphin-emu/dolphin/issues/3968","id":229696288,"user":{"login":"mmastrac","id":512240,"avatar_url":"https://avatars.githubusercontent.com/u/512240?v=3","gravatar_id":"","url":"https://api.github.com/users/mmastrac","html_url":"https://github.com/mmastrac","followers_url":"https://api.github.com/users/mmastrac/followers","following_url":"https://api.github.com/users/mmastrac/following{/other_user}","gists_url":"https://api.github.com/users/mmastrac/gists{/gist_id}","starred_url":"https://api.github.com/users/mmastrac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmastrac/subscriptions","organizations_url":"https://api.github.com/users/mmastrac/orgs","repos_url":"https://api.github.com/users/mmastrac/repos","events_url":"https://api.github.com/users/mmastrac/events{/privacy}","received_events_url":"https://api.github.com/users/mmastrac/received_events","type":"User","site_admin":false},"created_at":"2016-06-30T15:32:26Z","updated_at":"2016-06-30T15:32:26Z","body":"It's really just a performance win from making register zeros a one-byte instruction rather than five, saving us some space in the CPU cache. Unfortunately there are no quick-zero instructions that don't stomp on flags.\r\n\r\nI think there are two options here. Either we lock the flags around this function to prevent us from generating `XOR`, or we remove the optimization entirely until we have some flag-instrumenting code in `x64Emitter`. I don't think the indeterminate flag code would be terribly difficult, but it would require instrumenting each opcode-generating function with its flag effects.\r\n\r\nI would lean towards removing the optimization for now, since there is probably also an issue w/the register cache accidentally generating `XOR` in this code path as well."}}
{"actor":{"display_login":"mmastrac"}}