{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/21099","repository_url":"https://api.github.com/repos/JuliaLang/julia","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/21099/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/21099/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/21099/events","html_url":"https://github.com/JuliaLang/julia/pull/21099","id":215310012,"number":21099,"title":"RFC: Make `@fastmath` aware of `Base.literal_pow`","user":{"login":"ajkeller34","id":7145721,"avatar_url":"https://avatars3.githubusercontent.com/u/7145721?v=4","gravatar_id":"","url":"https://api.github.com/users/ajkeller34","html_url":"https://github.com/ajkeller34","followers_url":"https://api.github.com/users/ajkeller34/followers","following_url":"https://api.github.com/users/ajkeller34/following{/other_user}","gists_url":"https://api.github.com/users/ajkeller34/gists{/gist_id}","starred_url":"https://api.github.com/users/ajkeller34/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajkeller34/subscriptions","organizations_url":"https://api.github.com/users/ajkeller34/orgs","repos_url":"https://api.github.com/users/ajkeller34/repos","events_url":"https://api.github.com/users/ajkeller34/events{/privacy}","received_events_url":"https://api.github.com/users/ajkeller34/received_events","type":"User","site_admin":false},"labels":[{"id":250223102,"url":"https://api.github.com/repos/JuliaLang/julia/labels/lowering","name":"lowering","color":"5319e7","default":false},{"id":171885699,"url":"https://api.github.com/repos/JuliaLang/julia/labels/maths","name":"maths","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-03-20T00:35:03Z","updated_at":"2017-07-21T15:34:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/21099","html_url":"https://github.com/JuliaLang/julia/pull/21099","diff_url":"https://github.com/JuliaLang/julia/pull/21099.diff","patch_url":"https://github.com/JuliaLang/julia/pull/21099.patch"},"body":"as `Base.literal_pow(Base.FastMath.pow_fast, x, Val{p})`.\r\n\r\nThanks to PRs #20530 and #20889, exponentiation of a dimensionful quantity can be type-stable in some important circumstances. However, because macro expansion occurs before the `Val` lowering happens, `@fastmath x^2` cannot be type-stable for dimensionful quantities, whereas `x^2` could be. This is because `@fastmath x^2` is macro-expanded to `Base.FastMath.pow_fast(x,2)` and so we can never catch the `^` symbol. See the tests I added to get an idea of how this works.\r\n\r\nProvided the premise of this PR isn't flawed somehow, it would probably good to have someone more familiar with `julia_syntax.scm` see if there’s a better way to implement this change. Because I tie into the mechanism introduced in #20889 I don't expect any \"surprising behaviors\" to be introduced here, though I haven't checked to see if there are any performance implications."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/317033564","html_url":"https://github.com/JuliaLang/julia/pull/21099#issuecomment-317033564","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/21099","id":317033564,"user":{"login":"KristofferC","id":1282691,"avatar_url":"https://avatars1.githubusercontent.com/u/1282691?v=4","gravatar_id":"","url":"https://api.github.com/users/KristofferC","html_url":"https://github.com/KristofferC","followers_url":"https://api.github.com/users/KristofferC/followers","following_url":"https://api.github.com/users/KristofferC/following{/other_user}","gists_url":"https://api.github.com/users/KristofferC/gists{/gist_id}","starred_url":"https://api.github.com/users/KristofferC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KristofferC/subscriptions","organizations_url":"https://api.github.com/users/KristofferC/orgs","repos_url":"https://api.github.com/users/KristofferC/repos","events_url":"https://api.github.com/users/KristofferC/events{/privacy}","received_events_url":"https://api.github.com/users/KristofferC/received_events","type":"User","site_admin":false},"created_at":"2017-07-21T15:34:17Z","updated_at":"2017-07-21T15:34:17Z","body":"@nanosoldier `runbenchmarks(ALL, vs = \":master\")`"}}
{"actor":{"display_login":"KristofferC"}}