From 4562f052c5e258437d5f3fdb171f0dc402c606de Mon Sep 17 00:00:00 2001 From: Chris Elrod Date: Sat, 20 Mar 2021 16:48:46 -0400 Subject: [PATCH] Add scalar-VecUnroll method for log_fast --- Project.toml | 2 +- src/log.jl | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 61e4a53..95eaab8 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SLEEFPirates" uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa" authors = ["chriselrod "] -version = "0.6.12" +version = "0.6.13" [deps] IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" diff --git a/src/log.jl b/src/log.jl index 90ff0a7..e4b80de 100644 --- a/src/log.jl +++ b/src/log.jl @@ -236,4 +236,11 @@ else @inline log_fast(d::AbstractSIMD) = log_fast(float(d), False()) end @inline log_fast(d::Union{Float32,Float64}) = log_fast(d, False()) +@generated function log_fast(x::VecUnroll{N,1,T,T}) where {N,T} + quote + $(Expr(:meta,:inline)) + lx = log_fast(VectorizationBase.transpose_vecunroll(x)) + VecUnroll(Base.Cartesian.@ntuple $(N+1) n -> lx(n)) + end +end