Skip to content

Commit e0064f1

Browse files
committed
Fix contract_pass for vmul/vadd no longer allowing contraction to fma.
1 parent de714d4 commit e0064f1

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "LoopVectorization"
22
uuid = "bdcacae8-1622-11e9-2a5c-532679323890"
33
authors = ["Chris Elrod <[email protected]>"]
4-
version = "0.9.4"
4+
version = "0.9.5"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

src/add_compute.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ function add_pow!(
357357
while (t -= 1) >= 0
358358
xop = add_compute!(ls, gensym(:pbs), :abs2, [xop], elementbytes)
359359
end
360-
yop = add_compute!(ls, iszero(pint) ? var : gensym(:pbs), :vmul, [xop, yop], elementbytes)
360+
yop = add_compute!(ls, iszero(pint) ? var : gensym(:pbs), :(*), [xop, yop], elementbytes)
361361
end
362362
yop
363363
end

src/vectorizationbase_compat/contract_pass.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ function mulexpr(mulexargs)
1818
cc = mulexprcost(c)
1919
maxc = max(ac, bc, cc)
2020
if ac == maxc
21-
return (a, Expr(:call, :vmul, b, c))
21+
return (a, Expr(:call, :(*), b, c))
2222
elseif bc == maxc
23-
return (b, Expr(:call, :vmul, a, c))
23+
return (b, Expr(:call, :(*), a, c))
2424
else
25-
return (c, Expr(:call, :vmul, a, b))
25+
return (c, Expr(:call, :(*), a, b))
2626
end
2727
else
28-
return (a, Expr(:call, :vmul, @view(mulexargs[2:end])...)::Expr)
28+
return (a, Expr(:call, :(*), @view(mulexargs[2:end])...)::Expr)
2929
end
3030
a = (mulexargs[1])::Union{Symbol,Expr,Number}
3131
b = if length(mulexargs) == 2 # two arg mul
3232
(mulexargs[2])::Union{Symbol,Expr,Number}
3333
else
34-
Expr(:call, :vmul, @view(mulexargs[2:end])...)::Expr
34+
Expr(:call, :(*), @view(mulexargs[2:end])...)::Expr
3535
end
3636
a, b
3737
end
@@ -143,19 +143,19 @@ function contract!(expr::Expr, ex::Expr, i::Int, mod = nothing)
143143
# if ex.head === :call
144144
# expr.args[i] = capture_muladd(ex, mod)
145145
if ex.head === :(+=)
146-
call = Expr(:call, :vadd)
146+
call = Expr(:call, :(+))
147147
append!(call.args, ex.args)
148148
expr.args[i] = ex = Expr(:(=), first(ex.args), call)
149149
elseif ex.head === :(-=)
150-
call = Expr(:call, :vsub)
150+
call = Expr(:call, :(-))
151151
append!(call.args, ex.args)
152152
expr.args[i] = ex = Expr(:(=), first(ex.args), call)
153153
elseif ex.head === :(*=)
154-
call = Expr(:call, :vmul)
154+
call = Expr(:call, :(*))
155155
append!(call.args, ex.args)
156156
expr.args[i] = ex = Expr(:(=), first(ex.args), call)
157157
elseif ex.head === :(/=)
158-
call = Expr(:call, :vfdiv)
158+
call = Expr(:call, :(/))
159159
append!(call.args, ex.args)
160160
expr.args[i] = ex = Expr(:(=), first(ex.args), call)
161161
end

0 commit comments

Comments
 (0)