Skip to content

Commit

Permalink
Fix ambiguity in vconvert
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Apr 16, 2024
1 parent 6ff2f24 commit 9847086
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/llvm_intrin/conversion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if (Sys.ARCH === :x86_64) || (Sys.ARCH === :i686)
::Type{Vec{W,F}},
v::Vec{W,T}
)::Vec{W,F} where {W,F<:FloatingTypes,T<:IntegerTypesHW}
_vconvert(Vec{W,F}, v, True())
_vconvert(Vec{W,F}, v, True())::Vec{W,F}
end
@inline function vconvert(
::Type{Vec{W,F}},
Expand All @@ -80,7 +80,7 @@ if (Sys.ARCH === :x86_64) || (Sys.ARCH === :i686)
Vec{W,F},
v,
has_feature(Val(:x86_64_avx512dq)) | (!has_feature(Val(:x86_64_avx2)))
)
)::Vec{W,F}
end
@inline function vconvert(
::Type{F},
Expand All @@ -90,7 +90,7 @@ if (Sys.ARCH === :x86_64) || (Sys.ARCH === :i686)
Vec{W,F},
v,
has_feature(Val(:x86_64_avx512dq)) | (!has_feature(Val(:x86_64_avx2)))
)
)::VecUnroll{N,W,F,Vec{W,F}}
end
@inline function vconvert(
::Type{Vec{W,F}},
Expand All @@ -100,7 +100,7 @@ if (Sys.ARCH === :x86_64) || (Sys.ARCH === :i686)
Vec{W,F},
v,
has_feature(Val(:x86_64_avx512dq)) | (!has_feature(Val(:x86_64_avx2)))
)
)::VecUnroll{N,W,F,Vec{W,F}}
end
@inline function vconvert(
::Type{VecUnroll{N,W,F,Vec{W,F}}},
Expand All @@ -110,7 +110,7 @@ if (Sys.ARCH === :x86_64) || (Sys.ARCH === :i686)
Vec{W,F},
v,
has_feature(Val(:x86_64_avx512dq)) | (!has_feature(Val(:x86_64_avx2)))
)
)::VecUnroll{N,W,F,Vec{W,F}}
end
else
@generated function vconvert(
Expand Down Expand Up @@ -232,6 +232,7 @@ end
@inline vconvert(::Type{T}, s::Union{Float16,Float32,Float64}) where {T<:IntegerTypesHW} = Base.fptosi(T, Base.trunc_llvm(s))
@inline vconvert(::Type{T}, s::IntegerTypesHW) where {T<:Union{Float16,Float32,Float64}} = convert(T, s)::T
@inline vconvert(::Type{T}, s::Union{Float16,Float32,Float64}) where {T<:Union{Float16,Float32,Float64}} = convert(T, s)::T
@inline vconvert(::Type{T}, s::T) where {T<:Union{Float16,Float32,Float64}} = s
@inline vconvert(::Type{T}, s::IntegerTypesHW) where {T<:IntegerTypesHW} = s % T
@inline vconvert(::Type{T}, v::AbstractSIMD{W,T}) where {T<:NativeTypes,W} = v
@inline vconvert(::Type{T}, v::AbstractSIMD{W,S}) where {T<:NativeTypes,S,W} =
Expand Down

0 comments on commit 9847086

Please sign in to comment.