Skip to content

Commit d52717c

Browse files
committed
Added loop support for single precision.
1 parent b48c1fb commit d52717c

File tree

7 files changed

+437
-349
lines changed

7 files changed

+437
-349
lines changed

Manifest.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ version = "0.1.0"
6767

6868
[[SLEEFPirates]]
6969
deps = ["SIMDPirates", "VectorizationBase"]
70-
git-tree-sha1 = "01ff5ddb2fe743e93a6d80b072a02cceb90592bf"
70+
git-tree-sha1 = "1c5b6827da87a12bdb7a4c893f44c3adbce3389d"
7171
repo-rev = "master"
7272
repo-url = "https://github.com/chriselrod/SLEEFPirates.jl"
7373
uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa"
74-
version = "0.1.0"
74+
version = "0.1.1"
7575

7676
[[Serialization]]
7777
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
@@ -85,6 +85,6 @@ uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
8585

8686
[[VectorizationBase]]
8787
deps = ["CpuId", "LinearAlgebra"]
88-
git-tree-sha1 = "30dd7fd08829bfa0fa6c57bf84a7daeac2e9462b"
88+
git-tree-sha1 = "5781ee225e9eee92b7463076411c35d26c444570"
8989
uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
90-
version = "0.1.1"
90+
version = "0.1.3"

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ VectorizationBase = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
1515
MacroTools = "0.5"
1616
Parameters = "0.12.0"
1717
SIMDPirates = "0.1.0"
18-
SLEEFPirates = "0.1.0"
19-
VectorizationBase = "0.1.2"
18+
SLEEFPirates = "0.1.1"
19+
VectorizationBase = "0.1.3"
2020
julia = "1.0.0"
2121

2222
[extras]

benchmarks/driver.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# pkgdir(pkg::String) = abspath(joinpath(dirname(Base.find_package(pkg)), ".."))
2+
# const LOOPVECBENCHDIR = joinpath(pkgdir("LoopVectorization"), "benchmarks")
3+
# includet(joinpath(LOOPVECBENCHDIR, "driver.jl"))
4+
15
pkgdir(pkg::String) = abspath(joinpath(dirname(Base.find_package(pkg)), ".."))
26
const LOOPVECBENCHDIR = joinpath(pkgdir("LoopVectorization"), "benchmarks")
37
include(joinpath(LOOPVECBENCHDIR, "looptests.jl"))

src/LoopVectorization.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module LoopVectorization
22

33
using VectorizationBase, SIMDPirates, SLEEFPirates, MacroTools, Parameters
4-
using VectorizationBase: REGISTER_SIZE, REGISTER_COUNT, extract_data, num_vector_load_expr, mask
4+
using VectorizationBase: REGISTER_SIZE, REGISTER_COUNT, extract_data, num_vector_load_expr, mask, masktable, pick_vector_width_val, valmul, valrem, valmuladd
55
using SIMDPirates: VECTOR_SYMBOLS, evadd, evmul, vrange, reduced_add, reduced_prod
66
using Base.Broadcast: Broadcasted, DefaultArrayStyle
77
using LinearAlgebra: Adjoint

src/graphs.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,15 @@ function looprange(ls::LoopSet, s::Symbol, incr::Int = 1, mangledname::Symbol =
165165
Expr(:call, :<, mangledname, loop.hintexact ? loop.rangehint - incr : Expr(:call, :-, loop.rangesym, incr))
166166
end
167167
end
168+
function looprange(ls::LoopSet, s::Symbol, incr::Expr, mangledname::Symbol = s, loop = ls.loops[s])
169+
increxpr = Expr(:call, :-, incr, 1)
170+
increxpr = if loop.hintexact
171+
Expr(:call, :-, loop.rangehint, increxpr)
172+
else
173+
Expr(:call, :-, loop.rangesym, increxpr)
174+
end
175+
Expr(:call, :<, mangledname, increxpr)
176+
end
168177
function Base.length(ls::LoopSet, is::Symbol)
169178
ls.loops[is].rangehint
170179
end

0 commit comments

Comments
 (0)