Skip to content

Commit e24028d

Browse files
authored
add simd evalpoly
Co-authored-by: @oscardssmith Actually get right branch information
1 parent 2acf892 commit e24028d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/misc.jl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,18 @@ end
4444
w = fn * 6.07710050650619224932e-11
4545
y = r-w
4646
return unsafe_trunc(Int, fn), Base.Math.DoubleFloat64(y, (r-y)-w)
47-
end
47+
end
48+
49+
function simd_evalpoly_width4(μ, ps::NTuple{N, NTuple{4, T}}) where {N, T}
50+
s1 = ps[N][1]
51+
s2 = ps[N][2]
52+
s3 = ps[N][3]
53+
s4 = ps[N][4]
54+
@inbounds for i in N-1:-1:1
55+
s1 = muladd(μ, s1, ps[i][1])
56+
s2 = muladd(μ, s2, ps[i][2])
57+
s3 = muladd(μ, s3, ps[i][3])
58+
s4 = muladd(μ, s2, ps[i][4])
59+
end
60+
return (s1, s2, s3, s4)
61+
end

0 commit comments

Comments
 (0)