Skip to content

Commit 63fccf4

Browse files
committed
2 parents 840a77c + a40aa0f commit 63fccf4

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,12 @@
55
[![Build Status](https://travis-ci.com/chriselrod/LoopVectorization.jl.svg?branch=master)](https://travis-ci.com/chriselrod/LoopVectorization.jl)
66
[![Build Status](https://ci.appveyor.com/api/projects/status/github/chriselrod/LoopVectorization.jl?svg=true)](https://ci.appveyor.com/project/chriselrod/LoopVectorization-jl)
77
[![Codecov](https://codecov.io/gh/chriselrod/LoopVectorization.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/chriselrod/LoopVectorization.jl)
8+
9+
## Installation
10+
```
11+
using Pkg
12+
Pkg.add(PackageSpec(url="https://github.com/chriselrod/VectorizationBase.jl"))
13+
Pkg.add(PackageSpec(url="https://github.com/chriselrod/SIMDPirates.jl"))
14+
Pkg.add(PackageSpec(url="https://github.com/chriselrod/SLEEFPirates.jl"))
15+
Pkg.add(PackageSpec(url="https://github.com/chriselrod/LoopVectorization.jl"))
16+
```

src/LoopVectorization.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module LoopVectorization
22

33
using VectorizationBase, SIMDPirates, SLEEFPirates, MacroTools
44
using VectorizationBase: REGISTER_SIZE, extract_data, num_vector_load_expr
5-
using SIMDPirates: VECTOR_SYMBOLS
5+
using SIMDPirates: VECTOR_SYMBOLS, evadd, evmul
66
using MacroTools: @capture, prewalk, postwalk
77

88
export vectorizable, @vectorize, @vvectorize
@@ -133,7 +133,11 @@ end
133133
throw("Type $Tsym is not supported.")
134134
end
135135
end
136-
@noinline function vectorize_body(N, T::DataType, unroll_factor::Int, n, body, vecdict = SLEEFPiratesDict, VType = SVec, gcpreserve::Bool = true, mod = :LoopVectorization)
136+
@noinline function vectorize_body(
137+
N, ::Type{T}, unroll_factor::Int, n::Symbol, body::Array{Any},
138+
vecdict::Dict{Symbol,Tuple{Symbol,Symbol}} = SLEEFPiratesDict,
139+
@nospecialize(VType = SVec), gcpreserve::Bool = true, mod = :LoopVectorization
140+
) where {T}
137141
# unroll_factor == 1 || throw("Only unroll factor of 1 is currently supported. Was set to $unroll_factor.")
138142
T_size = sizeof(T)
139143
if isa(N, Integer)
@@ -295,7 +299,7 @@ end
295299
pushfirst!(q.args, :($gsym = $mod.vbroadcast($V,one($T))))
296300
end
297301
end
298-
func = ((op == :*) | (op == :/)) ? :($mod.vmul) : :($mod.vadd)
302+
func = ((op == :*) | (op == :/)) ? :($mod.evmul) : :($mod.evadd)
299303
uf_new = unroll_factor
300304
while uf_new > 1
301305
uf_new, uf_prev = uf_new >> 1, uf_new

0 commit comments

Comments
 (0)