LoopVectorization.jl icon indicating copy to clipboard operation
LoopVectorization.jl copied to clipboard

possible to support UInt128?

Open pcjentsch opened this issue 4 years ago • 1 comments
trafficstars

Hello!

I am trying to @avx the following code:

function fastmod!(n::Array{UInt32,N},T::Mod) where N
    @avx n .= (convert.(UInt128,(T.modulo_inv .* n)) .* T.modulo) .>> 64
end

the error I get is

MethodError: no method matching UInt128(::VectorizationBase.Vec{8, UInt32})
  Closest candidates are:
    (::Type{T})(::T) where T<:Number at boot.jl:760
    (::Type{T})(::AbstractChar) where T<:Union{AbstractChar, Number} at char.jl:50
    (::Type{T})(::BigInt) where T<:Union{UInt128, UInt16, UInt32, UInt64, UInt8} at gmp.jl:347

which I assume means that UInt128 conversion is not supported.

It is possible on 64-bit architectures to implement this?

Thanks!

pcjentsch avatar Apr 07 '21 02:04 pcjentsch

Julia lowers NTuple{L,Core.VecElement{128}} as LLVM arrays rather than as LLVM vectors, so it would not be trivial to add support.

chriselrod avatar Apr 07 '21 08:04 chriselrod