{"action":"created","issue":{"url":"https://api.github.com/repos/citra-emu/citra/issues/1554","repository_url":"https://api.github.com/repos/citra-emu/citra","labels_url":"https://api.github.com/repos/citra-emu/citra/issues/1554/labels{/name}","comments_url":"https://api.github.com/repos/citra-emu/citra/issues/1554/comments","events_url":"https://api.github.com/repos/citra-emu/citra/issues/1554/events","html_url":"https://github.com/citra-emu/citra/pull/1554","id":142214539,"number":1554,"title":"[RFC] Very incomplete CPU JIT","user":{"login":"MerryMage","id":8682882,"avatar_url":"https://avatars.githubusercontent.com/u/8682882?v=3","gravatar_id":"","url":"https://api.github.com/users/MerryMage","html_url":"https://github.com/MerryMage","followers_url":"https://api.github.com/users/MerryMage/followers","following_url":"https://api.github.com/users/MerryMage/following{/other_user}","gists_url":"https://api.github.com/users/MerryMage/gists{/gist_id}","starred_url":"https://api.github.com/users/MerryMage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MerryMage/subscriptions","organizations_url":"https://api.github.com/users/MerryMage/orgs","repos_url":"https://api.github.com/users/MerryMage/repos","events_url":"https://api.github.com/users/MerryMage/events{/privacy}","received_events_url":"https://api.github.com/users/MerryMage/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-20T22:21:45Z","updated_at":"2016-03-21T10:40:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/citra-emu/citra/pulls/1554","html_url":"https://github.com/citra-emu/citra/pull/1554","diff_url":"https://github.com/citra-emu/citra/pull/1554.diff","patch_url":"https://github.com/citra-emu/citra/pull/1554.patch"},"body":"Refactored the very quick educational JIT I wrote into something more presentable and much less rushed.\r\n\r\nThings in this PR:\r\n* [Catch](https://github.com/philsquared/Catch) for unit tests\r\n* Unit test that fuzzes the JIT against the interpreter for data processing instructions.\r\n* New generic ARM decoder that can be adapted for code analysis / optimization in the future. (I stole the original tables from @lioncash then manged them beyond all recognition, apologies.)\r\n* A JIT that falls back on the interpreter when it can't compile an instruction.\r\n* ClearCache. (CROs require this, but I also found it useful for flushing after tests.)\r\n\r\nThings not yet in this PR:\r\n* [ ] Non-immediate data processing instructions.\r\n* [ ] Branch instructions.\r\n* [ ] Porting other instructions implemented in the other prototype over.\r\n* [ ] Unit tests for the Thumb decoder. It might currently be complete garbage for all I know.\r\n\r\nThings that won't be in this PR:\r\n* A way to actually use switch to the JIT to run games.\r\n* A decent register allocator.\r\n\r\n---\r\n\r\n### Design\r\n\r\n* Current design inspired by something @lioncash was working on but probably not as good as theirs.\r\n* Each instruction is handled by it's own function. \r\n* Everything to do with register allocation and assignment is handled by RegAlloc.\r\n* JitState has an ARMul_State embedded in it for ease of calling the interpreter.\r\n* CallInterpreter can be adjusted to interpret more than 1 instruction at a time.\r\n* I'm tired and I originally had an idea for a design writeup in mind but can't recall what I wanted to write at the moment.\r\n* Possibly point out places where there is a lack of comments please / Where something is unclear.\r\n* Design comments welcome.\r\n\r\n### Known issues\r\n\r\n* Interpreter cache pollution.\r\n"},"comment":{"url":"https://api.github.com/repos/citra-emu/citra/issues/comments/199220443","html_url":"https://github.com/citra-emu/citra/pull/1554#issuecomment-199220443","issue_url":"https://api.github.com/repos/citra-emu/citra/issues/1554","id":199220443,"user":{"login":"MerryMage","id":8682882,"avatar_url":"https://avatars.githubusercontent.com/u/8682882?v=3","gravatar_id":"","url":"https://api.github.com/users/MerryMage","html_url":"https://github.com/MerryMage","followers_url":"https://api.github.com/users/MerryMage/followers","following_url":"https://api.github.com/users/MerryMage/following{/other_user}","gists_url":"https://api.github.com/users/MerryMage/gists{/gist_id}","starred_url":"https://api.github.com/users/MerryMage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MerryMage/subscriptions","organizations_url":"https://api.github.com/users/MerryMage/orgs","repos_url":"https://api.github.com/users/MerryMage/repos","events_url":"https://api.github.com/users/MerryMage/events{/privacy}","received_events_url":"https://api.github.com/users/MerryMage/received_events","type":"User","site_admin":false},"created_at":"2016-03-21T10:40:04Z","updated_at":"2016-03-21T10:40:04Z","body":"Opinions on submoduling Catch instead of including it?"}}