You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While writing the docs for #15244, I discovered that ccall is passing tuples of VecElement by reference instead of value. Passing by value would be more consistent with the C ABI for SIMD types, e.g. pass a NTuple{8,VecElement{Float32}} as if it were a C AVX __m256.
I'll poke around ccall to see what I need to teach it. Below is the example I was playing with.
typealias m256 NTuple{8,VecElement{Float32}}
convert(::Type{VecElement{Float32}},x::Float32) = VecElement(x)
a = m256(ntuple(i->VecElement(sin(Float32(i))),8))
b = m256(ntuple(i->VecElement(cos(Float32(i))),8))
println(typeof(a))
println(typeof(b))
function call_dist(a::m256, b::m256)
ccall((:dist, "libdist"), m256, (m256, m256), a, b) # C prototype is __m256 dist( __m256 a, __m256 b )
end
@code_llvm call_dist(a,b)
The text was updated successfully, but these errors were encountered:
Looks like the fix involves changing the Classification logic to understand the special tuples. Can someone explain the purpose of the two classes fields here in abi_x86_64.cpp?
While writing the docs for #15244, I discovered that
ccall
is passing tuples ofVecElement
by reference instead of value. Passing by value would be more consistent with the C ABI for SIMD types, e.g. pass aNTuple{8,VecElement{Float32}}
as if it were a C AVX__m256
.I'll poke around
ccall
to see what I need to teach it. Below is the example I was playing with.The text was updated successfully, but these errors were encountered: