@@ -35,21 +35,21 @@ Base.isequal(ins1::Instruction, ins2::Instruction) = (ins1.instr === ins2.instr)
35
35
const LOOPCONSTANT = Instruction (gensym ())
36
36
37
37
struct InstructionCost
38
- scaling:: Float64 # sentinel values: -3 == no scaling; -2 == offset_scaling, -1 == linear scaling, >0 -> == latency == reciprical throughput
39
- scalar_reciprical_throughput :: Float64
38
+ scaling:: Float64 # sentinel values: -3 == no scaling; -2 == offset_scaling, -1 == linear scaling, >0 -> == latency == reciprocal throughput
39
+ scalar_reciprocal_throughput :: Float64
40
40
scalar_latency:: Int
41
41
register_pressure:: Int
42
42
end
43
43
InstructionCost (sl:: Int , srt:: Float64 , scaling:: Float64 = - 3.0 ) = InstructionCost (scaling, srt, sl, 0 )
44
44
45
- nocost (c:: InstructionCost ) = c. scalar_reciprical_throughput == 0.0
45
+ nocost (c:: InstructionCost ) = c. scalar_reciprocal_throughput == 0.0
46
46
flatcost (c:: InstructionCost ) = c. scaling == - 3.0
47
47
offsetscaling (c:: InstructionCost ) = c. scaling == - 2.0
48
48
linearscaling (c:: InstructionCost ) = c. scaling == - 1.0
49
49
50
50
function scalar_cost (ic:: InstructionCost )# , ::Type{T} = Float64) where {T}
51
- @unpack scalar_reciprical_throughput , scalar_latency, register_pressure = ic
52
- scalar_reciprical_throughput , scalar_latency, register_pressure
51
+ @unpack scalar_reciprocal_throughput , scalar_latency, register_pressure = ic
52
+ scalar_reciprocal_throughput , scalar_latency, register_pressure
53
53
end
54
54
function vector_cost (ic:: InstructionCost , Wshift, sizeof_T)
55
55
srt, sl, srp = scalar_cost (ic)
@@ -68,7 +68,7 @@ function vector_cost(ic::InstructionCost, Wshift, sizeof_T)
68
68
else # we assume custom cost, and that latency == recip_throughput
69
69
scaling = ic. scaling
70
70
sl, srt = round (Int,scaling), scaling
71
- end
71
+ end
72
72
srt, sl, srp
73
73
end
74
74
# instruction_cost(instruction::Symbol) = get(COST, instruction, OPAQUE_INSTRUCTION)
@@ -278,7 +278,7 @@ function reduction_combine_to(x::Float64)
278
278
x == 1.0 ? :reduce_to_add : x == 2.0 ? :reduce_to_prod : x == 5.0 ? :reduce_to_max : x == 6.0 ? :reduce_to_min : throw (" Reduction not found." )
279
279
end
280
280
reduction_combine_to (x) = reduction_combine_to (reduction_instruction_class (x))
281
- function reduction_zero (x:: Float64 )
281
+ function reduction_zero (x:: Float64 )
282
282
# x == 1.0 ? :zero : x == 2.0 ? :one : x == 3.0 ? :false : x == 4.0 ? :true : x == 5.0 ? :typemin : x == 6.0 ? :typemax : throw("Reduction not found.")
283
283
x == 1.0 ? :zero : x == 2.0 ? :one : x == 5.0 ? :typemin : x == 6.0 ? :typemax : throw (" Reduction not found." )
284
284
end
@@ -373,4 +373,3 @@ const FUNCTIONSYMBOLS = Dict{Type{<:Function},Instruction}(
373
373
typeof (ifelse) => :vifelse ,
374
374
typeof (vifelse) => :vifelse
375
375
)
376
-
0 commit comments