Skip to content

Commit 210548e

Browse files
committed
Track SIMDPirates vf(n)m(add/sub)231 use.
1 parent 5cadbc7 commit 210548e

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/LoopVectorization.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ using VectorizationBase: REGISTER_SIZE, REGISTER_COUNT, extract_data, num_vector
88
PackedStridedPointer, SparseStridedPointer, RowMajorStridedPointer, StaticStridedPointer, StaticStridedStruct
99
using SIMDPirates: VECTOR_SYMBOLS, evadd, evmul, vrange, reduced_add, reduced_prod, reduce_to_add, reduce_to_prod,
1010
sizeequivalentfloat, sizeequivalentint, vadd!, vsub!, vmul!, vfdiv!, vfmadd!, vfnmadd!, vfmsub!, vfnmsub!,
11+
vfmadd231, vfmsub231, vfnmadd231, vfnmsub231,
1112
vmullog2, vmullog10, vdivlog2, vdivlog10, vmullog2add!, vmullog10add!, vdivlog2add!, vdivlog10add!, vfmaddaddone
1213
using Base.Broadcast: Broadcasted, DefaultArrayStyle
1314
using LinearAlgebra: Adjoint, Transpose

src/broadcast.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function add_broadcast!(
8686
setC.reduced_children = kvec
8787
# compute Cₘₙ += Aₘₖ * Bₖₙ
8888
reductop = Operation(
89-
ls, mC, elementbytes, :vmuladd, compute, reductdeps, kvec, Operation[loadA, loadB, setC]
89+
ls, mC, elementbytes, :vfmadd231, compute, reductdeps, kvec, Operation[loadA, loadB, setC]
9090
)
9191
reductop = pushop!(ls, reductop, mC)
9292
reductfinal = Operation(

src/costs.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ const COST = Dict{Instruction,InstructionCost}(
152152
Instruction(:vfmsub) => InstructionCost(4,0.5), # - and * will fuse into this, so much of the time they're not twice as expensive
153153
Instruction(:vfnmadd) => InstructionCost(4,0.5), # + and -* will fuse into this, so much of the time they're not twice as expensive
154154
Instruction(:vfnmsub) => InstructionCost(4,0.5), # - and -* will fuse into this, so much of the time they're not twice as expensive
155+
Instruction(:vfmadd231) => InstructionCost(4,0.5), # + and * will fuse into this, so much of the time they're not twice as expensive
156+
Instruction(:vfmsub231) => InstructionCost(4,0.5), # - and * will fuse into this, so much of the time they're not twice as expensive
157+
Instruction(:vfnmadd231) => InstructionCost(4,0.5), # + and -* will fuse into this, so much of the time they're not twice as expensive
158+
Instruction(:vfnmsub231) => InstructionCost(4,0.5), # - and -* will fuse into this, so much of the time they're not twice as expensive
155159
Instruction(:vfmadd!) => InstructionCost(4,0.5), # + and * will fuse into this, so much of the time they're not twice as expensive
156160
Instruction(:vfnmadd!) => InstructionCost(4,0.5), # + and -* will fuse into this, so much of the time they're not twice as expensive
157161
Instruction(:vfmsub!) => InstructionCost(4,0.5), # + and * will fuse into this, so much of the time they're not twice as expensive
@@ -233,6 +237,10 @@ const REDUCTION_CLASS = Dict{Symbol,Float64}(
233237
:vfmsub => ADDITIVE_IN_REDUCTIONS,
234238
:vfnmadd => ADDITIVE_IN_REDUCTIONS,
235239
:vfnmsub => ADDITIVE_IN_REDUCTIONS,
240+
:vfmadd231 => ADDITIVE_IN_REDUCTIONS,
241+
:vfmsub231 => ADDITIVE_IN_REDUCTIONS,
242+
:vfnmadd231 => ADDITIVE_IN_REDUCTIONS,
243+
:vfnmsub231 => ADDITIVE_IN_REDUCTIONS,
236244
:vfmadd! => ADDITIVE_IN_REDUCTIONS,
237245
:vfnmadd! => ADDITIVE_IN_REDUCTIONS,
238246
:vfmsub! => ADDITIVE_IN_REDUCTIONS,
@@ -316,6 +324,10 @@ const FUNCTIONSYMBOLS = Dict{Type{<:Function},Instruction}(
316324
typeof(SIMDPirates.vfmsub) => :vfmsub,
317325
typeof(SIMDPirates.vfnmadd) => :vfnmadd,
318326
typeof(SIMDPirates.vfnmsub) => :vfnmsub,
327+
typeof(SIMDPirates.vfmadd231) => :vfmadd231,
328+
typeof(SIMDPirates.vfmsub231) => :vfmsub231,
329+
typeof(SIMDPirates.vfnmadd231) => :vfnmadd231,
330+
typeof(SIMDPirates.vfnmsub231) => :vfnmsub231,
319331
typeof(SIMDPirates.vfmadd!) => :vfmadd!,
320332
typeof(SIMDPirates.vfnmadd!) => :vfnmadd!,
321333
typeof(SIMDPirates.vfmsub!) => :vfmsub!,

0 commit comments

Comments
 (0)