{"action":"created","comment":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/comments/61541132","id":61541132,"diff_hunk":"@@ -0,0 +1,43 @@\n+- Feature Name: cfg_target_has_floating_point\n+- Start Date: 2016-04-20\n+- RFC Issue: [rust-lang/rfcs#1364](https://github.com/rust-lang/rfcs/issues/1364)\n+- RFC PR: \n+- Rust Issue: \n+- Rust PR: [rust-lang/rust#32651](https://github.com/rust-lang/rust/pull/32651)\n+\n+# Summary\n+[summary]: #summary\n+\n+Add target `has_floating_point` property and disable floating-point instruction emission when compiling libcore if false.\n+\n+# Motivation\n+[motivation]: #motivation\n+\n+* Some processors, e.g. some ARM processors, lack hardware for floating-point operations.\n+* Many kernels, e.g. Linux, forbid floating-point. Saving the floating-point registers is costly, and if the kernel uses floating-point instructions it must do so at every interrupt and system call. As kernel code usually never needs floating-point, it makes sense to forbid it altogether to not pay the cost of saving the registers.\n+\n+The modifications proposed in this RFC would enable writing code for such processors or for such kernels in Rust.\n+\n+Even if floating-point features of libcore are not used, when it is built for a target with floating-point enabled, some non-floating-point operations may be emitted as MMX or SSE instructions on architectures which have them, so emitting such instructions must be disabled, but on some such architectures, e.g. amd64, the ABI specifies floating-point arguments passed in SSE registers, so floating-point must be disabled altogether.\n+\n+# Detailed design\n+[design]: #detailed-design\n+\n+Add an optional `has_floating_point` property, default true, gated as `cfg_target_has_floating_point`. Disable all floating-point use in libcore if this flag is false.","path":"text/0000-optional-float-free-libcore.md","position":26,"original_position":26,"commit_id":"4d02908564f88618b9d37fc299af70af748159ac","original_commit_id":"c8ecdb0910ede16043a9ef2ccadb21c416cbc244","user":{"login":"strake","id":976729,"avatar_url":"https://avatars.githubusercontent.com/u/976729?v=3","gravatar_id":"","url":"https://api.github.com/users/strake","html_url":"https://github.com/strake","followers_url":"https://api.github.com/users/strake/followers","following_url":"https://api.github.com/users/strake/following{/other_user}","gists_url":"https://api.github.com/users/strake/gists{/gist_id}","starred_url":"https://api.github.com/users/strake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strake/subscriptions","organizations_url":"https://api.github.com/users/strake/orgs","repos_url":"https://api.github.com/users/strake/repos","events_url":"https://api.github.com/users/strake/events{/privacy}","received_events_url":"https://api.github.com/users/strake/received_events","type":"User","site_admin":false},"body":"The notion is, this flag merely disables all floating-point code in libcore, and the \"features\" flag affects code generation. So one would define a target with has_floating_point: false and features: -mmx, -sse, ...\r\n","created_at":"2016-04-29T07:12:17Z","updated_at":"2016-04-29T07:12:17Z","html_url":"https://github.com/rust-lang/rfcs/pull/1596#discussion_r61541132","pull_request_url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1596","_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/comments/61541132"},"html":{"href":"https://github.com/rust-lang/rfcs/pull/1596#discussion_r61541132"},"pull_request":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/1596"}}},"pull_request":{"url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1596","id":68157588,"html_url":"https://github.com/rust-lang/rfcs/pull/1596","diff_url":"https://github.com/rust-lang/rfcs/pull/1596.diff","patch_url":"https://github.com/rust-lang/rfcs/pull/1596.patch","issue_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1596","number":1596,"state":"open","locked":false,"title":"RFC: Float-free libcore","user":{"login":"strake","id":976729,"avatar_url":"https://avatars.githubusercontent.com/u/976729?v=3","gravatar_id":"","url":"https://api.github.com/users/strake","html_url":"https://github.com/strake","followers_url":"https://api.github.com/users/strake/followers","following_url":"https://api.github.com/users/strake/following{/other_user}","gists_url":"https://api.github.com/users/strake/gists{/gist_id}","starred_url":"https://api.github.com/users/strake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strake/subscriptions","organizations_url":"https://api.github.com/users/strake/orgs","repos_url":"https://api.github.com/users/strake/repos","events_url":"https://api.github.com/users/strake/events{/privacy}","received_events_url":"https://api.github.com/users/strake/received_events","type":"User","site_admin":false},"body":"phil-opp made the PR on rust-lang/rust repo, but this is blocking me so i wrote the RFC. phil-opp is welcome to claim this from me if they wish.","created_at":"2016-04-28T03:09:49Z","updated_at":"2016-04-29T07:12:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"046a65dc71372f53d557f35cd08c392ed122dbc2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1596/commits","review_comments_url":"https://api.github.com/repos/rust-lang/rfcs/pulls/1596/comments","review_comment_url":"https://api.github.com/repos/rust-lang/rfcs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/issues/1596/comments","statuses_url":"https://api.github.com/repos/rust-lang/rfcs/statuses/4d02908564f88618b9d37fc299af70af748159ac","head":{"label":"strake:float-free_libcore","ref":"float-free_libcore","sha":"4d02908564f88618b9d37fc299af70af748159ac","user":{"login":"strake","id":976729,"avatar_url":"https://avatars.githubusercontent.com/u/976729?v=3","gravatar_id":"","url":"https://api.github.com/users/strake","html_url":"https://github.com/strake","followers_url":"https://api.github.com/users/strake/followers","following_url":"https://api.github.com/users/strake/following{/other_user}","gists_url":"https://api.github.com/users/strake/gists{/gist_id}","starred_url":"https://api.github.com/users/strake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strake/subscriptions","organizations_url":"https://api.github.com/users/strake/orgs","repos_url":"https://api.github.com/users/strake/repos","events_url":"https://api.github.com/users/strake/events{/privacy}","received_events_url":"https://api.github.com/users/strake/received_events","type":"User","site_admin":false},"repo":{"id":57266638,"name":"rfcs.rs","full_name":"strake/rfcs.rs","owner":{"login":"strake","id":976729,"avatar_url":"https://avatars.githubusercontent.com/u/976729?v=3","gravatar_id":"","url":"https://api.github.com/users/strake","html_url":"https://github.com/strake","followers_url":"https://api.github.com/users/strake/followers","following_url":"https://api.github.com/users/strake/following{/other_user}","gists_url":"https://api.github.com/users/strake/gists{/gist_id}","starred_url":"https://api.github.com/users/strake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/strake/subscriptions","organizations_url":"https://api.github.com/users/strake/orgs","repos_url":"https://api.github.com/users/strake/repos","events_url":"https://api.github.com/users/strake/events{/privacy}","received_events_url":"https://api.github.com/users/strake/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/strake/rfcs.rs","description":"RFCs for changes to Rust","fork":true,"url":"https://api.github.com/repos/strake/rfcs.rs","forks_url":"https://api.github.com/repos/strake/rfcs.rs/forks","keys_url":"https://api.github.com/repos/strake/rfcs.rs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/strake/rfcs.rs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/strake/rfcs.rs/teams","hooks_url":"https://api.github.com/repos/strake/rfcs.rs/hooks","issue_events_url":"https://api.github.com/repos/strake/rfcs.rs/issues/events{/number}","events_url":"https://api.github.com/repos/strake/rfcs.rs/events","assignees_url":"https://api.github.com/repos/strake/rfcs.rs/assignees{/user}","branches_url":"https://api.github.com/repos/strake/rfcs.rs/branches{/branch}","tags_url":"https://api.github.com/repos/strake/rfcs.rs/tags","blobs_url":"https://api.github.com/repos/strake/rfcs.rs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/strake/rfcs.rs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/strake/rfcs.rs/git/refs{/sha}","trees_url":"https://api.github.com/repos/strake/rfcs.rs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/strake/rfcs.rs/statuses/{sha}","languages_url":"https://api.github.com/repos/strake/rfcs.rs/languages","stargazers_url":"https://api.github.com/repos/strake/rfcs.rs/stargazers","contributors_url":"https://api.github.com/repos/strake/rfcs.rs/contributors","subscribers_url":"https://api.github.com/repos/strake/rfcs.rs/subscribers","subscription_url":"https://api.github.com/repos/strake/rfcs.rs/subscription","commits_url":"https://api.github.com/repos/strake/rfcs.rs/commits{/sha}","git_commits_url":"https://api.github.com/repos/strake/rfcs.rs/git/commits{/sha}","comments_url":"https://api.github.com/repos/strake/rfcs.rs/comments{/number}","issue_comment_url":"https://api.github.com/repos/strake/rfcs.rs/issues/comments{/number}","contents_url":"https://api.github.com/repos/strake/rfcs.rs/contents/{+path}","compare_url":"https://api.github.com/repos/strake/rfcs.rs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/strake/rfcs.rs/merges","archive_url":"https://api.github.com/repos/strake/rfcs.rs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/strake/rfcs.rs/downloads","issues_url":"https://api.github.com/repos/strake/rfcs.rs/issues{/number}","pulls_url":"https://api.github.com/repos/strake/rfcs.rs/pulls{/number}","milestones_url":"https://api.github.com/repos/strake/rfcs.rs/milestones{/number}","notifications_url":"https://api.github.com/repos/strake/rfcs.rs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/strake/rfcs.rs/labels{/name}","releases_url":"https://api.github.com/repos/strake/rfcs.rs/releases{/id}","deployments_url":"https://api.github.com/repos/strake/rfcs.rs/deployments","created_at":"2016-04-28T03:07:33Z","updated_at":"2016-04-28T03:07:58Z","pushed_at":"2016-04-29T07:08:13Z","git_url":"git://github.com/strake/rfcs.rs.git","ssh_url":"git@github.com:strake/rfcs.rs.git","clone_url":"https://github.com/strake/rfcs.rs.git","svn_url":"https://github.com/strake/rfcs.rs","homepage":"","size":2822,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rust-lang:master","ref":"master","sha":"bf9fca6c712eb5685fe3babcf9333cd2d1631ed3","user":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":17527989,"name":"rfcs","full_name":"rust-lang/rfcs","owner":{"login":"rust-lang","id":5430905,"avatar_url":"https://avatars.githubusercontent.com/u/5430905?v=3","gravatar_id":"","url":"https://api.github.com/users/rust-lang","html_url":"https://github.com/rust-lang","followers_url":"https://api.github.com/users/rust-lang/followers","following_url":"https://api.github.com/users/rust-lang/following{/other_user}","gists_url":"https://api.github.com/users/rust-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/rust-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rust-lang/subscriptions","organizations_url":"https://api.github.com/users/rust-lang/orgs","repos_url":"https://api.github.com/users/rust-lang/repos","events_url":"https://api.github.com/users/rust-lang/events{/privacy}","received_events_url":"https://api.github.com/users/rust-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rust-lang/rfcs","description":"RFCs for changes to Rust","fork":false,"url":"https://api.github.com/repos/rust-lang/rfcs","forks_url":"https://api.github.com/repos/rust-lang/rfcs/forks","keys_url":"https://api.github.com/repos/rust-lang/rfcs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rust-lang/rfcs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rust-lang/rfcs/teams","hooks_url":"https://api.github.com/repos/rust-lang/rfcs/hooks","issue_events_url":"https://api.github.com/repos/rust-lang/rfcs/issues/events{/number}","events_url":"https://api.github.com/repos/rust-lang/rfcs/events","assignees_url":"https://api.github.com/repos/rust-lang/rfcs/assignees{/user}","branches_url":"https://api.github.com/repos/rust-lang/rfcs/branches{/branch}","tags_url":"https://api.github.com/repos/rust-lang/rfcs/tags","blobs_url":"https://api.github.com/repos/rust-lang/rfcs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rust-lang/rfcs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rust-lang/rfcs/git/refs{/sha}","trees_url":"https://api.github.com/repos/rust-lang/rfcs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rust-lang/rfcs/statuses/{sha}","languages_url":"https://api.github.com/repos/rust-lang/rfcs/languages","stargazers_url":"https://api.github.com/repos/rust-lang/rfcs/stargazers","contributors_url":"https://api.github.com/repos/rust-lang/rfcs/contributors","subscribers_url":"https://api.github.com/repos/rust-lang/rfcs/subscribers","subscription_url":"https://api.github.com/repos/rust-lang/rfcs/subscription","commits_url":"https://api.github.com/repos/rust-lang/rfcs/commits{/sha}","git_commits_url":"https://api.github.com/repos/rust-lang/rfcs/git/commits{/sha}","comments_url":"https://api.github.com/repos/rust-lang/rfcs/comments{/number}","issue_comment_url":"https://api.github.com/repos/rust-lang/rfcs/issues/comments{/number}","contents_url":"https://api.github.com/repos/rust-lang/rfcs/contents/{+path}","compare_url":"https://api.github.com/repos/rust-lang/rfcs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rust-lang/rfcs/merges","archive_url":"https://api.github.com/repos/rust-lang/rfcs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rust-lang/rfcs/downloads","issues_url":"https://api.github.com/repos/rust-lang/rfcs/issues{/number}","pulls_url":"https://api.github.com/repos/rust-lang/rfcs/pulls{/number}","milestones_url":"https://api.github.com/repos/rust-lang/rfcs/milestones{/number}","notifications_url":"https://api.github.com/repos/rust-lang/rfcs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rust-lang/rfcs/labels{/name}","releases_url":"https://api.github.com/repos/rust-lang/rfcs/releases{/id}","deployments_url":"https://api.github.com/repos/rust-lang/rfcs/deployments","created_at":"2014-03-07T21:29:00Z","updated_at":"2016-04-29T07:01:01Z","pushed_at":"2016-04-29T07:08:15Z","git_url":"git://github.com/rust-lang/rfcs.git","ssh_url":"git@github.com:rust-lang/rfcs.git","clone_url":"https://github.com/rust-lang/rfcs.git","svn_url":"https://github.com/rust-lang/rfcs","homepage":"","size":5084,"stargazers_count":616,"watchers_count":616,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":305,"mirror_url":null,"open_issues_count":647,"forks":305,"open_issues":647,"watchers":616,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/1596"},"html":{"href":"https://github.com/rust-lang/rfcs/pull/1596"},"issue":{"href":"https://api.github.com/repos/rust-lang/rfcs/issues/1596"},"comments":{"href":"https://api.github.com/repos/rust-lang/rfcs/issues/1596/comments"},"review_comments":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/1596/comments"},"review_comment":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rust-lang/rfcs/pulls/1596/commits"},"statuses":{"href":"https://api.github.com/repos/rust-lang/rfcs/statuses/4d02908564f88618b9d37fc299af70af748159ac"}}}}