Skip to content

Commit b7d1de7

Browse files
committed
Revert "explicitly SIMD muladd with duals (#562)"
This reverts commit ab0e239.
1 parent 01a056d commit b7d1de7

File tree

3 files changed

+7
-27
lines changed

3 files changed

+7
-27
lines changed

src/ForwardDiff.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ import SpecialFunctions
1616
import LogExpFunctions
1717
import CommonSubexpressions
1818

19-
const SIMDFloat = Union{Float64, Float32}
20-
const SIMDInt = Union{
21-
Int128, Int64, Int32, Int16, Int8,
22-
UInt128, UInt64, UInt32, UInt16, UInt8,
23-
}
24-
const SIMDType = Union{SIMDFloat, SIMDInt}
25-
2619
include("prelude.jl")
2720
include("partials.jl")
2821
include("dual.jl")

src/dual.jl

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -541,16 +541,6 @@ end
541541
# fma #
542542
#-----#
543543

544-
@inline function calc_fma_xyz(x::Dual{T,V,N},
545-
y::Dual{T,V,N},
546-
z::Dual{T,V,N}) where {T, V<:SIMDFloat,N}
547-
xv, yv, zv = value(x), value(y), value(z)
548-
rv = fma(xv, yv, zv)
549-
N == 0 && return Dual{T}(rv)
550-
xp, yp, zp = Vec(partials(x).values), Vec(partials(y).values), Vec(partials(z).values)
551-
parts = Tuple(fma(xv, yp, fma(yv, xp, zp)))
552-
Dual{T}(rv, parts)
553-
end
554544
@generated function calc_fma_xyz(x::Dual{T,<:Any,N},
555545
y::Dual{T,<:Any,N},
556546
z::Dual{T,<:Any,N}) where {T,N}
@@ -593,16 +583,6 @@ end
593583
# muladd #
594584
#--------#
595585

596-
@inline function calc_muladd_xyz(x::Dual{T,V,N},
597-
y::Dual{T,V,N},
598-
z::Dual{T,V,N}) where {T, V<:SIMDType,N}
599-
xv, yv, zv = value(x), value(y), value(z)
600-
rv = muladd(xv, yv, zv)
601-
N == 0 && return Dual{T}(rv)
602-
xp, yp, zp = Vec(partials(x).values), Vec(partials(y).values), Vec(partials(z).values)
603-
parts = Tuple(muladd(xv, yp, muladd(yv, xp, zp)))
604-
Dual{T}(rv, parts)
605-
end
606586
@generated function calc_muladd_xyz(x::Dual{T,<:Any,N},
607587
y::Dual{T,<:Any,N},
608588
z::Dual{T,<:Any,N}) where {T,N}

src/partials.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,13 @@ end
205205
return tupexpr(i -> :(rand(V)), N)
206206
end
207207

208+
209+
const SIMDFloat = Union{Float64, Float32}
210+
const SIMDInt = Union{
211+
Int128, Int64, Int32, Int16, Int8,
212+
UInt128, UInt64, UInt32, UInt16, UInt8,
213+
}
214+
const SIMDType = Union{SIMDFloat, SIMDInt}
208215
const NT{N,T} = NTuple{N,T}
209216

210217
# SIMD implementation

0 commit comments

Comments
 (0)