Skip to content

Commit 44f19c0

Browse files
committed
Deleted some commented out code.
1 parent 4d3fef0 commit 44f19c0

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
lines changed

src/LoopVectorization.jl

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,6 @@ const SLEEFPiratesDict = Dict{Symbol,Tuple{Symbol,Symbol}}(
6262

6363
@noinline function _spirate(ex, dict, macro_escape = true, mod = :LoopVectorization)
6464
ex = postwalk(ex) do x
65-
# @show x
66-
# if @capture(x, LoopVectorization.SIMDPirates.vadd(LoopVectorization.SIMDPirates.vmul(a_, b_), c_)) || @capture(x, LoopVectorization.SIMDPirates.vadd(c_, LoopVectorization.SIMDPirates.vmul(a_, b_)))
67-
# return :(LoopVectorization.SIMDPirates.vmuladd($a, $b, $c))
68-
# elseif @capture(x, LoopVectorization.SIMDPirates.vadd(LoopVectorization.SIMDPirates.vmul(a_, b_), LoopVectorization.SIMDPirates.vmul(c_, d_), e_)) || @capture(x, LoopVectorization.SIMDPirates.vadd(LoopVectorization.SIMDPirates.vmul(a_, b_), e_, LoopVectorization.SIMDPirates.vmul(c_, d_))) || @capture(x, LoopVectorization.SIMDPirates.vadd(e_, LoopVectorization.SIMDPirates.vmul(a_, b_), LoopVectorization.SIMDPirates.vmul(c_, d_)))
69-
# return :(LoopVectorization.SIMDPirates.vmuladd($a, $b, LoopVectorization.SIMDPirates.vmuladd($c, $d, $e)))
70-
# elseif @capture(x, LoopVectorization.SIMDPirates.vadd(LoopVectorization.SIMDPirates.vmul(b_, c_), LoopVectorization.SIMDPirates.vmul(d_, e_), LoopVectorization.SIMDPirates.vmul(f_, g_), a_)) ||
71-
# @capture(x, LoopVectorization.SIMDPirates.vadd(LoopVectorization.SIMDPirates.vmul(b_, c_), LoopVectorization.SIMDPirates.vmul(d_, e_), a_, LoopVectorization.SIMDPirates.vmul(f_, g_))) ||
72-
# @capture(x, LoopVectorization.SIMDPirates.vadd(LoopVectorization.SIMDPirates.vmul(b_, c_), a_, LoopVectorization.SIMDPirates.vmul(d_, e_), LoopVectorization.SIMDPirates.vmul(f_, g_))) ||
73-
# @capture(x, LoopVectorization.SIMDPirates.vadd(a_, LoopVectorization.SIMDPirates.vmul(b_, c_), LoopVectorization.SIMDPirates.vmul(d_, e_), LoopVectorization.SIMDPirates.vmul(f_, g_)))
74-
# return :(LoopVectorization.SIMDPirates.vmuladd($g, $f, LoopVectorization.SIMDPirates.vmuladd($e, $d, LoopVectorization.SIMDPirates.vmuladd($c, $b, $a))))
75-
# elseif @capture(x, a_ * b_ + c_ - c_) || @capture(x, c_ + a_ * b_ - c_) || @capture(x, a_ * b_ - c_ + c_) || @capture(x, - c_ + a_ * b_ + c_)
76-
# return :(LoopVectorization.SIMDPirates.vmul($a, $b))
77-
# elseif @capture(x, a_ * b_ + c_ - d_) || @capture(x, c_ + a_ * b_ - d_) || @capture(x, a_ * b_ - d_ + c_) || @capture(x, - d_ + a_ * b_ + c_) || @capture(x, LoopVectorization.SIMDPirates.vsub(LoopVectorization.SIMDPirates.vmuladd(a_, b_, c_), d_))
78-
# return :(LoopVectorization.SIMDPirates.vmuladd($a, $b, LoopVectorization.SIMDPirates.vsub($c, $d)))
79-
# elseif @capture(x, a_ += b_)
8065
if @capture(x, a_ += b_)
8166
return :($a = $mod.vadd($a, $b))
8267
elseif @capture(x, a_ -= b_)
@@ -122,27 +107,12 @@ end
122107

123108

124109

125-
# mask_expr(W, r) = :($(Expr(:tuple, [i > r ? Core.VecElement{Bool}(false) : Core.VecElement{Bool}(true) for i ∈ 1:W]...)))
126-
127110
"""
128111
Returns the strides necessary to iterate across rows.
129112
Needs `@inferred` testing / that the compiler optimizes it away
130113
whenever size(A) is known at compile time. Seems to be the case for Julia 1.1.
131114
"""
132115
@inline stride_row(A::AbstractArray) = size(A,1)
133-
# @inline function num_row_strides(A::AbstractArray)
134-
# s = size(A)
135-
# N = s[2]
136-
# for i ∈ 3:length(s)
137-
# N *= s[i]
138-
# end
139-
# N
140-
# end
141-
# @inline function stride_row_iter(A::AbstractArray)
142-
# N = num_row_strides(A)
143-
# stride = stride_row(A)
144-
# ntuple(i -> (i-1) * stride, Val(N))
145-
# end
146116

147117
function replace_syms_i(expr, set, i)
148118
postwalk(expr) do ex
@@ -159,10 +129,6 @@ end
159129
vectorize_body(N, Float32, uf, n, body, vecdict, VType, mod)
160130
elseif Tsym == :Float64
161131
vectorize_body(N, Float64, uf, n, body, vecdict, VType, mod)
162-
# elseif Tsym == :ComplexF32
163-
# vectorize_body(N, ComplexF32, uf, n, body, vecdict, VType)
164-
# elseif Tsym == :ComplexF64
165-
# vectorize_body(N, ComplexF64, uf, n, body, vecdict, VType)
166132
else
167133
throw("Type $Tsym is not supported.")
168134
end
@@ -183,25 +149,14 @@ end
183149
else
184150
log2unroll = 0
185151
end
186-
#
187-
# W *= unroll_factor
188-
# @show W, REGISTER_SIZE, T_size
189-
# @show T
190152
WT = W * T_size
191153
V = VType{W,T}
192154

193-
# @show body
194-
195-
# body = _pirate(body)
196-
197-
# indexed_expressions = Dict{Symbol,Expr}()
198155
indexed_expressions = Dict{Symbol,Symbol}() # Symbol, gensymbol
199156

200157
itersym = gensym(:i)
201158
# walk the expression, searching for all get index patterns.
202159
# these will be replaced with
203-
# Plan: definition of q will create vectors
204-
205160
main_body = quote end
206161
reduction_symbols = Dict{Tuple{Symbol,Symbol},Symbol}()
207162
loaded_exprs = Dict{Expr,Symbol}()

0 commit comments

Comments
 (0)