Debian Codegraph @

kernels/armv8a/3/sup/bli_gemmsup_rv_armv8a_asm_d6x5m.c

raw symbols SCIP
1 /*
2
3 BLIS
4 An object-based framework for developing high-performance BLAS-like
5 libraries.
6
7 Copyright (C) 2014, The University of Texas at Austin
8 Copyright (C) 2021, The University of Tokyo
9
10 Redistribution and use in source and binary forms, with or without
11 modification, are permitted provided that the following conditions are
12 met:
13 - Redistributions of source code must retain the above copyright
14 notice, this list of conditions and the following disclaimer.
15 - Redistributions in binary form must reproduce the above copyright
16 notice, this list of conditions and the following disclaimer in the
17 documentation and/or other materials provided with the distribution.
18 - Neither the name(s) of the copyright holder(s) nor the names of its
19 contributors may be used to endorse or promote products derived
20 from this software without specific prior written permission.
21
22 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
34
35 */
36
37 #include "blis.h"
38 #include "assert.h"
39
40
41 // Label locality & misc.
42 #include "../armv8a_asm_utils.h"
43
44 // Nanokernel operations.
45 #include "../armv8a_asm_d2x2.h"
46
47 /* Odd-NR dgemmsup_rv_*m kernels are special in that
48 * despite of the row-major name, C is laid out in COLUMNS in the register space.
49 *
50 * Block order:
51 *
52 * +---+ +---+
53 * | 0 | | 3 | |6
54 * +---+ +---+ |
55 * +---+ +---+
56 * | 1 | | 4 | |7
57 * +---+ +---+ |
58 * +---+ +---+
59 * | 2 | | 5 | |8
60 * +---+ +---+ |
61 *
62 */
63 #define DGEMM_C6X5_MKER_LOOP_PLAIN(C00,C01,C02,C03,C04,C10,C11,C12,C13,C14,C20,C21,C22,C23,C24,A0,A1,A2,B0,B1,B2,BIDX,AELEMADDR,AELEMST,BADDR,BSHIFT,LOADNEXT) \
64 DGEMM_2X2_NANOKERNEL(C00,C01,A0,B0) \
65 DGEMM_2X2_NANOKERNEL(C10,C11,A1,B0) \
66 DGEMM_2X2_NANOKERNEL(C20,C21,A2,B0) \
67 DGEMM_LOAD1V_ ##LOADNEXT (B0,BADDR,BSHIFT) \
68 DGEMM_2X2_NANOKERNEL(C02,C03,A0,B1) \
69 DGEMM_2X2_NANOKERNEL(C12,C13,A1,B1) \
70 DGEMM_2X2_NANOKERNEL(C22,C23,A2,B1) \
71 DGEMM_LOAD1V_ ##LOADNEXT (B1,BADDR,BSHIFT+16) \
72 " fmla v"#C04".2d, v"#A0".2d, v"#B2".d["#BIDX"] \n\t" \
73 DGEMM_LOAD1V_G_ ##LOADNEXT (A0,AELEMADDR,AELEMST) \
74 " fmla v"#C14".2d, v"#A1".2d, v"#B2".d["#BIDX"] \n\t" \
75 DGEMM_LOAD1V_G_ ##LOADNEXT (A1,AELEMADDR,AELEMST) \
76 " fmla v"#C24".2d, v"#A2".2d, v"#B2".d["#BIDX"] \n\t"
77
78 // Interleaving load or not.
79 #define DGEMM_LOAD1V_noload(V1,ADDR,IMM)
80 #define DGEMM_LOAD1V_load(V1,ADDR,IMM) \
81 " ldr q"#V1", ["#ADDR", #"#IMM"] \n\t"
82
83 #define DGEMM_LOAD1V_G_noload(V1,ADDR,ST)
84 #define DGEMM_LOAD1V_G_load(V1,ADDR,ST) \
85 " ld1 {v"#V1".d}[0], ["#ADDR"], "#ST" \n\t" \
86 " ld1 {v"#V1".d}[1], ["#ADDR"], "#ST" \n\t"
87
88 // Prefetch C in the long direction.
89 #define DPRFMC_FWD(CADDR,DLONGC) \
90 " prfm PLDL1KEEP, ["#CADDR"] \n\t" \
91 " add "#CADDR", "#CADDR", "#DLONGC" \n\t"
92
93 // For column-storage of C.
94 #define DLOADC_3V_C_FWD(C0,C1,C2,CADDR,CSHIFT,CSC) \
95 DLOAD2V(C0,C1,CADDR,CSHIFT) \
96 DLOAD1V(C2,CADDR,CSHIFT+32) \
97 " add "#CADDR", "#CADDR", "#CSC" \n\t"
98 #define DSTOREC_3V_C_FWD(C0,C1,C2,CADDR,CSHIFT,CSC) \
99 DSTORE2V(C0,C1,CADDR,CSHIFT) \
100 DSTORE1V(C2,CADDR,CSHIFT+32) \
101 " add "#CADDR", "#CADDR", "#CSC" \n\t"
102
103 // For row-storage of C: Store 2+1/2 vectors.
104 #define DLOADC_2PHV_R_FWD(C0,C1,C2,CIDX,CADDR,CSHIFT,RSC,CTMP) \
105 " add "#CTMP", "#CADDR", "#CSHIFT"+32 \n\t" \
106 DLOAD2V(C0,C1,CADDR,CSHIFT) \
107 " ld1 {v"#C2".d}["#CIDX"], ["#CTMP"] \n\t" \
108 " add "#CADDR", "#CADDR", "#RSC" \n\t"
109 #define DSTOREC_2PHV_R_FWD(C0,C1,C2,CIDX,CADDR,CSHIFT,RSC,CTMP) \
110 " add "#CTMP", "#CADDR", "#CSHIFT"+32 \n\t" \
111 DSTORE2V(C0,C1,CADDR,CSHIFT) \
112 " st1 {v"#C2".d}["#CIDX"], ["#CTMP"] \n\t" \
113 " add "#CADDR", "#CADDR", "#RSC" \n\t"
114
115 #define DSCALE5V(V0,V1,V2,V3,V4,A,IDX) \
116 DSCALE4V(V0,V1,V2,V3,A,IDX) \
117 DSCALE1V(V4,A,IDX)
118 #define DSCALEA5V(D0,D1,D2,D3,D4,S0,S1,S2,S3,S4,A,IDX) \
119 DSCALEA4V(D0,D1,D2,D3,S0,S1,S2,S3,A,IDX) \
120 DSCALEA1V(D4,S4,A,IDX)
121
122
123 void bli_dgemmsup_rv_armv8a_asm_6x5m
124 (
125 conj_t conja,
126 conj_t conjb,
127 dim_t m0,
128 dim_t n0,
129 dim_t k0,
130 const void* alpha,
131 const void* a, inc_t rs_a0, inc_t cs_a0,
132 const void* b, inc_t rs_b0, inc_t cs_b0,
133 const void* beta,
134 void* c, inc_t rs_c0, inc_t cs_c0,
135 const auxinfo_t* data,
136 const cntx_t* cntx
137 )
138 {
139 assert( n0 == 5 );
140
141 // LLVM has very bad routing ability for inline asm.
142 // Limit number of registers in case of Clang compilation.
143 #ifndef __clang__
144 const void* a_next = bli_auxinfo_next_a( data );
145 const void* b_next = bli_auxinfo_next_b( data );
146 #endif
147 uint64_t ps_a = bli_auxinfo_ps_a( data );
148
149 // Typecast local copies of integers in case dim_t and inc_t are a
150 // different size than is expected by load instructions.
151 uint64_t k_mker = k0 / 6;
152 uint64_t k_left = k0 % 6;
153
154 int64_t m_iter = m0 / 6;
155 int64_t m_left = m0 % 6;
156
157 uint64_t rs_a = rs_a0;
158 uint64_t cs_a = cs_a0;
159 uint64_t rs_b = rs_b0;
160 uint64_t rs_c = rs_c0;
161 uint64_t cs_c = cs_c0;
162 // uint64_t cs_b = cs_b0;
163 assert( cs_b0 == 1 );
164
165 if ( m_iter == 0 ) goto consider_edge_cases;
166
167 __asm__ volatile
168 (
169 " ldr x10, %[a] \n\t"
170 " ldr x13, %[c] \n\t"
171 " ldr x12, %[m_iter] \n\t"
172 " ldr x11, %[ps_a] \n\t" // Panel-skip of A.
173 " ldr x9, %[rs_a] \n\t" // Row-skip of A.
174 " ldr x2, %[cs_a] \n\t" // Column-skip of A.
175 " ldr x3, %[rs_b] \n\t" // Row-skip of B.
176 " \n\t"
177 " ldr x6, %[rs_c] \n\t" // Row-skip of C.
178 " ldr x7, %[cs_c] \n\t" // Column-skip of C.
179 " \n\t"
180 " \n\t" // Multiply some address skips by sizeof(double).
181 " lsl x11, x11, #3 \n\t" // ps_a
182 " lsl x9, x9, #3 \n\t" // rs_a
183 " lsl x2, x2, #3 \n\t" // cs_a
184 " lsl x3, x3, #3 \n\t" // rs_b
185 " lsl x6, x6, #3 \n\t" // rs_c
186 " lsl x7, x7, #3 \n\t" // cs_c
187 " \n\t"
188 " mov x1, x5 \n\t"
189 " cmp x7, #8 \n\t" // Prefetch column-strided C.
190 BNE(C_PREFETCH_COLS)
191 // This prefetch will not cover further mker perts. Skip.
192 //
193 // DPRFMC_FWD(x1,x6)
194 // DPRFMC_FWD(x1,x6)
195 // DPRFMC_FWD(x1,x6)
196 // DPRFMC_FWD(x1,x6)
197 // DPRFMC_FWD(x1,x6)
198 // DPRFMC_FWD(x1,x6)
199 BRANCH(C_PREFETCH_END)
200 LABEL(C_PREFETCH_COLS)
201 DPRFMC_FWD(x1,x7)
202 DPRFMC_FWD(x1,x7)
203 DPRFMC_FWD(x1,x7)
204 DPRFMC_FWD(x1,x7)
205 DPRFMC_FWD(x1,x7)
206 LABEL(C_PREFETCH_END)
207 //
208 // Millikernel.
209 LABEL(MILLIKER_MLOOP)
210 " \n\t"
211 " mov x0, x10 \n\t" // Parameters to be reloaded
212 " mov x5, x13 \n\t" // within each millikernel loop.
213 " ldr x1, %[b] \n\t"
214 " ldr x4, %[k_mker] \n\t"
215 " ldr x8, %[k_left] \n\t"
216 " \n\t"
217 // Storage scheme:
218 // V[ 0:14] <- C
219 // V[15:23] <- A
220 // V[24:29] <- B
221 // Under this scheme, the following is defined:
222 #define DGEMM_C6X5_MKER_LOOP_PLAIN_LOC(A0,A1,A2,B0,B1,B2,BIDX,AELEMADDR,AELEMST,BADDR,BSHIFT,LOADNEXT) \
223 DGEMM_C6X5_MKER_LOOP_PLAIN(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,A0,A1,A2,B0,B1,B2,BIDX,AELEMADDR,AELEMST,BADDR,BSHIFT,LOADNEXT)
224 // Load from memory.
225 LABEL(LOAD_ABC)
226 " \n\t" // No-microkernel early return is a must
227 " cmp x4, #0 \n\t" // to avoid out-of-boundary read.
228 BEQ(CLEAR_CCOLS)
229 " \n\t"
230 " mov x14, x0 \n\t" // Load A.
231 " ld1 {v15.d}[0], [x14], x9 \n\t"
232 " ld1 {v15.d}[1], [x14], x9 \n\t"
233 " ld1 {v16.d}[0], [x14], x9 \n\t"
234 " ld1 {v16.d}[1], [x14], x9 \n\t"
235 " ld1 {v17.d}[0], [x14], x9 \n\t"
236 " ld1 {v17.d}[1], [x14], x9 \n\t"
237 " add x0, x0, x2 \n\t"
238 " mov x14, x0 \n\t"
239 " ld1 {v18.d}[0], [x14], x9 \n\t"
240 " ld1 {v18.d}[1], [x14], x9 \n\t"
241 " ld1 {v19.d}[0], [x14], x9 \n\t"
242 " ld1 {v19.d}[1], [x14], x9 \n\t"
243 " ld1 {v20.d}[0], [x14], x9 \n\t"
244 " ld1 {v20.d}[1], [x14], x9 \n\t"
245 " add x0, x0, x2 \n\t"
246 " mov x14, x0 \n\t"
247 " ld1 {v21.d}[0], [x14], x9 \n\t"
248 " ld1 {v21.d}[1], [x14], x9 \n\t"
249 " ld1 {v22.d}[0], [x14], x9 \n\t"
250 " ld1 {v22.d}[1], [x14], x9 \n\t"
251 " ld1 {v23.d}[0], [x14], x9 \n\t"
252 " ld1 {v23.d}[1], [x14], x9 \n\t"
253 " add x0, x0, x2 \n\t"
254 " mov x14, x0 \n\t"
255 " \n\t"
256 " ldr q24, [x1, #16*0] \n\t" // Load B.
257 " ldr q25, [x1, #16*1] \n\t"
258 " ldr d26, [x1, #16*2] \n\t" // Scalar loads into idx 0.
259 " add x1, x1, x3 \n\t"
260 " ldr q27, [x1, #16*0] \n\t"
261 " ldr q28, [x1, #16*1] \n\t"
262 " ldr d29, [x1, #16*2] \n\t"
263 " add x1, x1, x3 \n\t"
264 LABEL(CLEAR_CCOLS)
265 CLEAR4V(0,1,2,3)
266 CLEAR1V(4)
267 CLEAR4V(5,6,7,8)
268 CLEAR1V(9)
269 CLEAR4V(10,11,12,13)
270 CLEAR1V(14)
271 // No-microkernel early return, once again.
272 BEQ(K_LEFT_LOOP)
273 //
274 // Microkernel is defined here as:
275 #define DGEMM_C6X5_MKER_LOOP_PLAIN_LOC_FWD(A0,A1,A2,B0,B1,B2,BIDX) \
276 DGEMM_C6X5_MKER_LOOP_PLAIN_LOC(A0,A1,A2,B0,B1,B2,BIDX,x14,x9,x1,0,load) \
277 "ld1 {v"#A2".d}[0], [x14], x9 \n\t" \
278 "ld1 {v"#A2".d}[1], [x14], x9 \n\t" \
279 "add x0, x0, x2 \n\t" \
280 "mov x14, x0 \n\t" \
281 /* Due to this loading, BIDX can only be 0 here. */ \
282 "ldr d"#B2", [x1, #16*2] \n\t" \
283 "add x1, x1, x3 \n\t"
284 // Start microkernel loop.
285 LABEL(K_MKER_LOOP)
286 DGEMM_C6X5_MKER_LOOP_PLAIN_LOC_FWD(15,16,17,24,25,26,0)
287 DGEMM_C6X5_MKER_LOOP_PLAIN_LOC_FWD(18,19,20,27,28,29,0)
288 DGEMM_C6X5_MKER_LOOP_PLAIN_LOC_FWD(21,22,23,24,25,26,0)
289 " \n\t" // Decrease counter before final replica.
290 " subs x4, x4, #1 \n\t" // Branch early to avoid reading excess mem.
291 BEQ(FIN_MKER_LOOP)
292 DGEMM_C6X5_MKER_LOOP_PLAIN_LOC_FWD(15,16,17,27,28,29,0)
293 DGEMM_C6X5_MKER_LOOP_PLAIN_LOC_FWD(18,19,20,24,25,26,0)
294 DGEMM_C6X5_MKER_LOOP_PLAIN_LOC_FWD(21,22,23,27,28,29,0)
295 BRANCH(K_MKER_LOOP)
296 //
297 // Final microkernel loop.
298 LABEL(FIN_MKER_LOOP)
299 DGEMM_C6X5_MKER_LOOP_PLAIN_LOC(15,16,17,27,28,29,0,xzr,-1,xzr,-1,noload)
300 " ldr q27, [x1, #16*0] \n\t"
301 " ldr q28, [x1, #16*1] \n\t"
302 " ldr d29, [x1, #16*2] \n\t"
303 " add x1, x1, x3 \n\t"
304 DGEMM_C6X5_MKER_LOOP_PLAIN_LOC(18,19,20,24,25,26,0,xzr,-1,xzr,-1,noload)
305 DGEMM_C6X5_MKER_LOOP_PLAIN_LOC(21,22,23,27,28,29,0,xzr,-1,xzr,-1,noload)
306 //
307 // Loops left behind microkernels.
308 LABEL(K_LEFT_LOOP)
309 " cmp x8, #0 \n\t" // End of exec.
310 BEQ(WRITE_MEM_PREP)
311 " mov x14, x0 \n\t" // Load A col.
312 " ld1 {v15.d}[0], [x14], x9 \n\t"
313 " ld1 {v15.d}[1], [x14], x9 \n\t"
314 " ld1 {v16.d}[0], [x14], x9 \n\t"
315 " ld1 {v16.d}[1], [x14], x9 \n\t"
316 " ld1 {v17.d}[0], [x14], x9 \n\t"
317 " ld1 {v17.d}[1], [x14], x9 \n\t"
318 " add x0, x0, x2 \n\t"
319 " ldr q24, [x1, #16*0] \n\t" // Load B row.
320 " ldr q25, [x1, #16*1] \n\t"
321 " ldr d26, [x1, #16*2] \n\t"
322 " add x1, x1, x3 \n\t"
323 " sub x8, x8, #1 \n\t"
324 DGEMM_C6X5_MKER_LOOP_PLAIN_LOC(15,16,17,24,25,26,0,xzr,-1,xzr,-1,noload)
325 BRANCH(K_LEFT_LOOP)
326 //
327 // Scale and write to memory.
328 LABEL(WRITE_MEM_PREP)
329 " ldr x4, %[alpha] \n\t" // Load alpha & beta (address).
330 " ldr x8, %[beta] \n\t"
331 " ld1r {v30.2d}, [x4] \n\t" // Load alpha & beta.
332 " ld1r {v31.2d}, [x8] \n\t"
333 " fmov d26, #1.0 \n\t"
334 " fcmp d30, d26 \n\t"
335 BEQ(UNIT_ALPHA)
336 DSCALE5V(0,1,2,3,4,30,0)
337 DSCALE5V(5,6,7,8,9,30,0)
338 DSCALE5V(10,11,12,13,14,30,0)
339 LABEL(UNIT_ALPHA)
340 " \n\t"
341 " mov x1, x5 \n\t" // C address for loading.
342 " \n\t" // C address for storing is x5 itself.
343 " cmp x7, #8 \n\t" // Check for column-storage.
344 BNE(WRITE_MEM_C)
345 // Unlike other RV kernels, here row-storage of C requires
346 // in-register transpose.
347 " trn1 v15.2d, v0.2d, v1.2d \n\t"
348 " trn2 v16.2d, v0.2d, v1.2d \n\t"
349 " trn1 v17.2d, v2.2d, v3.2d \n\t"
350 " trn2 v18.2d, v2.2d, v3.2d \n\t"
351 " \n\t"
352 " trn1 v19.2d, v5.2d, v6.2d \n\t"
353 " trn2 v20.2d, v5.2d, v6.2d \n\t"
354 " trn1 v21.2d, v7.2d, v8.2d \n\t"
355 " trn2 v22.2d, v7.2d, v8.2d \n\t"
356 " \n\t"
357 " trn1 v23.2d, v10.2d, v11.2d \n\t"
358 " trn2 v24.2d, v10.2d, v11.2d \n\t"
359 " trn1 v25.2d, v12.2d, v13.2d \n\t"
360 " trn2 v26.2d, v12.2d, v13.2d \n\t"
361 " \n\t"
362 " fcmp d31, #0.0 \n\t"
363 BEQ(ZERO_BETA_R)
364 DLOADC_2PHV_R_FWD(0,1,28,0,x1,0,x6,x8)
365 DLOADC_2PHV_R_FWD(2,3,28,1,x1,0,x6,x8)
366 DLOADC_2PHV_R_FWD(5,6,29,0,x1,0,x6,x8)
367 DLOADC_2PHV_R_FWD(7,8,29,1,x1,0,x6,x8)
368 DLOADC_2PHV_R_FWD(10,11,30,0,x1,0,x6,x8)
369 DLOADC_2PHV_R_FWD(12,13,30,1,x1,0,x6,x8)
370 DSCALEA5V(15,17,16,18,4,0,1,2,3,28,31,0)
371 DSCALEA5V(19,21,20,22,9,5,6,7,8,29,31,0)
372 DSCALEA5V(23,25,24,26,14,10,11,12,13,30,31,0)
373 LABEL(ZERO_BETA_R)
374 #ifndef __clang__
375 " cmp x12, #1 \n\t"
376 BRANCH(PRFM_END_R)
377 " prfm PLDL1KEEP, [%[a_next], #16*0] \n\t"
378 " prfm PLDL1KEEP, [%[a_next], #16*1] \n\t"
379 " prfm PLDL1STRM, [%[b_next], #16*0] \n\t"
380 " prfm PLDL1STRM, [%[b_next], #16*1] \n\t"
381 LABEL(PRFM_END_R)
382 #endif
383 DSTOREC_2PHV_R_FWD(15,17,4,0,x5,0,x6,x8)
384 DSTOREC_2PHV_R_FWD(16,18,4,1,x5,0,x6,x8)
385 DSTOREC_2PHV_R_FWD(19,21,9,0,x5,0,x6,x8)
386 DSTOREC_2PHV_R_FWD(20,22,9,1,x5,0,x6,x8)
387 DSTOREC_2PHV_R_FWD(23,25,14,0,x5,0,x6,x8)
388 DSTOREC_2PHV_R_FWD(24,26,14,1,x5,0,x6,x8)
389 BRANCH(END_WRITE_MEM)
390 //
391 // C storage in columns.
392 LABEL(WRITE_MEM_C)
393 " fcmp d31, #0.0 \n\t"
394 BEQ(ZERO_BETA_C)
395 DLOADC_3V_C_FWD(15,20,25,x1,0,x7)
396 DLOADC_3V_C_FWD(16,21,26,x1,0,x7)
397 DLOADC_3V_C_FWD(17,22,27,x1,0,x7)
398 DLOADC_3V_C_FWD(18,23,28,x1,0,x7)
399 DLOADC_3V_C_FWD(19,24,29,x1,0,x7)
400 DSCALEA5V(0,1,2,3,4,15,16,17,18,19,31,0)
401 DSCALEA5V(5,6,7,8,9,20,21,22,23,24,31,0)
402 DSCALEA5V(10,11,12,13,14,25,26,27,28,29,31,0)
403 LABEL(ZERO_BETA_C)
404 #ifndef __clang__
405 " cmp x12, #1 \n\t"
406 BRANCH(PRFM_END_C)
407 " prfm PLDL1KEEP, [%[a_next], #16*0] \n\t"
408 " prfm PLDL1KEEP, [%[a_next], #16*1] \n\t"
409 " prfm PLDL1STRM, [%[b_next], #16*0] \n\t"
410 " prfm PLDL1STRM, [%[b_next], #16*1] \n\t"
411 LABEL(PRFM_END_C)
412 #endif
413 DSTOREC_3V_C_FWD(0,5,10,x5,0,x7)
414 DSTOREC_3V_C_FWD(1,6,11,x5,0,x7)
415 DSTOREC_3V_C_FWD(2,7,12,x5,0,x7)
416 DSTOREC_3V_C_FWD(3,8,13,x5,0,x7)
417 DSTOREC_3V_C_FWD(4,9,14,x5,0,x7)
418 //
419 // End of this microkernel.
420 LABEL(END_WRITE_MEM)
421 " \n\t"
422 " subs x12, x12, #1 \n\t"
423 BEQ(END_EXEC)
424 " \n\t"
425 " mov x8, #6 \n\t"
426 " madd x13, x6, x8, x13 \n\t" // Forward C's base address to the next logic panel.
427 " add x10, x10, x11 \n\t" // Forward A's base address to the next logic panel.
428 BRANCH(MILLIKER_MLOOP)
429 //
430 // End of execution.
431 LABEL(END_EXEC)
432 :
433 : [a] "m" (a),
434 [b] "m" (b),
435 [c] "m" (c),
436 [rs_a] "m" (rs_a),
437 [cs_a] "m" (cs_a),
438 [ps_a] "m" (ps_a),
439 [rs_b] "m" (rs_b),
440 [rs_c] "m" (rs_c),
441 [cs_c] "m" (cs_c),
442 // In Clang, even "m"-passed parameter takes 1 register.
443 // Have to disable prefetching to pass compilation.
444 #ifndef __clang__
445 [a_next] "r" (a_next),
446 [b_next] "r" (b_next),
447 #endif
448 [m_iter] "m" (m_iter),
449 [k_mker] "m" (k_mker),
450 [k_left] "m" (k_left),
451 [alpha] "m" (alpha),
452 [beta] "m" (beta)
453 : "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7",
454 "x8", "x9", "x10","x11","x12","x13","x14",
455 "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7",
456 "v8", "v9", "v10","v11","v12","v13","v14","v15",
457 "v16","v17","v18","v19","v20","v21","v22","v23",
458 "v24","v25","v26","v27","v28","v29","v30","v31"
459 );
460
461 consider_edge_cases:
462 // Forward address.
463 a = ( double* )a + m_iter * ps_a;
464 c = ( double* )c + m_iter * 6 * rs_c;
465 auxinfo_t data_d6x4mn = *data;
466 bli_auxinfo_set_ps_b( 4 * cs_b0, &data_d6x4mn );
467 bli_dgemmsup_rv_armv8a_int_6x4mn
468 (
469 conja, conjb, m_left, 5, k0,
470 alpha, a, rs_a0, cs_a0, b, rs_b0, cs_b0,
471 beta, c, rs_c0, cs_c0, &data_d6x4mn, cntx
472 );
473
474 }
475