Skip to content

Commit

Permalink
Revert "Lower Base.FastMath.pow_fast(x,p) as Base.literal_pow(Base.Fa…
Browse files Browse the repository at this point in the history
…stMath.pow_fast, x, Val{p}) for integer literal p."

This reverts commit 6022416.
  • Loading branch information
ajkeller34 committed Mar 20, 2017
1 parent 6022416 commit d609cb1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
6 changes: 1 addition & 5 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -2058,11 +2058,7 @@
((and (eq? f '^) (length= e 4) (integer? (cadddr e)))
(expand-forms
`(call (top literal_pow) ^ ,(caddr e) (call (core apply_type) (top Val) ,(cadddr e)))))
((and (equal? f `(|.| (|.| Base (inert FastMath)) (inert pow_fast)))
(length= e 4) (integer? (cadddr e)))
(expand-forms
`(call (top literal_pow) (|.| (|.| Base (inert FastMath)) (inert pow_fast))
,(caddr e) (call (core apply_type) (top Val) ,(cadddr e)))))

((and (eq? f '*) (length= e 4))
(expand-transposed-op
e
Expand Down
7 changes: 0 additions & 7 deletions test/fastmath.jl
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,3 @@ let a = ones(2,2), b = ones(2,2)
local c = 0
@test @fastmath(c |= 1) == 1
end

struct LitPowTest end
Base.literal_pow{p}(::typeof(Base.FastMath.pow_fast), ::LitPowTest, ::Type{Val{p}}) = 1
Base.literal_pow{p}(::typeof(^), ::LitPowTest, ::Type{Val{p}}) = 2
LPT = LitPowTest()
@test (@fastmath LPT^2) == 1
@test LPT^2 == 2

0 comments on commit d609cb1

Please sign in to comment.