Skip to content

Commit f93c523

Browse files
committed
Update for new mask API in VectoriationBase.
1 parent d6ed285 commit f93c523

File tree

3 files changed

+13
-16
lines changed

3 files changed

+13
-16
lines changed

src/add_loads.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ end
7474
struct LoopValue end
7575
@inline VectorizationBase.stridedpointer(::LoopValue) = LoopValue()
7676
@inline VectorizationBase.vload(::LoopValue, i::Tuple{_MM{W}}) where {W} = _MM{W}(@inbounds(i[1].i) + 1)
77-
@inline VectorizationBase.vload(::LoopValue, i::Tuple{_MM{W}}, ::Unsigned) where {W} = _MM{W}(@inbounds(i[1].i) + 1)
77+
# @inline VectorizationBase.vload(::LoopValue, i::Tuple{_MM{W}}, ::Unsigned) where {W} = _MM{W}(@inbounds(i[1].i) + 1)
78+
@inline VectorizationBase.vload(::LoopValue, i::Tuple{_MM{W}}, ::Mask) where {W} = _MM{W}(@inbounds(i[1].i) + 1)
7879
@inline VectorizationBase.vload(::LoopValue, i::Integer) = i + one(i)
7980
@inline VectorizationBase.vload(::LoopValue, i::Tuple{I}) where {I<:Integer} = @inbounds(i[1]) + one(I)
8081
@inline Base.eltype(::LoopValue) = Int8

src/lower_store.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ function lower_conditionalstore_scalar!(
7070
end
7171
nothing
7272
end
73-
@inline combinemasks(a::Unsigned, b::Unsigned) = a & b
74-
@inline combinemasks(a::Unsigned, b::Bool) = b ? a : zero(a)
75-
@inline combinemasks(a::Bool, b::Unsigned) = a ? b : zero(b)
76-
@inline combinemasks(a::Bool, b::Bool) = a & b
7773
function lower_conditionalstore_vectorized!(
7874
q::Expr, op::Operation, vectorized::Symbol, W::Symbol, unrolled::Symbol, tiled::Symbol, U::Int,
7975
suffix::Union{Nothing,Int}, mask::Union{Nothing,Symbol,Unsigned}, isunrolled::Bool
@@ -105,7 +101,7 @@ function lower_conditionalstore_vectorized!(
105101
condvarname = varassignname(condvar, u, condunrolled)
106102
instrcall = Expr(:call, lv(:vstore!), ptr, name, mo)
107103
if mask !== nothing && (vecnotunrolled || u == U - 1)
108-
push!(instrcall.args, Expr(:call, lv(:combinemasks), condvarname, mask))
104+
push!(instrcall.args, Expr(:call, :&, condvarname, mask))
109105
else
110106
push!(instrcall.args, condvarname)
111107
end

src/lowering.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,14 @@ function determine_width(ls::LoopSet, vectorized::Symbol)
232232
if isstaticloop(vloop)
233233
push!(vwidth_q.args, Expr(:call, Expr(:curly, :Val, length(vloop))))
234234
end
235-
push!(vwidth_q.args, ls.T)
236-
# if length(ls.includedactualarrays) < 2
237-
# push!(vwidth_q.args, ls.T)
238-
# else
239-
# for array ∈ ls.includedactualarrays
240-
# push!(vwidth_q.args, Expr(:call, :eltype, array))
241-
# end
242-
# end
235+
# push!(vwidth_q.args, ls.T)
236+
if length(ls.includedactualarrays) < 2
237+
push!(vwidth_q.args, ls.T)
238+
else
239+
for array ls.includedactualarrays
240+
push!(vwidth_q.args, Expr(:call, :eltype, array))
241+
end
242+
end
243243
vwidth_q
244244
end
245245
function lower_unrolled!(
@@ -330,9 +330,9 @@ function lower_unrolled_dynamic!(
330330
end
331331
q
332332
end
333-
function maskexpr(W::Symbol, looplimit, allon::Bool)
333+
function maskexpr(W::Symbol, looplimit, all_on::Bool)
334334
rem = Expr(:call, lv(:valrem), W, looplimit)
335-
Expr(:(=), Symbol("##mask##"), Expr(:call, lv(allon ? :masktable : :mask), W, rem))
335+
Expr(:(=), Symbol("##mask##"), Expr(:call, lv(all_on ? :masktable : :mask), W, rem))
336336
end
337337
function definemask(loop::Loop, W::Symbol, allon::Bool)
338338
if isstaticloop(loop)

0 commit comments

Comments
 (0)