{"action":"created","issue":{"url":"https://api.github.com/repos/PCSX2/pcsx2/issues/1110","repository_url":"https://api.github.com/repos/PCSX2/pcsx2","labels_url":"https://api.github.com/repos/PCSX2/pcsx2/issues/1110/labels{/name}","comments_url":"https://api.github.com/repos/PCSX2/pcsx2/issues/1110/comments","events_url":"https://api.github.com/repos/PCSX2/pcsx2/issues/1110/events","html_url":"https://github.com/PCSX2/pcsx2/issues/1110","id":125993789,"number":1110,"title":"EE FPU: performance vs accuracy.","user":{"login":"gregory38","id":1569559,"avatar_url":"https://avatars.githubusercontent.com/u/1569559?v=3","gravatar_id":"","url":"https://api.github.com/users/gregory38","html_url":"https://github.com/gregory38","followers_url":"https://api.github.com/users/gregory38/followers","following_url":"https://api.github.com/users/gregory38/following{/other_user}","gists_url":"https://api.github.com/users/gregory38/gists{/gist_id}","starred_url":"https://api.github.com/users/gregory38/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregory38/subscriptions","organizations_url":"https://api.github.com/users/gregory38/orgs","repos_url":"https://api.github.com/users/gregory38/repos","events_url":"https://api.github.com/users/gregory38/events{/privacy}","received_events_url":"https://api.github.com/users/gregory38/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/PCSX2/pcsx2/labels/Portability","name":"Portability","color":"0052cc"},{"url":"https://api.github.com/repos/PCSX2/pcsx2/labels/Question","name":"Question","color":"cc317c"},{"url":"https://api.github.com/repos/PCSX2/pcsx2/labels/Recompiler","name":"Recompiler","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":44,"created_at":"2016-01-11T17:18:48Z","updated_at":"2016-02-03T19:35:22Z","closed_at":null,"body":"We have severals option to configure the EE FPU emulation (round mode/clamping mode).\r\n\r\nIt would interesting to find the game that really get speed improvement with those hacks. And if it is really worth it.\r\n\r\nI want to rewrite register allocation with a clean design in mind. And hopefully an allocater that is easier. Blocks are rather small and the number of used regs low. And it would be relatively lower in 64 bits. It would be nice to have some testcase to validate this theory."},"comment":{"url":"https://api.github.com/repos/PCSX2/pcsx2/issues/comments/179421268","html_url":"https://github.com/PCSX2/pcsx2/issues/1110#issuecomment-179421268","issue_url":"https://api.github.com/repos/PCSX2/pcsx2/issues/1110","id":179421268,"user":{"login":"gregory38","id":1569559,"avatar_url":"https://avatars.githubusercontent.com/u/1569559?v=3","gravatar_id":"","url":"https://api.github.com/users/gregory38","html_url":"https://github.com/gregory38","followers_url":"https://api.github.com/users/gregory38/followers","following_url":"https://api.github.com/users/gregory38/following{/other_user}","gists_url":"https://api.github.com/users/gregory38/gists{/gist_id}","starred_url":"https://api.github.com/users/gregory38/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregory38/subscriptions","organizations_url":"https://api.github.com/users/gregory38/orgs","repos_url":"https://api.github.com/users/gregory38/repos","events_url":"https://api.github.com/users/gregory38/events{/privacy}","received_events_url":"https://api.github.com/users/gregory38/received_events","type":"User","site_admin":false},"created_at":"2016-02-03T19:35:22Z","updated_at":"2016-02-03T19:35:22Z","body":"Ok. So I did a small program on the testsuite that loop on float computing. Basically main loop is\r\n```\r\nwhile (v < max) {\r\n    v += inc;\r\n    inc *= mid;\r\n    print_me++;\r\n    if (print_me == (1000 * 1000))\r\n         ;\r\n}\r\n```\r\nSo we have a loop of  1 float add + 1 float mult + 1 float cmp + 1 addi + 1 cmp. So basically 60% of floats (so far the biggest games was 20%).\r\n\r\n| Mode | Type | FPS |\r\n|---------|--------|-------|\r\n| Interpreter | double | 35 |\r\n| Interpreter | float | 89 |\r\n| recompiler | full (no fast mult) | 164 |\r\n| recompiler | full | 195 |\r\n| recompiler | full, ADD 1, RESULT 0 | 192 |\r\n| recompiler | full, ADD 0, RESULT 1 | 222 |\r\n| recompiler | full, ADD 0, RESULT 0 | 242 |\r\n| recompiler | extra | 206|\r\n| recompiler | normal | 274|\r\n| recompiler | none | 295|\r\n\r\nSo I confirm @ssakash results. However the impact is likely less in games. Note, I'm on Haswell so I use the SSE4 code path. So\r\n* my double implementation is rather slow\r\n* the fast mult hack (albeit which doesn't support the detection of overflow) provide a nice boost. (but we have the best case here, only real numbers). +18%\r\n* Accurate ADD option is quite costly. Note the purpose is to improve the rounding of the `+A-B` and `-A+B` operations. It is always enabled but it is useless for `+A+B` and `-A-B`"}}