Skip to content

Commit a776235

Browse files
committed
shufflescalar
1 parent 8a3e0e7 commit a776235

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "VectorizationBase"
22
uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
33
authors = ["Chris Elrod <elrodc@gmail.com>"]
4-
version = "0.21.37"
4+
version = "0.21.38"
55

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

src/llvm_intrin/vector_ops.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ end
5353
)
5454
end
5555
end
56+
@inline shufflevector(x::T, y::T, ::Val{(0,1)}) where {T<:NativeTypes} = Vec(x, y)
57+
@inline shufflevector(x::T, y::T, ::Val{(1,0)}) where {T<:NativeTypes} = Vec(y, x)
5658
@generated function shufflevector(v1::Vec{W,T}, ::Val{I}) where {W,T,I}
59+
if length(I) == 1
60+
return Expr(:block, Expr(:meta,:inline), :(extractelement(v1, $(only(I)))))
61+
end
5762
M, instrs = shufflevector_instrs(W, T, tupletostringvector(I), 0)
5863
quote
5964
$(Expr(:meta, :inline))

0 commit comments

Comments
 (0)