{"action":"created","comment":{"url":"https://api.github.com/repos/hrydgard/ppsspp/pulls/comments/41481887","id":41481887,"diff_hunk":"@@ -113,9 +115,109 @@ void Arm64Jit::GenerateFixedCode(const JitOptions &jo) {\n \t\tloadStaticRegisters = nullptr;\n \t}\n \n-\tenterCode = AlignCode16();\n+\tapplyRoundingMode = AlignCode16();\n \tif (!start)\n-\t\tstart = enterCode;\n+\t\tstart = applyRoundingMode;\n+\t{\n+\t\tLDR(INDEX_UNSIGNED, SCRATCH2, CTXREG, offsetof(MIPSState, fcr31));\n+\t\tif (!g_Config.bForceFlushToZero) {\n+\t\t\tTSTI2R(SCRATCH2, 1 << 24);\n+\t\t\tANDI2R(SCRATCH2, SCRATCH2, 3);\n+\t\t\tFixupBranch skip1 = B(CC_EQ);\n+\t\t\tADDI2R(SCRATCH2, SCRATCH2, 4);\n+\t\t\tSetJumpTarget(skip1);\n+\t\t\t// We can only skip if the rounding mode is zero and flush is set.\n+\t\t\tCMPI2R(SCRATCH2, 4);\n+\t\t} else {\n+\t\t\tANDSI2R(SCRATCH2, SCRATCH2, 3);\n+\t\t}\n+\t\t// At this point, if it was zero, we can skip the rest.\n+\t\tFixupBranch skip = B(CC_EQ);\n+\t\tPUSH(SCRATCH1_64);\n+\n+\t\t// MIPS Rounding Mode:       ARM Rounding Mode\n+\t\t//   0: Round nearest        0\n+\t\t//   1: Round to zero        3\n+\t\t//   2: Round up (ceil)      1\n+\t\t//   3: Round down (floor)   2\n+\t\tif (!g_Config.bForceFlushToZero) {\n+\t\t\tANDI2R(SCRATCH1, SCRATCH2, 3);\n+\t\t\tCMPI2R(SCRATCH1, 1);\n+\t\t} else {\n+\t\t\tCMPI2R(SCRATCH2, 1);\n+\t\t}\n+\n+\t\tFixupBranch skipadd = B(CC_NEQ);\n+\t\tADDI2R(SCRATCH2, SCRATCH2, 2);\n+\t\tSetJumpTarget(skipadd);\n+\t\tFixupBranch skipsub = B(CC_LE);\n+\t\tSUBI2R(SCRATCH2, SCRATCH2, 1);\n+\t\tSetJumpTarget(skipsub);\n+\n+\t\tMRS(SCRATCH1_64, FIELD_FPCR);\n+\t\t// Assume we're always in round-to-nearest mode beforehand.\n+\t\tif (!g_Config.bForceFlushToZero) {\n+\t\t\t// But we need to clear flush to zero in this case anyway.","path":"Core/MIPS/ARM64/Arm64Asm.cpp","position":64,"original_position":64,"commit_id":"4e9a9583b6f5469d3d38fc47654425c5edbc3bae","original_commit_id":"4e9a9583b6f5469d3d38fc47654425c5edbc3bae","user":{"login":"unknownbrackets","id":191233,"avatar_url":"https://avatars.githubusercontent.com/u/191233?v=3","gravatar_id":"","url":"https://api.github.com/users/unknownbrackets","html_url":"https://github.com/unknownbrackets","followers_url":"https://api.github.com/users/unknownbrackets/followers","following_url":"https://api.github.com/users/unknownbrackets/following{/other_user}","gists_url":"https://api.github.com/users/unknownbrackets/gists{/gist_id}","starred_url":"https://api.github.com/users/unknownbrackets/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unknownbrackets/subscriptions","organizations_url":"https://api.github.com/users/unknownbrackets/orgs","repos_url":"https://api.github.com/users/unknownbrackets/repos","events_url":"https://api.github.com/users/unknownbrackets/events{/privacy}","received_events_url":"https://api.github.com/users/unknownbrackets/received_events","type":"User","site_admin":false},"body":"Right.  Well, I think `bForceFlushToZero` is not doing anything now here.  It would have to `ORR` in `4 << 22`.\r\n\r\nWhen restoring, I guess we should just not `ORR` it in?  It seems like this would currently re-enable flush to zero even if C++ turned it off, unless C++ is saving the state somewhere?\r\n\r\nMaybe we just remove `g_Config.bForceFlushToZero` if it breaks things and doesn't have a big enough perf impact to be useful?\r\n\r\n-[Unknown]","created_at":"2015-10-08T07:09:30Z","updated_at":"2015-10-08T07:09:30Z","html_url":"https://github.com/hrydgard/ppsspp/pull/8036#discussion_r41481887","pull_request_url":"https://api.github.com/repos/hrydgard/ppsspp/pulls/8036","_links":{"self":{"href":"https://api.github.com/repos/hrydgard/ppsspp/pulls/comments/41481887"},"html":{"href":"https://github.com/hrydgard/ppsspp/pull/8036#discussion_r41481887"},"pull_request":{"href":"https://api.github.com/repos/hrydgard/ppsspp/pulls/8036"}}},"pull_request":{"url":"https://api.github.com/repos/hrydgard/ppsspp/pulls/8036","id":47090784,"html_url":"https://github.com/hrydgard/ppsspp/pull/8036","diff_url":"https://github.com/hrydgard/ppsspp/pull/8036.diff","patch_url":"https://github.com/hrydgard/ppsspp/pull/8036.patch","issue_url":"https://api.github.com/repos/hrydgard/ppsspp/issues/8036","number":8036,"state":"open","locked":false,"title":"JIT: Reduce code bloat for FPU rounding  ...","user":{"login":"hrydgard","id":130929,"avatar_url":"https://avatars.githubusercontent.com/u/130929?v=3","gravatar_id":"","url":"https://api.github.com/users/hrydgard","html_url":"https://github.com/hrydgard","followers_url":"https://api.github.com/users/hrydgard/followers","following_url":"https://api.github.com/users/hrydgard/following{/other_user}","gists_url":"https://api.github.com/users/hrydgard/gists{/gist_id}","starred_url":"https://api.github.com/users/hrydgard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrydgard/subscriptions","organizations_url":"https://api.github.com/users/hrydgard/orgs","repos_url":"https://api.github.com/users/hrydgard/repos","events_url":"https://api.github.com/users/hrydgard/events{/privacy}","received_events_url":"https://api.github.com/users/hrydgard/received_events","type":"User","site_admin":false},"body":"... by extracting large generated code into pregenerated functions","created_at":"2015-10-07T22:28:16Z","updated_at":"2015-10-08T07:09:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"80ec00342424c5206db9d53f1a337d5010e6ea29","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hrydgard/ppsspp/pulls/8036/commits","review_comments_url":"https://api.github.com/repos/hrydgard/ppsspp/pulls/8036/comments","review_comment_url":"https://api.github.com/repos/hrydgard/ppsspp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hrydgard/ppsspp/issues/8036/comments","statuses_url":"https://api.github.com/repos/hrydgard/ppsspp/statuses/4e9a9583b6f5469d3d38fc47654425c5edbc3bae","head":{"label":"hrydgard:extract-round-mode-funcs","ref":"extract-round-mode-funcs","sha":"4e9a9583b6f5469d3d38fc47654425c5edbc3bae","user":{"login":"hrydgard","id":130929,"avatar_url":"https://avatars.githubusercontent.com/u/130929?v=3","gravatar_id":"","url":"https://api.github.com/users/hrydgard","html_url":"https://github.com/hrydgard","followers_url":"https://api.github.com/users/hrydgard/followers","following_url":"https://api.github.com/users/hrydgard/following{/other_user}","gists_url":"https://api.github.com/users/hrydgard/gists{/gist_id}","starred_url":"https://api.github.com/users/hrydgard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrydgard/subscriptions","organizations_url":"https://api.github.com/users/hrydgard/orgs","repos_url":"https://api.github.com/users/hrydgard/repos","events_url":"https://api.github.com/users/hrydgard/events{/privacy}","received_events_url":"https://api.github.com/users/hrydgard/received_events","type":"User","site_admin":false},"repo":{"id":6486826,"name":"ppsspp","full_name":"hrydgard/ppsspp","owner":{"login":"hrydgard","id":130929,"avatar_url":"https://avatars.githubusercontent.com/u/130929?v=3","gravatar_id":"","url":"https://api.github.com/users/hrydgard","html_url":"https://github.com/hrydgard","followers_url":"https://api.github.com/users/hrydgard/followers","following_url":"https://api.github.com/users/hrydgard/following{/other_user}","gists_url":"https://api.github.com/users/hrydgard/gists{/gist_id}","starred_url":"https://api.github.com/users/hrydgard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrydgard/subscriptions","organizations_url":"https://api.github.com/users/hrydgard/orgs","repos_url":"https://api.github.com/users/hrydgard/repos","events_url":"https://api.github.com/users/hrydgard/events{/privacy}","received_events_url":"https://api.github.com/users/hrydgard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hrydgard/ppsspp","description":"A PSP emulator for Android, Windows, Mac, Linux and Blackberry 10, written in C++. Want to contribute? Join us in #ppsspp on freenode (IRC) or just send pull requests / issues.","fork":false,"url":"https://api.github.com/repos/hrydgard/ppsspp","forks_url":"https://api.github.com/repos/hrydgard/ppsspp/forks","keys_url":"https://api.github.com/repos/hrydgard/ppsspp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hrydgard/ppsspp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hrydgard/ppsspp/teams","hooks_url":"https://api.github.com/repos/hrydgard/ppsspp/hooks","issue_events_url":"https://api.github.com/repos/hrydgard/ppsspp/issues/events{/number}","events_url":"https://api.github.com/repos/hrydgard/ppsspp/events","assignees_url":"https://api.github.com/repos/hrydgard/ppsspp/assignees{/user}","branches_url":"https://api.github.com/repos/hrydgard/ppsspp/branches{/branch}","tags_url":"https://api.github.com/repos/hrydgard/ppsspp/tags","blobs_url":"https://api.github.com/repos/hrydgard/ppsspp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hrydgard/ppsspp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hrydgard/ppsspp/git/refs{/sha}","trees_url":"https://api.github.com/repos/hrydgard/ppsspp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hrydgard/ppsspp/statuses/{sha}","languages_url":"https://api.github.com/repos/hrydgard/ppsspp/languages","stargazers_url":"https://api.github.com/repos/hrydgard/ppsspp/stargazers","contributors_url":"https://api.github.com/repos/hrydgard/ppsspp/contributors","subscribers_url":"https://api.github.com/repos/hrydgard/ppsspp/subscribers","subscription_url":"https://api.github.com/repos/hrydgard/ppsspp/subscription","commits_url":"https://api.github.com/repos/hrydgard/ppsspp/commits{/sha}","git_commits_url":"https://api.github.com/repos/hrydgard/ppsspp/git/commits{/sha}","comments_url":"https://api.github.com/repos/hrydgard/ppsspp/comments{/number}","issue_comment_url":"https://api.github.com/repos/hrydgard/ppsspp/issues/comments{/number}","contents_url":"https://api.github.com/repos/hrydgard/ppsspp/contents/{+path}","compare_url":"https://api.github.com/repos/hrydgard/ppsspp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hrydgard/ppsspp/merges","archive_url":"https://api.github.com/repos/hrydgard/ppsspp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hrydgard/ppsspp/downloads","issues_url":"https://api.github.com/repos/hrydgard/ppsspp/issues{/number}","pulls_url":"https://api.github.com/repos/hrydgard/ppsspp/pulls{/number}","milestones_url":"https://api.github.com/repos/hrydgard/ppsspp/milestones{/number}","notifications_url":"https://api.github.com/repos/hrydgard/ppsspp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hrydgard/ppsspp/labels{/name}","releases_url":"https://api.github.com/repos/hrydgard/ppsspp/releases{/id}","created_at":"2012-11-01T08:41:48Z","updated_at":"2015-10-08T02:08:11Z","pushed_at":"2015-10-08T07:06:46Z","git_url":"git://github.com/hrydgard/ppsspp.git","ssh_url":"git@github.com:hrydgard/ppsspp.git","clone_url":"https://github.com/hrydgard/ppsspp.git","svn_url":"https://github.com/hrydgard/ppsspp","homepage":"http://www.ppsspp.org","size":324959,"stargazers_count":1892,"watchers_count":1892,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":827,"mirror_url":null,"open_issues_count":640,"forks":827,"open_issues":640,"watchers":1892,"default_branch":"master"}},"base":{"label":"hrydgard:master","ref":"master","sha":"371e7ab880ba622b45ac2e73282b0d5d22abdab6","user":{"login":"hrydgard","id":130929,"avatar_url":"https://avatars.githubusercontent.com/u/130929?v=3","gravatar_id":"","url":"https://api.github.com/users/hrydgard","html_url":"https://github.com/hrydgard","followers_url":"https://api.github.com/users/hrydgard/followers","following_url":"https://api.github.com/users/hrydgard/following{/other_user}","gists_url":"https://api.github.com/users/hrydgard/gists{/gist_id}","starred_url":"https://api.github.com/users/hrydgard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrydgard/subscriptions","organizations_url":"https://api.github.com/users/hrydgard/orgs","repos_url":"https://api.github.com/users/hrydgard/repos","events_url":"https://api.github.com/users/hrydgard/events{/privacy}","received_events_url":"https://api.github.com/users/hrydgard/received_events","type":"User","site_admin":false},"repo":{"id":6486826,"name":"ppsspp","full_name":"hrydgard/ppsspp","owner":{"login":"hrydgard","id":130929,"avatar_url":"https://avatars.githubusercontent.com/u/130929?v=3","gravatar_id":"","url":"https://api.github.com/users/hrydgard","html_url":"https://github.com/hrydgard","followers_url":"https://api.github.com/users/hrydgard/followers","following_url":"https://api.github.com/users/hrydgard/following{/other_user}","gists_url":"https://api.github.com/users/hrydgard/gists{/gist_id}","starred_url":"https://api.github.com/users/hrydgard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hrydgard/subscriptions","organizations_url":"https://api.github.com/users/hrydgard/orgs","repos_url":"https://api.github.com/users/hrydgard/repos","events_url":"https://api.github.com/users/hrydgard/events{/privacy}","received_events_url":"https://api.github.com/users/hrydgard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hrydgard/ppsspp","description":"A PSP emulator for Android, Windows, Mac, Linux and Blackberry 10, written in C++. Want to contribute? Join us in #ppsspp on freenode (IRC) or just send pull requests / issues.","fork":false,"url":"https://api.github.com/repos/hrydgard/ppsspp","forks_url":"https://api.github.com/repos/hrydgard/ppsspp/forks","keys_url":"https://api.github.com/repos/hrydgard/ppsspp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hrydgard/ppsspp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hrydgard/ppsspp/teams","hooks_url":"https://api.github.com/repos/hrydgard/ppsspp/hooks","issue_events_url":"https://api.github.com/repos/hrydgard/ppsspp/issues/events{/number}","events_url":"https://api.github.com/repos/hrydgard/ppsspp/events","assignees_url":"https://api.github.com/repos/hrydgard/ppsspp/assignees{/user}","branches_url":"https://api.github.com/repos/hrydgard/ppsspp/branches{/branch}","tags_url":"https://api.github.com/repos/hrydgard/ppsspp/tags","blobs_url":"https://api.github.com/repos/hrydgard/ppsspp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hrydgard/ppsspp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hrydgard/ppsspp/git/refs{/sha}","trees_url":"https://api.github.com/repos/hrydgard/ppsspp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hrydgard/ppsspp/statuses/{sha}","languages_url":"https://api.github.com/repos/hrydgard/ppsspp/languages","stargazers_url":"https://api.github.com/repos/hrydgard/ppsspp/stargazers","contributors_url":"https://api.github.com/repos/hrydgard/ppsspp/contributors","subscribers_url":"https://api.github.com/repos/hrydgard/ppsspp/subscribers","subscription_url":"https://api.github.com/repos/hrydgard/ppsspp/subscription","commits_url":"https://api.github.com/repos/hrydgard/ppsspp/commits{/sha}","git_commits_url":"https://api.github.com/repos/hrydgard/ppsspp/git/commits{/sha}","comments_url":"https://api.github.com/repos/hrydgard/ppsspp/comments{/number}","issue_comment_url":"https://api.github.com/repos/hrydgard/ppsspp/issues/comments{/number}","contents_url":"https://api.github.com/repos/hrydgard/ppsspp/contents/{+path}","compare_url":"https://api.github.com/repos/hrydgard/ppsspp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hrydgard/ppsspp/merges","archive_url":"https://api.github.com/repos/hrydgard/ppsspp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hrydgard/ppsspp/downloads","issues_url":"https://api.github.com/repos/hrydgard/ppsspp/issues{/number}","pulls_url":"https://api.github.com/repos/hrydgard/ppsspp/pulls{/number}","milestones_url":"https://api.github.com/repos/hrydgard/ppsspp/milestones{/number}","notifications_url":"https://api.github.com/repos/hrydgard/ppsspp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hrydgard/ppsspp/labels{/name}","releases_url":"https://api.github.com/repos/hrydgard/ppsspp/releases{/id}","created_at":"2012-11-01T08:41:48Z","updated_at":"2015-10-08T02:08:11Z","pushed_at":"2015-10-08T07:06:46Z","git_url":"git://github.com/hrydgard/ppsspp.git","ssh_url":"git@github.com:hrydgard/ppsspp.git","clone_url":"https://github.com/hrydgard/ppsspp.git","svn_url":"https://github.com/hrydgard/ppsspp","homepage":"http://www.ppsspp.org","size":324959,"stargazers_count":1892,"watchers_count":1892,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":827,"mirror_url":null,"open_issues_count":640,"forks":827,"open_issues":640,"watchers":1892,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hrydgard/ppsspp/pulls/8036"},"html":{"href":"https://github.com/hrydgard/ppsspp/pull/8036"},"issue":{"href":"https://api.github.com/repos/hrydgard/ppsspp/issues/8036"},"comments":{"href":"https://api.github.com/repos/hrydgard/ppsspp/issues/8036/comments"},"review_comments":{"href":"https://api.github.com/repos/hrydgard/ppsspp/pulls/8036/comments"},"review_comment":{"href":"https://api.github.com/repos/hrydgard/ppsspp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hrydgard/ppsspp/pulls/8036/commits"},"statuses":{"href":"https://api.github.com/repos/hrydgard/ppsspp/statuses/4e9a9583b6f5469d3d38fc47654425c5edbc3bae"}}}}