Skip to content

Commit 5107c18

Browse files
committed
Support unpacking up to 14 return values.
1 parent a71379c commit 5107c18

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "LoopVectorization"
22
uuid = "bdcacae8-1622-11e9-2a5c-532679323890"
33
authors = ["Chris Elrod <[email protected]>"]
4-
version = "0.12.44"
4+
version = "0.12.45"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

src/getconstindexes.jl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
@inline second(x) = @inbounds getindex(x, 2)
2-
@inline third(x) = @inbounds getindex(x, 3)
3-
@inline fourth(x) = @inbounds getindex(x, 4)
4-
@inline fifth(x) = @inbounds getindex(x, 5)
5-
@inline sixth(x) = @inbounds getindex(x, 6)
6-
@inline seventh(x) = @inbounds getindex(x, 7)
7-
@inline eighth(x) = @inbounds getindex(x, 8)
8-
@inline ninth(x) = @inbounds getindex(x, 9)
1+
for (i,f) enumerate((:first,:second,:third,:fourth,:fifth,:sixth,:seventh,:eighth,:ninth,:tenth,:eleventh,:twelfth,:thirteenth))
2+
@eval @inline $f(x) = @inbounds getindex(x, $(i+1))
3+
end
94

src/modeling/costs.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ const COST = Dict{Symbol,InstructionCost}(
252252
:seventh => InstructionCost(0,0.0,0.0,0),
253253
:eighth => InstructionCost(0,0.0,0.0,0),
254254
:ninth => InstructionCost(0,0.0,0.0,0),
255+
:tenth => InstructionCost(0,0.0,0.0,0),
256+
:eleventh => InstructionCost(0,0.0,0.0,0),
257+
:twelfth => InstructionCost(0,0.0,0.0,0),
258+
:thirteenth => InstructionCost(0,0.0,0.0,0),
259+
:last => InstructionCost(0,0.0,0.0,0),
255260
:prefetch => InstructionCost(0,0.0,0.0,0),
256261
:prefetch0 => InstructionCost(0,0.0,0.0,0),
257262
:prefetch1 => InstructionCost(0,0.0,0.0,0),

src/modeling/graphs.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,11 +1119,11 @@ function add_assignment!(ls::LoopSet, LHS, RHS, elementbytes::Int, position::Int
11191119
end
11201120
return last(operations(ls)) # FIXME: dummy
11211121
end
1122-
@assert length(LHS.args) 9 "Functions returning more than 9 values aren't currently supported."
1122+
@assert length(LHS.args) 14 "Functions returning more than 9 values aren't currently supported."
11231123
lhstemp = gensym!(ls, "lhstuple")
11241124
vparents = Operation[maybe_const_compute!(ls, lhstemp, add_operation!(ls, lhstemp, RHS, elementbytes, position), elementbytes, position)]
11251125
for i eachindex(LHS.args)
1126-
f = (:first,:second,:third,:fourth,:fifth,:sixth,:seventh,:eighth,:ninth)[i]
1126+
f = (:first,:second,:third,:fourth,:fifth,:sixth,:seventh,:eighth,:ninth,:tenth,:eleventh,:twelfth,:thirteenth,:last)[i]
11271127
lhsi = LHS.args[i]
11281128
if lhsi isa Symbol
11291129
add_compute!(ls, lhsi, f, vparents, elementbytes)

0 commit comments

Comments
 (0)