Skip to content

Commit 62bed5e

Browse files
committed
<= 256-bit vector fixes.
1 parent d48e959 commit 62bed5e

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/lowering.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,8 @@ function determine_eltype(ls::LoopSet)
573573
end
574574
promote_q
575575
end
576+
@inline _eltype(x) = eltype(x)
577+
@inline _eltype(::BitArray) = VectorizationBase.Bit
576578
function determine_width(
577579
ls::LoopSet, vectorized::Union{Symbol,Nothing}
578580
)
@@ -588,7 +590,7 @@ function determine_width(
588590
push!(vwidth_q.args, ELTYPESYMBOL)
589591
else
590592
for array ls.includedactualarrays
591-
push!(vwidth_q.args, Expr(:call, :eltype, array))
593+
push!(vwidth_q.args, Expr(:call, lv(:_eltype), array))
592594
end
593595
end
594596
vwidth_q

src/mapreduce.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
@inline vreduce(::typeof(min), v::VectorizationBase.AbstractSIMDVector) = vminimum(v)
66
@inline vreduce(op, v::VectorizationBase.AbstractSIMDVector) = _vreduce(op, v)
77
@inline _vreduce(op, v::VectorizationBase.AbstractSIMDVector) = _reduce(op, Vec(v))
8-
@inline function _vreduce(op, v::Vec)
9-
isone(length(v)) && return v[1]
10-
a = op(v[1], v[2])
11-
for i 3:length(v)
12-
a = op(a, v[i])
8+
_vreduce(op, v::Vec{1}) = VectorizationBase.extractelement(v, 0)
9+
@inline function _vreduce(op, v::Vec{W}) where {W}
10+
a = op(VectorizationBase.extractelement(v,0), VectorizationBase.extractelement(v, 1))
11+
for i 2:W-1
12+
a = op(a, VectorizationBase.extractelement(v, i))
1313
end
1414
a
1515
end

0 commit comments

Comments
 (0)