We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bac51cc commit a75ea4eCopy full SHA for a75ea4e
src/llvm_intrin/conversion.jl
@@ -47,17 +47,24 @@ if (Sys.ARCH === :x86_64) || (Sys.ARCH === :i686)
47
end
48
@inline function _vconvert(
49
::Type{Vec{W,F}},
50
- v::AbstractSIMD{W,I},
+ v::AbstractSIMD{W,UInt64},
51
::False
52
- ) where {W,F,I<:Union{Int64,UInt64}}
+ ) where {W,F}
53
v32 = reinterpret_half(v)
54
vl = extractlower(v32)
55
vu = extractupper(v32)
56
- vfmadd_fast(
57
- F(4.294967296e9),
58
- _vconvert(Vec{W,F}, vl, True()),
59
- _vconvert(Vec{W,F}, vu % UInt32, True())
60
- )
+ x = _vconvert(Vec{W,F}, vu % UInt32, True())
+ vfmadd_fast(F(4.294967296e9), _vconvert(Vec{W,F}, vl, True()), x)
+ end
+ @inline function _vconvert(
+ ::Type{Vec{W,F}},
61
+ v::AbstractSIMD{W,Int64},
62
+ ::False
63
64
+ neg = v < 0
65
+ pos = ifelse(neg, -v, v)
66
+ posf = _vconvert(Vec{W,F}, UInt64(pos), False())
67
+ ifelse(neg, -posf, posf)
68
69
@inline function vconvert(
70
0 commit comments