Skip to content

Commit 998e468

Browse files
Write the documentation of combineDMALoads
1 parent 6237397 commit 998e468

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

src/optimization/Combiner.h

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,34 @@ namespace vc4c
154154
InstructionWalker combineArithmeticOperations(
155155
const Module& module, Method& method, InstructionWalker it, const Configuration& config);
156156

157-
// TODO documentation
157+
/*
158+
* Combines vloadn with one DMA/VPM load. This available only for constant value offset.
159+
*
160+
* Example:
161+
* %call = _Z7vload16jPU3AS1Kf(i32 2, (g) f32* %in) ; vload16
162+
* %call2 = _Z7vload16jPU3AS1Kf(i32 3, (g) f32* %in)
163+
* %call3 = _Z7vload16jPU3AS1Kf(i32 4, (g) f32* %in)
164+
*
165+
* becomes:
166+
* %tmp.405 = add i32 128, (p) f32* %in
167+
* mutex_acq
168+
* register vpr_setup = vdr_setup(rows: 3, columns: 16 words, address: h32(0,0), vpitch: 1)
169+
* register vpr_setup = loadi vdr_setup(memory pitch: 64 bytes)
170+
* register vpr_addr = i32 %tmp.405
171+
* register - = register vpr_wait
172+
* mutex_rel
173+
* mutex_acq
174+
* register vpr_setup = loadi vpm_setup(num: 3, size: 16 words, stride: 1 rows, address: h32(0))
175+
* %tmp.404 = register vpm
176+
* mutex_rel
177+
* mutex_acq
178+
* %tmp.403 = register vpm
179+
* mutex_rel
180+
* mutex_acq
181+
* %tmp.402 = register vpm
182+
* mutex_rel
183+
*
184+
*/
158185
void combineDMALoads(const Module& module, Method& method, const Configuration& config);
159186

160187
// TODO documentation, TODO move somewhere else?!

0 commit comments

Comments
 (0)