Skip to content

Commit a58dc30

Browse files
committed
Use multi-arg pick_vecotor_width val function with _avx_!.
1 parent 879527a commit a58dc30

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/lowering.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,10 @@ function setup_preamble!(ls::LoopSet, us::UnrollSpecification)
344344
vectorized = order[vectorizedloopnum]
345345
# println("Setup preamble")
346346
W = ls.W; typeT = ls.T
347-
length(ls.includedarrays) == 0 || push!(ls.preamble.args, Expr(:(=), typeT, determine_eltype(ls)))
348-
push!(ls.preamble.args, Expr(:(=), W, determine_width(ls, vectorized)))
347+
if length(ls.includedarrays) >= 0
348+
push!(ls.preamble.args, Expr(:(=), typeT, determine_eltype(ls)))
349+
push!(ls.preamble.args, Expr(:(=), W, determine_width(ls, vectorized)))
350+
end
349351
lower_licm_constants!(ls)
350352
pushpreamble!(ls, definemask(getloop(ls, vectorized), W))#, U > 1 && unrolledloopnum == vectorizedloopnum))
351353
for op operations(ls)

src/reconstruct_loopset.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ function avx_loopset(instr, ops, arf, AM, LPSYM, LB, vargs)
383383
expandedv = [isexpanded(ls, ops, nopsv, i) for i eachindex(ops)]
384384
mrefs = create_mrefs!(ls, arf, arraysymbolinds, opsymbols, nopsv, expandedv, vargs)
385385
pushpreamble!(ls, Expr(:(=), ls.T, Expr(:call, :promote_type, [Expr(:call, :eltype, vptr(mref)) for mref mrefs]...)))
386+
pushpreamble!(ls, Expr(:(=), ls.W, Expr(:call, lv(:pick_vector_width_val), [Expr(:call, :eltype, vptr(mref)) for mref mrefs]...)))
386387
num_params = num_arrays + num_parameters(AM)
387388
num_params = add_ops!(ls, instr, ops, mrefs, opsymbols, num_params, nopsv, expandedv, elementbytes)
388389
process_metadata!(ls, AM, length(arf))

test/ifelsemasks.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ T = Float32
6868
t
6969
end
7070

71-
7271
function addormul!(c, a, b)
7372
for i eachindex(c,a,b)
7473
c[i] = a[i] > b[i] ? a[i] + b[i] : a[i] * b[i]

0 commit comments

Comments
 (0)