~ubuntu-branches/ubuntu/vivid/atlas/vivid

« back to all changes in this revision

Viewing changes to src/blas/gemm/GOTO/gemm_EV5_k.S

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2002-04-13 10:07:52 UTC
  • Revision ID: james.westby@ubuntu.com-20020413100752-va9zm0rd4gpurdkq
Tags: upstream-3.2.1ln
ImportĀ upstreamĀ versionĀ 3.2.1ln

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
    /*        Fast GEMM routine for Alpha 21164(A)         */
 
2
    /*         on  Linux, Digital UNIX and NT              */
 
3
    /*        by Kazushige Goto <goto@statabo.rim.or.jp>   */
 
4
 
 
5
#ifndef P
 
6
#ifdef DGEMM
 
7
#define P 32
 
8
#define Q 208
 
9
#define R 200
 
10
#else
 
11
#define P 40
 
12
#define Q 208
 
13
#define R 208
 
14
#endif
 
15
#endif
 
16
 
 
17
/* Internal BLOCK Leading size.*/
 
18
#define LDA (Q<<2)
 
19
#define LDB (Q<<1)
 
20
 
 
21
                   /* Now starting Main program */
 
22
 
 
23
#ifdef NN
 
24
#define ROUTINE GEMM_NN
 
25
#endif
 
26
#ifdef NT
 
27
#define ROUTINE GEMM_NT
 
28
#endif
 
29
#ifdef TN
 
30
#define ROUTINE GEMM_TN
 
31
#endif
 
32
#ifdef TT
 
33
#define ROUTINE GEMM_TT
 
34
#endif
 
35
 
 
36
#define MATRIX_A   ((P>>2)*LDA*SIZE)
 
37
#define MATRIX_B   ((R>>1)*LDB*SIZE)
 
38
 
 
39
#define STACKSIZE  16*8
 
40
 
 
41
        .set noreorder
 
42
        .set noat
 
43
 
 
44
.text
 
45
        .align 5
 
46
        .globl ROUTINE
 
47
        .ent ROUTINE
 
48
 
 
49
/* Initial Routine */
 
50
ROUTINE:
 
51
        lda     $30, -STACKSIZE($30)            # prepare stack
 
52
 
 
53
/* save original register value */
 
54
        stq     $26,   0($30)
 
55
        stq     $9,    8($30)
 
56
        stq     $10,  16($30)
 
57
        stq     $11,  24($30)
 
58
        stq     $12,  32($30)
 
59
        stq     $13,  40($30)
 
60
        stq     $14,  48($30)
 
61
        stq     $15,  56($30)
 
62
        stt     $f2,  64($30)
 
63
        stt     $f3,  72($30)
 
64
        stt     $f4,  80($30)
 
65
        stt     $f5,  96($30)
 
66
        stt     $f6, 104($30)
 
67
        stt     $f7, 112($30)
 
68
        stt     $f8, 120($30)
 
69
        .prologue       0
 
70
 
 
71
/* restore argument value */
 
72
        ldq     $9,  0+STACKSIZE($30)   # B
 
73
        ldl     $19, 8+STACKSIZE($30)   # ldb
 
74
        ldq     $13,16+STACKSIZE($30)   # C
 
75
        ldl     $10,24+STACKSIZE($30)   # ldc
 
76
        ldq     $28,32+STACKSIZE($30)   # buffer
 
77
 
 
78
        clr     $3                      # ls = 0
 
79
        fmov    $f19, $f3
 
80
 
 
81
        clr     $14                     # js = 0
 
82
        .align 5
 
83
 
 
84
$L5:
 
85
        lda     $0,  Q
 
86
        subl    $18,$3,$7               # min_l = k - ls
 
87
        cmple   $7, $0, $1              # (min_l>Q)?
 
88
        cmoveq  $1, $0, $7              # if $1 then min_l = Q
 
89
        .align 4
 
90
 
 
91
#if defined(NN) || (!defined(C_VERSION) && defined(TN)) \
 
92
        || (defined(C_VERSION) && defined(NT))
 
93
 
 
94
$L10:
 
95
#ifndef C_VERSION
 
96
        mull    $19,$14,$2              # js*ldb
 
97
        subl    $17,$14,$12             # min_j = n - js
 
98
#else
 
99
$L10:
 
100
        mull    $21,$14,$2              # js*ldb
 
101
        subl    $16,$14,$12             # min_j = n - js
 
102
#endif
 
103
 
 
104
        lda     $0,  R
 
105
        ldah    $24, Address_H(MATRIX_A)($28) # a_offset = &sb[0][0]
 
106
        cmple   $12, $0, $1             # (min_j>R) ?
 
107
        cmoveq  $1,  $0, $12            # if $1 then min_j = R
 
108
 
 
109
        lda     $24, Address_L(MATRIX_A)($24)
 
110
        mull    $10,$14,$25             # jsldc = js * ldc
 
111
 
 
112
        mov     $12, $27                # j = min_j
 
113
        unop
 
114
        unop
 
115
#ifndef C_VERSION
 
116
        SXADDQ  $2,$9,$0                # b_offset = b + js*ldb
 
117
#else
 
118
        SXADDQ  $2,$20,$0               # b_offset = b + js*ldb
 
119
#endif
 
120
        .align 4
 
121
 
 
122
$L15:
 
123
        mov     $7,  $5                 # l = min_l
 
124
        mov     $24, $2                 # a1_offset = a_offset
 
125
 
 
126
        SXADDQ  $3,  $0, $4             # b1_offset = b_offset + ls
 
127
#ifndef C_VERSION
 
128
        SXADDQ  $19, $0, $0             # b_offset += ldb
 
129
#else
 
130
        SXADDQ  $21, $0, $0             # b_offset += ldb
 
131
#endif
 
132
 
 
133
        SXADDQ  $3,  $0, $22            # c1_offset = b_offset + ls
 
134
#ifndef C_VERSION
 
135
        SXADDQ  $19, $0, $0             # b_offset += ldb
 
136
#else
 
137
        SXADDQ  $21, $0, $0             # b_offset += ldb
 
138
#endif
 
139
        lda     $24,LDB*SIZE($24)       # a_offset += LDB
 
140
        subl    $27, 2, $27             # j--
 
141
        .align 4
 
142
 
 
143
$L19:
 
144
        LD      $f10,  0*SIZE($4)
 
145
        LD      $f11,  1*SIZE($4)
 
146
        LD      $f12,  2*SIZE($4)
 
147
        LD      $f13,  3*SIZE($4)
 
148
 
 
149
        LD      $f23,  4*SIZE($4)
 
150
        LD      $f24,  5*SIZE($4)
 
151
        LD      $f25,  6*SIZE($4)
 
152
        LD      $f26,  7*SIZE($4)
 
153
 
 
154
        LD      $f14,  0*SIZE($22)
 
155
        LD      $f15,  1*SIZE($22)
 
156
        LD      $f21,  2*SIZE($22)
 
157
        LD      $f22,  3*SIZE($22)
 
158
 
 
159
        LD      $f27,  4*SIZE($22)
 
160
        LD      $f28,  5*SIZE($22)
 
161
        LD      $f29,  6*SIZE($22)
 
162
        LD      $f30,  7*SIZE($22)
 
163
 
 
164
        lda     $2,   16*SIZE($2)       # a1_offset += 8
 
165
        subl    $5,  8, $5              # l -= 4
 
166
        lda     $4,    8*SIZE($4)       # b1_offset += 4
 
167
        lda     $22,   8*SIZE($22)      # c1_offset += 4
 
168
 
 
169
        ST      $f10, -16*SIZE($2)
 
170
        ST      $f14, -15*SIZE($2)
 
171
        ST      $f11, -14*SIZE($2)
 
172
        ST      $f15, -13*SIZE($2)
 
173
 
 
174
        ST      $f12, -12*SIZE($2)
 
175
        ST      $f21, -11*SIZE($2)
 
176
        ST      $f13, -10*SIZE($2)
 
177
        ST      $f22,  -9*SIZE($2)
 
178
 
 
179
        ST      $f23,  -8*SIZE($2)
 
180
        ST      $f27,  -7*SIZE($2)
 
181
        ST      $f24,  -6*SIZE($2)
 
182
        ST      $f28,  -5*SIZE($2)
 
183
 
 
184
        ST      $f25,  -4*SIZE($2)
 
185
        ST      $f29,  -3*SIZE($2)
 
186
        ST      $f26,  -2*SIZE($2)
 
187
        ST      $f30,  -1*SIZE($2)
 
188
 
 
189
        bgt     $5,  $L19               # if l>0 goto $L19
 
190
        bgt     $27, $L15               # if j>0 goto $L15
 
191
 
 
192
#else                   /* NT or TT */
 
193
 
 
194
$L10:
 
195
#ifndef C_VERSION
 
196
        mull    $19, $3, $2             # ls*ldb
 
197
        subl    $17,$14,$12             # min_j = n - js
 
198
#else
 
199
        mull    $21, $3, $2             # ls*ldb
 
200
        subl    $16,$14,$12             # min_j = n - js
 
201
#endif
 
202
 
 
203
        lda     $0,  R
 
204
        ldah    $24, Address_H(MATRIX_A)($28) # a_offset = &sb[0][0]
 
205
        cmple   $12, $0, $1             # (min_j>R) ?
 
206
        cmoveq  $1,  $0, $12            # if $1 then min_j = R
 
207
 
 
208
        lda     $24, Address_L(MATRIX_A)($24)
 
209
        mull    $10,$14,$25             # jsldc = js * ldc
 
210
 
 
211
        mov     $12, $27                # j = min_j
 
212
        fnop
 
213
        fnop
 
214
#ifndef C_VERSION
 
215
        SXADDQ  $2,$9,$0                # b_offset = b + ls*ldb
 
216
#else
 
217
        SXADDQ  $2,$20,$0               # b_offset = b + ls*ldb
 
218
#endif
 
219
        .align 4
 
220
 
 
221
$L101:
 
222
        mov     $24, $2                 # a1_offset = a_offset
 
223
        mov     $7,  $5                 # l = min_l
 
224
 
 
225
        lda     $24, LDB*SIZE($24)      # a_offset += LDB
 
226
        SXADDQ  $14, $0, $4             # b1_offset = b_offset + js
 
227
        lda     $0,    2*SIZE($0)       # b_offset += 2
 
228
        .align 4
 
229
 
 
230
$L102:
 
231
#ifndef C_VERSION
 
232
        LD      $f10, 0*SIZE($4)        # atemp1 = *(b1_offset+0)
 
233
        LD      $f11, 1*SIZE($4)        # atemp2 = *(b1_offset+1)
 
234
        SXADDQ  $19, $4, $4             # b1_offset += ldb
 
235
 
 
236
        LD      $f12, 0*SIZE($4)        # atemp3 = *(b1_offset+0)
 
237
        LD      $f13, 1*SIZE($4)        # atemp4 = *(b1_offset+1)
 
238
        SXADDQ  $19, $4, $4             # b1_offset += ldb
 
239
#else
 
240
        LD      $f10, 0*SIZE($4)        # atemp1 = *(b1_offset+0)
 
241
        LD      $f11, 1*SIZE($4)        # atemp2 = *(b1_offset+1)
 
242
        SXADDQ  $21, $4, $4             # b1_offset += ldb
 
243
 
 
244
        LD      $f12, 0*SIZE($4)        # atemp3 = *(b1_offset+0)
 
245
        LD      $f13, 1*SIZE($4)        # atemp4 = *(b1_offset+1)
 
246
        SXADDQ  $21, $4, $4             # b1_offset += ldb
 
247
#endif
 
248
 
 
249
        subl    $5, 2, $5               # l--
 
250
        ST      $f10, 0*SIZE($2)        # *(a1_offset+0) = atemp1
 
251
        ST      $f11, 1*SIZE($2)        # *(a1_offset+1) = atemp2
 
252
        ST      $f12, 2*SIZE($2)        # *(a1_offset+3) = atemp3
 
253
        ST      $f13, 3*SIZE($2)        # *(a1_offset+4) = atemp4
 
254
 
 
255
        lda     $2,   4*SIZE($2)        # a1_offset += 4
 
256
 
 
257
        bgt     $5, $L102               # if l>0 goto $102
 
258
 
 
259
        subl    $27, 2, $27             # l--
 
260
        bgt     $27, $L101
 
261
#endif
 
262
        clr     $11                     # is = 0
 
263
        .align 4
 
264
 
 
265
#if defined(NN) || (!defined(C_VERSION) && defined(NT)) \
 
266
        || (defined(C_VERSION) && defined(TN))
 
267
 
 
268
$L30:
 
269
#ifndef C_VERSION
 
270
        mull    $21,$3,$2               # lslda = lda * ls
 
271
        subl    $16,$11,$15             # min_i = m - is
 
272
#else
 
273
        mull    $19,$3,$2               # lslda = lda * ls
 
274
        subl    $17,$11,$15             # min_i = m - is
 
275
#endif
 
276
        cmple   $15,P, $1               # (min_i>P)?
 
277
        cmoveq  $1, P, $15              # if $1 then min_i = P
 
278
 
 
279
        mov     $28, $0                 # b_offset = &sa[0][0]
 
280
        mov     $7,  $5                 # l = min_l
 
281
 
 
282
#ifndef C_VERSION
 
283
        SXADDQ  $2,$20,$24              # a_offset = a + lslda
 
284
#else
 
285
        SXADDQ  $2,$9, $24              # a_offset = a + lslda
 
286
#endif
 
287
        .align 4
 
288
 
 
289
$L35:
 
290
        SXADDQ  $11, $24, $2            # a1_offset = a_offset + is
 
291
#ifndef C_VERSION
 
292
        SXADDQ  $21, $24, $24           # a_offset += lda
 
293
#else
 
294
        SXADDQ  $19, $24, $24           # a_offset += lda
 
295
#endif
 
296
 
 
297
        SXADDQ  $11, $24, $22           # a1_offset = a_offset + is
 
298
#ifndef C_VERSION
 
299
        SXADDQ  $21, $24, $24           # a_offset += lda
 
300
#else
 
301
        SXADDQ  $19, $24, $24           # a_offset += lda
 
302
#endif
 
303
 
 
304
        mov     $0,  $4                 # b1_offset = b_offset
 
305
        subl    $15,  8, $8             # i -= 8
 
306
 
 
307
        lda     $0,    8*SIZE($0)       # b_offset += 4
 
308
        subl    $5, 2, $5               # l--
 
309
        .align 4
 
310
 
 
311
        LD      $f10,  0*SIZE($2)
 
312
        LD      $f11,  1*SIZE($2)
 
313
        LD      $f23,  0*SIZE($22)
 
314
        LD      $f24,  1*SIZE($22)
 
315
 
 
316
        LD      $f12,  2*SIZE($2)
 
317
        LD      $f13,  3*SIZE($2)
 
318
        LD      $f25,  2*SIZE($22)
 
319
        LD      $f26,  3*SIZE($22)
 
320
 
 
321
        LD      $f14,  4*SIZE($2)
 
322
        LD      $f15,  5*SIZE($2)
 
323
        LD      $f27,  4*SIZE($22)
 
324
        LD      $f28,  5*SIZE($22)
 
325
 
 
326
        LD      $f21,  6*SIZE($2)
 
327
        LD      $f22,  7*SIZE($2)
 
328
        LD      $f29,  6*SIZE($22)
 
329
        LD      $f30,  7*SIZE($22)
 
330
        ble     $8,$L38                 # if i>0 goto $L39
 
331
        .align 4
 
332
 
 
333
$L39:
 
334
        ST      $f10,  (0*LDA+0)*SIZE($4)
 
335
        ST      $f11,  (0*LDA+1)*SIZE($4)
 
336
        ST      $f12,  (0*LDA+2)*SIZE($4)
 
337
        ST      $f13,  (0*LDA+3)*SIZE($4)
 
338
 
 
339
        LD      $f10,  8*SIZE($2)
 
340
        LD      $f11,  9*SIZE($2)
 
341
        LD      $f12, 10*SIZE($2)
 
342
        LD      $f13, 11*SIZE($2)
 
343
 
 
344
        ST      $f23, (0*LDA+4)*SIZE($4)
 
345
        ST      $f24, (0*LDA+5)*SIZE($4)
 
346
        ST      $f25, (0*LDA+6)*SIZE($4)
 
347
        ST      $f26, (0*LDA+7)*SIZE($4)
 
348
 
 
349
        LD      $f23,  8*SIZE($22)
 
350
        LD      $f24,  9*SIZE($22)
 
351
        LD      $f25, 10*SIZE($22)
 
352
        LD      $f26, 11*SIZE($22)
 
353
 
 
354
        ST      $f14, (LDA+0)*SIZE($4)
 
355
        ST      $f15, (LDA+1)*SIZE($4)
 
356
        ST      $f21, (LDA+2)*SIZE($4)
 
357
        ST      $f22, (LDA+3)*SIZE($4)
 
358
 
 
359
        LD      $f14, 12*SIZE($2)
 
360
        LD      $f15, 13*SIZE($2)
 
361
        LD      $f21, 14*SIZE($2)
 
362
        LD      $f22, 15*SIZE($2)
 
363
 
 
364
        ST      $f27, (LDA+4)*SIZE($4)
 
365
        ST      $f28, (LDA+5)*SIZE($4)
 
366
        ST      $f29, (LDA+6)*SIZE($4)
 
367
        ST      $f30, (LDA+7)*SIZE($4)
 
368
 
 
369
        LD      $f27, 12*SIZE($22)
 
370
        LD      $f28, 13*SIZE($22)
 
371
        LD      $f29, 14*SIZE($22)
 
372
        LD      $f30, 15*SIZE($22)
 
373
 
 
374
        subl    $8,  8, $8              # i -= 8
 
375
        lda     $22,    8*SIZE($22)     # a1_offset += 4
 
376
        lda     $4,  2*LDA*SIZE($4)     # b1_offset += LDA
 
377
        lda     $2,     8*SIZE($2)      # a1_offset += 4
 
378
 
 
379
        bgt     $8,$L39                 # if i>0 goto $L39
 
380
        .align 4
 
381
$L38:
 
382
        ST      $f10, (0*LDA+0)*SIZE($4)
 
383
        ST      $f11, (0*LDA+1)*SIZE($4)
 
384
        ST      $f12, (0*LDA+2)*SIZE($4)
 
385
        ST      $f13, (0*LDA+3)*SIZE($4)
 
386
 
 
387
        ST      $f23, (0*LDA+4)*SIZE($4)
 
388
        ST      $f24, (0*LDA+5)*SIZE($4)
 
389
        ST      $f25, (0*LDA+6)*SIZE($4)
 
390
        ST      $f26, (0*LDA+7)*SIZE($4)
 
391
 
 
392
        ST      $f14, (LDA+0)*SIZE($4)
 
393
        ST      $f15, (LDA+1)*SIZE($4)
 
394
        ST      $f21, (LDA+2)*SIZE($4)
 
395
        ST      $f22, (LDA+3)*SIZE($4)
 
396
 
 
397
        ST      $f27, (LDA+4)*SIZE($4)
 
398
        ST      $f28, (LDA+5)*SIZE($4)
 
399
        ST      $f29, (LDA+6)*SIZE($4)
 
400
        ST      $f30, (LDA+7)*SIZE($4)
 
401
        bgt     $5, $L35                # if l>0 goto $L35
 
402
        .align 4
 
403
 
 
404
#else       /* TN or TT */
 
405
 
 
406
$L30:
 
407
 
 
408
#ifndef C_VERSION
 
409
        mull    $11, $21, $2            # is*lda
 
410
        subl    $16, $11, $15           # min_i = m - is
 
411
#else
 
412
        mull    $11, $19, $2            # is*lda
 
413
        subl    $17, $11, $15           # min_i = m - is
 
414
#endif
 
415
 
 
416
        cmple   $15,P, $1               # (min_i>P)?
 
417
        cmoveq  $1, P, $15              # if $1 then min_i = P
 
418
 
 
419
#ifndef C_VERSION
 
420
        SXADDQ  $2, $20, $6             # c_offset = a + is*lda
 
421
        s4addq  $21, 0,  $1             # j = 4*lda
 
422
#else
 
423
        SXADDQ  $2, $9,  $6             # c_offset = a + is*lda
 
424
        s4addq  $19, 0,  $1             # j = 4*lda
 
425
#endif
 
426
 
 
427
        mov     $28, $0                 # b_offset = &sa[0][0]
 
428
        mov     $15, $8                 # i = min_i
 
429
        .align 4
 
430
 
 
431
$L201:
 
432
        mov     $0, $4                  # b1_offset = b_offset
 
433
        lda     $0, LDA*SIZE($0)        # b_offset += LDA
 
434
 
 
435
        SXADDQ  $3, $6, $24             # a_offset = c_offset + ls
 
436
        mov     $7,  $5                 # l = min_l
 
437
        .align 4
 
438
 
 
439
$L202:
 
440
        mov     $24, $2                 # a1_offset = a_offset
 
441
        lda     $24,   4*SIZE($24)      # a_offset += 4
 
442
 
 
443
        LD      $f10,  0*SIZE($2)
 
444
        LD      $f11,  1*SIZE($2)
 
445
        LD      $f12,  2*SIZE($2)
 
446
        LD      $f13,  3*SIZE($2)
 
447
 
 
448
#ifndef C_VERSION
 
449
        SXADDQ  $21, $2, $2             # a1_offset += lda
 
450
#else
 
451
        SXADDQ  $19, $2, $2             # a1_offset += lda
 
452
#endif
 
453
 
 
454
        LD      $f14,  0*SIZE($2)
 
455
        LD      $f15,  1*SIZE($2)
 
456
        LD      $f21,  2*SIZE($2)
 
457
        LD      $f22,  3*SIZE($2)
 
458
 
 
459
#ifndef C_VERSION
 
460
        SXADDQ  $21, $2, $2             # a1_offset += lda
 
461
#else
 
462
        SXADDQ  $19, $2, $2             # a1_offset += lda
 
463
#endif
 
464
 
 
465
        LD      $f23,  0*SIZE($2)
 
466
        LD      $f24,  1*SIZE($2)
 
467
        LD      $f25,  2*SIZE($2)
 
468
        LD      $f26,  3*SIZE($2)
 
469
 
 
470
#ifndef C_VERSION
 
471
        SXADDQ  $21, $2, $2             # a1_offset += lda
 
472
#else
 
473
        SXADDQ  $19, $2, $2             # a1_offset += lda
 
474
#endif
 
475
 
 
476
        LD      $f27,  0*SIZE($2)
 
477
        LD      $f28,  1*SIZE($2)
 
478
        LD      $f29,  2*SIZE($2)
 
479
        LD      $f30,  3*SIZE($2)
 
480
 
 
481
        ST      $f10,  0*SIZE($4)       # atemp1
 
482
        ST      $f14,  1*SIZE($4)       # atemp5
 
483
        ST      $f23,  2*SIZE($4)       # ctemp1
 
484
        ST      $f27,  3*SIZE($4)       # ctemp5
 
485
 
 
486
        ST      $f11,  4*SIZE($4)       # atemp2
 
487
        ST      $f15,  5*SIZE($4)       # atemp6
 
488
        ST      $f24,  6*SIZE($4)       # ctemp2
 
489
        ST      $f28,  7*SIZE($4)       # ctemp6
 
490
 
 
491
        ST      $f12,  8*SIZE($4)       # atemp3
 
492
        ST      $f21,  9*SIZE($4)       # atemp7
 
493
        ST      $f25, 10*SIZE($4)       # ctemp3
 
494
        ST      $f29, 11*SIZE($4)       # ctemp7
 
495
 
 
496
        ST      $f13, 12*SIZE($4)       # atemp4
 
497
        ST      $f22, 13*SIZE($4)       # atemp8
 
498
        ST      $f26, 14*SIZE($4)       # ctemp4
 
499
        ST      $f30, 15*SIZE($4)       # ctemp8
 
500
 
 
501
        lda     $4,   16*SIZE($4)       # b1_offset += 16
 
502
 
 
503
        subl    $5, 4, $5               # l -= 4
 
504
        bgt     $5, $L202
 
505
 
 
506
        subl    $8, 4, $8               # i -= 4
 
507
        SXADDQ  $1, $6, $6              # c_offset += j
 
508
        bgt     $8, $L201
 
509
 
 
510
        .align 4
 
511
#endif
 
512
 
 
513
$L33:
 
514
        sra     $12, 1, $27             # j = (min_j>>1)
 
515
        ldah    $26, Address_H(MATRIX_A)($28) # a_offset = &sb[0][0]
 
516
        lda     $26, Address_L(MATRIX_A)($26)
 
517
        SXADDQ  $25,$13,$6              # c_offset = c + jsldc;
 
518
 
 
519
        unop
 
520
        unop
 
521
        unop
 
522
        ble     $27, $L48
 
523
        .align 4
 
524
 
 
525
$L50:
 
526
        mov     $26, $0                 # b_offset = b_orig
 
527
        fclr    $f11
 
528
        lda     $26, SIZE*LDB($26)      # b_orig += LDB
 
529
        fclr    $f13
 
530
 
 
531
        mov     $28, $24                # a_offset = &sa[0][0]
 
532
        fclr    $f14
 
533
        sra     $15, 2, $8              # i = (min_i>>1)
 
534
        fclr    $f15
 
535
 
 
536
        SXADDQ  $11, $6, $22            # c1_offset = c_offset + is
 
537
        fclr    $f12
 
538
        SXADDQ  $10, $6, $6             # c_offset += ldc(2 times)
 
539
        fclr    $f25
 
540
 
 
541
        SXADDQ  $10, $6, $6             # c_offset += ldc
 
542
        fclr    $f26
 
543
        fclr    $f27
 
544
        ble     $8,$L52                 # if j<=0 goto $L52
 
545
        .align 4
 
546
 
 
547
$L54:
 
548
        mov     $24, $2                 # a1_offset = a_offset
 
549
        fclr    $f28
 
550
        sra     $7, 2, $5               # l = (min_l>>2)
 
551
        fclr    $f29
 
552
 
 
553
        mov     $0, $4                  # b1_offset = b_offset
 
554
        fclr    $f30
 
555
        SXADDQ  $10, $22, $23           # c2_offset = c1_offset + ldc
 
556
        fclr    $f21
 
557
 
 
558
        lda     $24, LDA*SIZE($24)      # a_offset += LDA
 
559
        LD      $f5, 0*SIZE($22)
 
560
        LD      $f6, 0*SIZE($23)
 
561
        ble     $5, $L55                # if l<=0 goto $L55
 
562
 
 
563
        LD      $f1,   0*SIZE($4)       # btemp1 = *(b1_offset+0)
 
564
        LD      $f10,  1*SIZE($4)       # btemp2 = *(b1_offset+1)
 
565
        LD      $f24,  2*SIZE($4)       # btemp3 = *(b1_offset+2)
 
566
        LD      $f23,  3*SIZE($4)       # btemp4 = *(b1_offset+3)
 
567
 
 
568
        LD      $f22,  0*SIZE($2)       # atemp1
 
569
        LD      $f20,  1*SIZE($2)       # atemp2
 
570
        LD      $f18,  2*SIZE($2)       # atemp3
 
571
        LD      $f16,  3*SIZE($2)       # atemp4
 
572
 
 
573
        LD      $f17,  4*SIZE($2)       # atemp5
 
574
        LD      $f0,   5*SIZE($2)       # atemp6
 
575
        LD      $f19,  6*SIZE($2)       # atemp7
 
576
        LD      $f2,   7*SIZE($2)       # atemp8
 
577
 
 
578
        lda     $2, 8*SIZE($2)          # a1_offset += 8
 
579
        subl    $5,  1, $5              # l--
 
580
        addq    $4, 4*SIZE, $4          # b1_offset += 2
 
581
        ble     $5, $L57                # if l<=0 goto $L57
 
582
        .align 4
 
583
 
 
584
/* 
 
585
   Main Loop.
 
586
   This loop is very important and affects calculating speed directry.
 
587
   Each load waits 12 clocks which is enough to load from 2nd cache.
 
588
   And one loop takes 33 clocks(multiply and add = 32 clock plus jump
 
589
   latency = 1 clock).  If you have 21164A with 600MHz machine,  it'll
 
590
   take 1163.6 MFlops in this loop.  This is theoretical value, but it's
 
591
   pretty fast, isn't it?
 
592
*/
 
593
 
 
594
$L58:
 
595
/*  1 */
 
596
        addt    $f28,$f11,$f28
 
597
#ifdef DGEMM
 
598
        ldt     $f31,      32*SIZE($4)  # prefetch
 
599
#else
 
600
        ldt     $f31,      36*SIZE($4)  # prefetch
 
601
#endif
 
602
        mult    $f1,$f22,$f11
 
603
#ifdef DGEMM
 
604
        ldt     $f31,      44*SIZE($2)  # prefetch
 
605
#else
 
606
        nop
 
607
#endif
 
608
 
 
609
/*  2 */
 
610
        addt    $f29,$f13,$f29
 
611
        mult    $f1,$f20,$f13
 
612
/*  3 */
 
613
        addt    $f30,$f14,$f30
 
614
        mult    $f1,$f18,$f14
 
615
 
 
616
/*  4 */
 
617
        addt    $f21,$f15,$f21
 
618
        subl    $5,1,$5
 
619
        mult    $f1,$f16,$f15
 
620
        LD      $f1,   0*SIZE($4)
 
621
 
 
622
/*  5 */
 
623
        addt    $f12,$f11,$f12
 
624
        nop
 
625
        mult    $f10,$f22,$f11
 
626
        LD      $f22,  0*SIZE($2)
 
627
 
 
628
/*  6 */
 
629
        addt    $f25,$f13,$f25
 
630
        nop
 
631
        mult    $f10,$f20,$f13
 
632
        LD      $f20,  1*SIZE($2)
 
633
 
 
634
/*  7 */
 
635
        addt    $f26,$f14,$f26
 
636
        nop
 
637
        mult    $f10,$f18,$f14
 
638
        LD      $f18,  2*SIZE($2)
 
639
 
 
640
/*  8 */
 
641
        addt    $f27,$f15,$f27
 
642
        nop
 
643
        mult    $f10,$f16,$f15
 
644
        LD      $f16,  3*SIZE($2)
 
645
 
 
646
/*  9 */
 
647
        addt    $f28,$f11,$f28
 
648
        nop
 
649
        mult    $f24,$f17,$f11
 
650
        LD      $f7,   1*SIZE($4)
 
651
 
 
652
/* 10 */
 
653
        addt    $f29,$f13,$f29
 
654
        mult    $f24,$f0,$f13
 
655
/* 11 */
 
656
        addt    $f30,$f14,$f30
 
657
        mult    $f24,$f19,$f14
 
658
 
 
659
/* 12 */
 
660
        addt    $f21,$f15,$f21
 
661
        nop
 
662
        mult    $f24,$f2,$f15
 
663
        LD      $f8,  2*SIZE($4)
 
664
 
 
665
/* 13 */
 
666
        addt    $f12,$f11,$f12
 
667
        nop
 
668
        mult    $f23,$f17,$f11
 
669
        LD      $f17,  4*SIZE($2)
 
670
 
 
671
/* 14 */
 
672
        addt    $f25,$f13,$f25
 
673
        nop
 
674
        mult    $f23,$f0,$f13
 
675
        LD      $f0,   5*SIZE($2)
 
676
 
 
677
/* 15 */
 
678
        addt    $f26,$f14,$f26
 
679
        nop
 
680
        mult    $f23,$f19,$f14
 
681
        LD      $f19,  6*SIZE($2)
 
682
 
 
683
/* 16 */
 
684
        addt    $f27,$f15,$f27
 
685
        LD      $f4,   3*SIZE($4)       # modified
 
686
        mult    $f23,$f2,$f15
 
687
        LD      $f2,   7*SIZE($2)
 
688
 
 
689
/* 17 */
 
690
        addt    $f28,$f11,$f28
 
691
        nop
 
692
        mult    $f1,$f22,$f11
 
693
        nop
 
694
 
 
695
/* 18 */
 
696
        addt    $f29,$f13,$f29
 
697
        nop
 
698
        mult    $f1,$f20,$f13
 
699
#ifdef DGEMM
 
700
        LD      $f31,   48*SIZE($2)
 
701
#else
 
702
        nop
 
703
#endif
 
704
 
 
705
/* 19 */
 
706
        addt    $f30,$f14,$f30
 
707
        nop
 
708
        mult    $f1,$f18,$f14
 
709
        lda     $2,   16*SIZE($2)               # a1_offset += 16
 
710
 
 
711
/* 20 */
 
712
        addt    $f21,$f15,$f21
 
713
        nop
 
714
        mult    $f1,$f16,$f15
 
715
        LD      $f1,   4*SIZE($4)
 
716
 
 
717
/* 21 */
 
718
        addt    $f12, $f11, $f12
 
719
        nop
 
720
        mult    $f7,  $f22, $f11
 
721
        LD      $f22, -8*SIZE($2)
 
722
 
 
723
/* 22 */
 
724
        addt    $f25,$f13,$f25
 
725
        nop
 
726
        mult    $f7,  $f20, $f13
 
727
        LD      $f20, -7*SIZE($2)
 
728
 
 
729
/* 23 */
 
730
        addt    $f26,$f14,$f26
 
731
        nop
 
732
        mult    $f7,  $f18, $f14
 
733
        LD      $f18, -6*SIZE($2)
 
734
 
 
735
/* 24 */
 
736
        addt    $f27,$f15,$f27
 
737
        nop
 
738
        mult    $f7,  $f16, $f15
 
739
        LD      $f16, -5*SIZE($2)
 
740
 
 
741
/* 25 */
 
742
        addt    $f28,$f11,$f28
 
743
        nop
 
744
        mult    $f8,$f17,$f11
 
745
        LD      $f10,  5*SIZE($4)       # modifiled
 
746
 
 
747
/* 26 */
 
748
        addt    $f29,$f13,$f29
 
749
        nop
 
750
        mult    $f8,$f0,$f13
 
751
        lda     $4,    8*SIZE($4)
 
752
 
 
753
/* 27 */
 
754
        addt    $f30,$f14,$f30
 
755
        nop
 
756
        mult    $f8,$f19,$f14
 
757
        LD      $f24, -2*SIZE($4)
 
758
 
 
759
/* 28 */
 
760
        addt    $f21,$f15,$f21
 
761
        nop
 
762
        mult    $f8,$f2,$f15
 
763
        LD      $f23, -1*SIZE($4)
 
764
 
 
765
/* 29 */
 
766
        addt    $f12,$f11,$f12
 
767
        nop
 
768
        mult    $f4,$f17,$f11
 
769
        LD      $f17, -4*SIZE($2)
 
770
 
 
771
/* 30 */
 
772
        addt    $f25,$f13,$f25
 
773
        nop
 
774
        mult    $f4,$f0,$f13
 
775
        LD      $f0,  -3*SIZE($2)
 
776
 
 
777
/* 31 */
 
778
        addt    $f26,$f14,$f26
 
779
        nop
 
780
        mult    $f4,$f19,$f14
 
781
        LD      $f19, -2*SIZE($2)
 
782
 
 
783
/* 32 */
 
784
        addt    $f27,$f15,$f27
 
785
        mult    $f4,$f2,$f15
 
786
        LD      $f2,  -1*SIZE($2)
 
787
        bgt     $5,$L58
 
788
        .align 4
 
789
 
 
790
$L57:
 
791
        addt    $f28,$f11,$f28
 
792
        lds     $f31,  8*SIZE($22)      # prefetch(modify intent)
 
793
        mult    $f1,$f22,$f11
 
794
#ifdef DGEMM
 
795
        lds     $f31, 12*SIZE($23)      # prefetch(modify intent)
 
796
#else
 
797
        unop
 
798
#endif
 
799
 
 
800
        addt    $f29,$f13,$f29
 
801
        mult    $f1,$f20,$f13
 
802
        addt    $f30,$f14,$f30
 
803
        mult    $f1,$f18,$f14
 
804
 
 
805
        addt    $f21,$f15,$f21
 
806
        unop
 
807
        mult    $f1,$f16,$f15
 
808
        LD      $f1,  0*SIZE($4)
 
809
 
 
810
        addt    $f12,$f11,$f12
 
811
        unop
 
812
        mult    $f10,$f22,$f11
 
813
        LD      $f22, 0*SIZE($2)
 
814
 
 
815
        addt    $f25,$f13,$f25
 
816
        unop
 
817
        mult    $f10,$f20,$f13
 
818
        LD      $f20, 1*SIZE($2)
 
819
 
 
820
        addt    $f26,$f14,$f26
 
821
        unop
 
822
        mult    $f10,$f18,$f14
 
823
        LD      $f18, 2*SIZE($2)
 
824
 
 
825
        addt    $f27,$f15,$f27
 
826
        unop
 
827
        mult    $f10,$f16,$f15
 
828
        LD      $f16, 3*SIZE($2)
 
829
 
 
830
        addt    $f28,$f11,$f28
 
831
        lda     $2,   4*SIZE($2)        # a1_offset += 4
 
832
        mult    $f24,$f17,$f11
 
833
        LD      $f7,  1*SIZE($4)
 
834
 
 
835
        addt    $f29,$f13,$f29
 
836
        mult    $f24,$f0,$f13
 
837
        addt    $f30,$f14,$f30
 
838
        mult    $f24,$f19,$f14
 
839
 
 
840
        addt    $f21,$f15,$f21
 
841
        unop
 
842
        mult    $f24,$f2,$f15
 
843
        LD      $f24, 2*SIZE($4)
 
844
 
 
845
        addt    $f12,$f11,$f12
 
846
        unop
 
847
        mult    $f23,$f17,$f11
 
848
        LD      $f17, 0*SIZE($2)
 
849
 
 
850
        addt    $f25,$f13,$f25
 
851
        unop
 
852
        mult    $f23,$f0,$f13
 
853
        LD      $f0,  1*SIZE($2)
 
854
 
 
855
        addt    $f26,$f14,$f26
 
856
        unop
 
857
        mult    $f23,$f19,$f14
 
858
        LD      $f19, 2*SIZE($2)
 
859
 
 
860
        addt    $f27,$f15,$f27
 
861
        unop
 
862
        mult    $f23,$f2,$f15
 
863
        LD      $f2,  3*SIZE($2)
 
864
 
 
865
        addt    $f28,$f11,$f28
 
866
        LD      $f4,  3*SIZE($4)
 
867
        mult    $f1,$f22,$f11
 
868
        lda     $2,  4*SIZE($2)         # a1_offset += 4
 
869
 
 
870
        addt    $f29,$f13,$f29
 
871
        addq    $4, 4*SIZE, $4
 
872
        mult    $f1,$f20,$f13
 
873
        unop
 
874
 
 
875
        addt    $f30,$f14,$f30
 
876
        mult    $f1,$f18,$f14
 
877
        addt    $f21,$f15,$f21
 
878
        mult    $f1,$f16,$f15
 
879
 
 
880
        addt    $f12, $f11, $f12
 
881
        mult    $f7,  $f22, $f11
 
882
        addt    $f25, $f13, $f25
 
883
        mult    $f7,  $f20, $f13
 
884
 
 
885
        addt    $f26,$f14,$f26
 
886
        mult    $f7, $f18,$f14
 
887
        addt    $f27,$f15,$f27
 
888
        mult    $f7, $f16,$f15
 
889
 
 
890
        addt    $f28,$f11,$f28
 
891
        mult    $f24,$f17,$f11
 
892
        addt    $f29,$f13,$f29
 
893
        mult    $f24,$f0,$f13
 
894
 
 
895
        addt    $f30,$f14,$f30
 
896
        mult    $f24,$f19,$f14
 
897
        addt    $f21,$f15,$f21
 
898
        mult    $f24,$f2,$f15
 
899
 
 
900
        addt    $f12, $f11, $f12
 
901
        mult    $f4,  $f17, $f11
 
902
        addt    $f25, $f13, $f25
 
903
        mult    $f4,  $f0,  $f13
 
904
 
 
905
        addt    $f26, $f14, $f26
 
906
        mult    $f4,  $f19, $f14
 
907
        addt    $f27, $f15, $f27
 
908
        mult    $f4,  $f2,  $f15
 
909
        .align 4
 
910
 
 
911
$L55:
 
912
        and     $7,3,$5                 # l = (min_l&3)
 
913
        beq     $5,$L60                 # if l<=0 goto $L60
 
914
 
 
915
        LD      $f22, 0*SIZE($2)        # atemp1
 
916
        LD      $f1,  0*SIZE($4)        # btemp1
 
917
 
 
918
        LD      $f20, 1*SIZE($2)        # atemp2
 
919
        LD      $f10, 1*SIZE($4)        # btemp2
 
920
        LD      $f18, 2*SIZE($2)        # atemp3
 
921
        LD      $f16, 3*SIZE($2)        # atemp4
 
922
 
 
923
        lda     $2,   4*SIZE($2)        # a1_offset += 4
 
924
        subl    $5, 1, $5               # l--
 
925
        lda     $4,   2*SIZE($4)        # b1_offset += 2
 
926
        ble     $5,$L62                 # if l<=0 goto $L62
 
927
        .align 4
 
928
 
 
929
$L63:
 
930
        addt    $f28,$f11,$f28
 
931
#ifdef DGEMM
 
932
        LD      $f31, 8*8($4)
 
933
#else
 
934
        unop
 
935
#endif
 
936
        mult    $f1,$f22,$f11
 
937
        unop
 
938
 
 
939
        addt    $f29,$f13,$f29
 
940
        mult    $f1,$f20,$f13
 
941
        addt    $f30,$f14,$f30
 
942
        mult    $f1,$f18,$f14
 
943
 
 
944
        addt    $f21,$f15,$f21
 
945
        lda     $2,    4*SIZE($2)       # a1_offset += 4
 
946
        mult    $f1,$f16,$f15
 
947
        LD      $f1,   0*SIZE($4)
 
948
 
 
949
        addt    $f12,$f11,$f12
 
950
        lda     $4,    2*SIZE($4)       # b1_offset += 2
 
951
        mult    $f10,$f22,$f11
 
952
        LD      $f22, -4*SIZE($2)
 
953
 
 
954
        addt    $f25,$f13,$f25
 
955
        subl    $5,1,$5                 # l--
 
956
        mult    $f10,$f20,$f13
 
957
        LD      $f20,  -3*SIZE($2)
 
958
 
 
959
        addt    $f26,$f14,$f26
 
960
        unop
 
961
        mult    $f10,$f18,$f14
 
962
        LD      $f18,  -2*SIZE($2)
 
963
 
 
964
        addt    $f27,$f15,$f27
 
965
        mult    $f10,$f16,$f15
 
966
        LD      $f10,  -1*SIZE($4)
 
967
        LD      $f16,  -1*SIZE($2)
 
968
 
 
969
        bgt     $5,$L63                 # if l>0 goto $L63
 
970
        unop
 
971
        unop
 
972
        unop
 
973
        .align 4
 
974
 
 
975
$L62:
 
976
        addt    $f28,$f11,$f28
 
977
        mult    $f1,$f22,$f11
 
978
        addt    $f29,$f13,$f29
 
979
        mult    $f1,$f20,$f13
 
980
 
 
981
        addt    $f30,$f14,$f30
 
982
        mult    $f1,$f18,$f14
 
983
        addt    $f21,$f15,$f21
 
984
        mult    $f1,$f16,$f15
 
985
 
 
986
        addt    $f12,$f11,$f12
 
987
        mult    $f10,$f22,$f11
 
988
        addt    $f25,$f13,$f25
 
989
        mult    $f10,$f20,$f13
 
990
 
 
991
        addt    $f26,$f14,$f26
 
992
        mult    $f10,$f18,$f14
 
993
        addt    $f27,$f15,$f27
 
994
        mult    $f10,$f16,$f15
 
995
        .align 4
 
996
 
 
997
$L60:
 
998
        addt    $f28,$f11,$f28
 
999
        LD      $f20, 1*SIZE($22)       # atemp2 = *(c1_offset+1)
 
1000
        mult    $f3,$f12,$f11
 
1001
        LD      $f18, 2*SIZE($22)       # atemp3 = *(c1_offset+2)
 
1002
 
 
1003
        addt    $f29,$f13,$f29
 
1004
        LD      $f16, 3*SIZE($22)       # atemp4 = *(c1_offset+3)
 
1005
        mult    $f3,$f25,$f13
 
1006
        LD      $f0,  1*SIZE($23)       # atemp6 = *(c2_offset+1)
 
1007
 
 
1008
        addt    $f30,$f14,$f30
 
1009
        LD      $f19, 2*SIZE($23)       # atemp7 = *(c2_offset+2)
 
1010
        mult    $f3,$f26,$f14
 
1011
        LD      $f2,  3*SIZE($23)       # atemp8 = *(c2_offset+3)
 
1012
 
 
1013
        addt    $f21,$f15,$f21
 
1014
        unop
 
1015
        mult    $f3,$f27,$f15
 
1016
        unop
 
1017
 
 
1018
        addt    $f5,$f11,$f12
 
1019
        addq    $22, 4*SIZE, $22        # c1_offset += 4
 
1020
        mult    $f3,$f28,$f11
 
1021
        subl    $8,1,$8                 # i--
 
1022
 
 
1023
        addt    $f20, $f13, $f25
 
1024
        mult    $f3,  $f29, $f13
 
1025
        addt    $f18, $f14, $f26
 
1026
        mult    $f3,  $f30, $f14
 
1027
 
 
1028
        addt    $f16,$f15,$f27
 
1029
        mult    $f3,$f21,$f15
 
1030
        addt    $f6,$f11,$f28
 
1031
        ST      $f12, -4*SIZE($22)      # *(c1_offset+0) = ctemp1
 
1032
 
 
1033
        addt    $f0,$f13,$f29
 
1034
        unop
 
1035
        ST      $f25, -3*SIZE($22)      # *(c1_offset+1) = ctemp2
 
1036
        fclr    $f11
 
1037
        
 
1038
        addt    $f19,$f14,$f30
 
1039
        unop
 
1040
        ST      $f26, -2*SIZE($22)      # *(c1_offset+2) = ctemp3
 
1041
        fclr    $f13
 
1042
 
 
1043
        addt    $f2,$f15,$f21
 
1044
        unop
 
1045
        ST      $f27,  -1*SIZE($22)     # *(c1_offset+3) = ctemp4
 
1046
        fclr    $f14
 
1047
 
 
1048
        ST      $f28, 0*SIZE($23)       # *(c2_offset+0) = ctemp5
 
1049
        fclr    $f15
 
1050
        unop
 
1051
        fclr    $f12
 
1052
 
 
1053
        ST      $f29, 1*SIZE($23)       # *(c2_offset+1) = ctemp6
 
1054
        fclr    $f25
 
1055
        unop
 
1056
        fclr    $f26
 
1057
 
 
1058
        ST      $f30, 2*SIZE($23)       # *(c2_offset+2) = ctemp7
 
1059
        fclr    $f27
 
1060
        ST      $f21, 3*SIZE($23)       # *(c2_offset+3) = ctemp8
 
1061
        bgt     $8,$L54                 # if i>0 goto $L54
 
1062
        .align 4
 
1063
 
 
1064
$L52:
 
1065
        and     $15,3,$8                # i = (min_i&3)
 
1066
        beq     $8,$L49                 # if i<0 goto $L49
 
1067
        unop
 
1068
        unop
 
1069
        .align 4
 
1070
 
 
1071
$L69:
 
1072
        mov     $24, $2                 # a1_offset = a_offset
 
1073
        addq    $24, SIZE, $24          # a_offset ++
 
1074
        mov     $0, $4                  # b1_offset = b_offset
 
1075
        SXADDQ  $10, $22, $23           # c2_offset = c1_offset + ldc
 
1076
 
 
1077
        fclr    $f12                    # ctemp1 = ZERO
 
1078
        mov     $7, $5                  # l = min_l
 
1079
        fclr    $f28                    # ctemp5 = ZERO
 
1080
        ble     $7,$L71                 # if l<=0 goto $L71
 
1081
        .align 4
 
1082
 
 
1083
$L73:
 
1084
        LD      $f22,    0($2)          # atemp1
 
1085
        lda     $2,    4*SIZE($2)       # a1_offset += 4
 
1086
 
 
1087
        LD      $f1,   0*SIZE($4)       # btemp1 = *(b1_offset+0)
 
1088
        LD      $f10,  1*SIZE($4)       # btemp2 = *(b1_offset+2)
 
1089
 
 
1090
        mult    $f1, $f22,$f11          # temp1 = btemp1 * atemp1
 
1091
        mult    $f10,$f22,$f13          # temp2 = btemp2 * atemp1
 
1092
        lda     $4,    2*SIZE($4)       # b1_offset ++
 
1093
        subl    $5,1,$5                 # l--
 
1094
 
 
1095
        addt    $f12,$f11,$f12          # ctemp1 = ctemp1 + temp1
 
1096
        addt    $f28,$f13,$f28          # ctemp5 = ctemp5 + temp2
 
1097
        bgt     $5,$L73                 # if l>0 goto $L73
 
1098
        unop
 
1099
        .align 4
 
1100
 
 
1101
$L71:
 
1102
        mult    $f3,$f12,$f11           # temp1 = alpha*ctemp1
 
1103
        mult    $f3,$f28,$f13           # temp2 = alpha*ctemp2
 
1104
        LD      $f22, 0*SIZE($22)       # atemp1 = *c1_offset
 
1105
        LD      $f17, 0*SIZE($23)       # atemp5 = *c2_offset
 
1106
 
 
1107
        addt    $f22,$f11,$f12          # ctemp1 = atemp1 + temp1
 
1108
        addt    $f17,$f13,$f28          # ctemp2 = atemp5 + temp2
 
1109
        subl    $8,1,$8                 # i--
 
1110
        ST      $f12, 0*SIZE($22)       # *c1_offset = ctemp1
 
1111
 
 
1112
        ST      $f28, 0*SIZE($23)       # *c2_offset = ctemp2
 
1113
        addq    $22, SIZE, $22          # c1_offset ++
 
1114
        bgt     $8,$L69                 # if i>0 goto $L69
 
1115
        unop
 
1116
        .align 4
 
1117
 
 
1118
$L49:
 
1119
        subl    $27,1,$27               # j --
 
1120
        bgt     $27,$L50                # if j>0 goto $L50
 
1121
        unop
 
1122
        unop
 
1123
        .align 4
 
1124
 
 
1125
$L48:
 
1126
        blbc    $12,$L29                # if (!min_j&1) goto $L29
 
1127
        fclr    $f11
 
1128
        sra     $15,2,$8                # i = (min_i>>2)
 
1129
        fclr    $f13
 
1130
 
 
1131
        mov     $26, $0                 # b_offset = b_orig
 
1132
        fclr    $f14
 
1133
        mov     $28, $24                # a_offset = &sa[0][0]
 
1134
        fclr    $f15
 
1135
 
 
1136
        SXADDQ  $11, $6, $22            # c1_offset = c_offset + is
 
1137
        ble     $8,$L79                 # if i<0 goto $L79
 
1138
        unop
 
1139
        unop
 
1140
        .align 4
 
1141
 
 
1142
$L81:
 
1143
        mov     $24, $2                 # a1_offset = a_offset
 
1144
        fclr    $f12
 
1145
        sra     $7, 2, $5               # l = (min_l>>2)
 
1146
        fclr    $f25
 
1147
 
 
1148
        mov     $0, $4                  # b1_offset = b_offset
 
1149
        fclr    $f26
 
1150
        lda     $24, LDA*SIZE($24)      # a_offset += LDA
 
1151
        fclr    $f27
 
1152
 
 
1153
        unop
 
1154
        ble     $5,$L82
 
1155
 
 
1156
        LD      $f1,   0*SIZE($4)       # btemp1
 
1157
        LD      $f10,  2*SIZE($4)       # btemp2
 
1158
 
 
1159
        LD      $f22,  0*SIZE($2)       # atemp1
 
1160
        LD      $f20,  1*SIZE($2)       # atemp2
 
1161
        LD      $f18,  2*SIZE($2)       # atemp3
 
1162
        LD      $f16,  3*SIZE($2)       # atemp4
 
1163
        LD      $f17,  4*SIZE($2)       # atemp5
 
1164
        LD      $f0,   5*SIZE($2)       # atemp6
 
1165
        LD      $f19,  6*SIZE($2)       # atemp7
 
1166
        LD      $f2,   7*SIZE($2)       # atemp8
 
1167
 
 
1168
        lda     $2,    8*SIZE($2)       # a1_offset += 8
 
1169
 
 
1170
        subl    $5, 1, $5               # l--
 
1171
        lda     $4,    4*SIZE($4)       # b1_offset += 4
 
1172
        ble     $5, $L84                # if l<= 0 goto $L84
 
1173
        .align 4
 
1174
$L85:
 
1175
        addt    $f12,$f11,$f12
 
1176
        unop
 
1177
        mult    $f1,$f22,$f11
 
1178
        LD      $f22,  0*SIZE($2)       # atemp1
 
1179
 
 
1180
        addt    $f25,$f13,$f25
 
1181
        unop
 
1182
        mult    $f1,$f20,$f13
 
1183
        LD      $f20,  1*SIZE($2)       # atemp2
 
1184
 
 
1185
        addt    $f26,$f14,$f26
 
1186
        unop
 
1187
        mult    $f1,$f18,$f14
 
1188
        LD      $f18,  2*SIZE($2)       # atemp3
 
1189
 
 
1190
        addt    $f27,$f15,$f27
 
1191
        unop
 
1192
        mult    $f1,$f16,$f15
 
1193
        LD      $f1,   0*SIZE($4)       # btemp1
 
1194
 
 
1195
        addt    $f12,$f11,$f12
 
1196
        LD      $f16,  3*SIZE($2)       # atemp4
 
1197
        mult    $f10,$f17,$f11
 
1198
        LD      $f17,  4*SIZE($2)       # atemp5
 
1199
 
 
1200
        addt    $f25,$f13,$f25
 
1201
        unop
 
1202
        mult    $f10,$f0,$f13
 
1203
        LD      $f0,   5*SIZE($2)       # atemp6
 
1204
 
 
1205
        addt    $f26,$f14,$f26
 
1206
        unop
 
1207
        mult    $f10,$f19,$f14
 
1208
        LD      $f19,  6*SIZE($2)       # atemp7
 
1209
 
 
1210
        addt    $f27,$f15,$f27
 
1211
        unop
 
1212
        mult    $f10,$f2,$f15
 
1213
        LD      $f10,  2*SIZE($4)       # btemp2
 
1214
 
 
1215
        addt    $f12,$f11,$f12
 
1216
        LD      $f2,   7*SIZE($2)       # atemp8
 
1217
        mult    $f1,$f22,$f11
 
1218
        LD      $f22,  8*SIZE($2)       # atemp1
 
1219
 
 
1220
        addt    $f25,$f13,$f25
 
1221
        unop
 
1222
        mult    $f1,$f20,$f13
 
1223
        LD      $f20,  9*SIZE($2)       # atemp2
 
1224
 
 
1225
        addt    $f26,$f14,$f26
 
1226
        unop
 
1227
        mult    $f1,$f18,$f14
 
1228
        LD      $f18, 10*SIZE($2)       # atemp3
 
1229
 
 
1230
        addt    $f27,$f15,$f27
 
1231
        lda     $2,   16*SIZE($2)       # a1_offset += 16
 
1232
        mult    $f1,$f16,$f15
 
1233
        LD      $f1,   4*SIZE($4)       # btemp1
 
1234
 
 
1235
        addt    $f12,$f11,$f12
 
1236
        LD      $f16, -5*SIZE($2)       # atemp4
 
1237
        mult    $f10,$f17,$f11
 
1238
        LD      $f17, -4*SIZE($2)       # atemp5
 
1239
 
 
1240
        addt    $f25,$f13,$f25
 
1241
        unop
 
1242
        mult    $f10,$f0,$f13
 
1243
        LD      $f0,  -3*SIZE($2)       # atemp6
 
1244
 
 
1245
        addt    $f26,$f14,$f26
 
1246
        unop
 
1247
        mult    $f10,$f19,$f14
 
1248
        LD      $f19, -2*SIZE($2)       # atemp7
 
1249
 
 
1250
        addt    $f27,$f15,$f27
 
1251
        unop
 
1252
        mult    $f10,$f2,$f15
 
1253
        LD      $f10,  6*SIZE($4)       # btemp2
 
1254
 
 
1255
        LD      $f2,  -1*SIZE($2)       # atemp8
 
1256
        subl    $5, 1, $5               # l--
 
1257
        lda     $4,    8*SIZE($4)       # b1_offset += 8
 
1258
        bgt     $5,$L85                 # if l>0 goto $L85
 
1259
 
 
1260
$L84:
 
1261
        addt    $f12,$f11,$f12
 
1262
        unop
 
1263
        mult    $f1,$f22,$f11
 
1264
        LD      $f22,  0*SIZE($2)       # atemp1
 
1265
 
 
1266
        addt    $f25,$f13,$f25
 
1267
        unop
 
1268
        mult    $f1,$f20,$f13
 
1269
        LD      $f20,  1*SIZE($2)       # atemp2
 
1270
 
 
1271
        addt    $f26,$f14,$f26
 
1272
        unop
 
1273
        mult    $f1,$f18,$f14
 
1274
        LD      $f18,  2*SIZE($2)       # atemp3
 
1275
 
 
1276
        addt    $f27,$f15,$f27
 
1277
        unop
 
1278
        mult    $f1,$f16,$f15
 
1279
        LD      $f1,   0*SIZE($4)       # btemp1
 
1280
 
 
1281
        addt    $f12,$f11,$f12
 
1282
        LD      $f16,  3*SIZE($2)       # atemp4
 
1283
        mult    $f10,$f17,$f11
 
1284
        LD      $f17,  4*SIZE($2)       # atemp5
 
1285
 
 
1286
        addt    $f25,$f13,$f25
 
1287
        unop
 
1288
        mult    $f10,$f0,$f13
 
1289
        LD      $f0,   5*SIZE($2)       # atemp6
 
1290
 
 
1291
        addt    $f26,$f14,$f26
 
1292
        unop
 
1293
        mult    $f10,$f19,$f14
 
1294
        LD      $f19,  6*SIZE($2)       # atemp7
 
1295
 
 
1296
        addt    $f27,$f15,$f27
 
1297
        lda     $2,    8*SIZE($2)       # a1_offset += 8
 
1298
        mult    $f10, $f2, $f15
 
1299
        LD      $f10,  2*SIZE($4)       # b2_offset
 
1300
 
 
1301
        addt    $f12,$f11,$f12
 
1302
        LD      $f2,  -1*SIZE($2)       # atemp8
 
1303
        mult    $f1,$f22,$f11
 
1304
        lda     $4,    4*SIZE($4)       # b1_offset ++
 
1305
 
 
1306
        addt    $f25,$f13,$f25
 
1307
        mult    $f1,$f20,$f13
 
1308
        addt    $f26,$f14,$f26
 
1309
        mult    $f1,$f18,$f14
 
1310
 
 
1311
        addt    $f27,$f15,$f27
 
1312
        mult    $f1,$f16,$f15
 
1313
        addt    $f12,$f11,$f12
 
1314
        mult    $f10,$f17,$f11
 
1315
 
 
1316
        addt    $f25,$f13,$f25
 
1317
        mult    $f10,$f0,$f13
 
1318
        addt    $f26,$f14,$f26
 
1319
        mult    $f10,$f19,$f14
 
1320
 
 
1321
        addt    $f27,$f15,$f27
 
1322
        unop
 
1323
        mult    $f10,$f2,$f15
 
1324
        unop
 
1325
        .align 4
 
1326
 
 
1327
$L82:
 
1328
        and     $7, 3, $5               # l = (min_l&3)
 
1329
        beq     $5, $L87                # if l<=0 goto $L87
 
1330
 
 
1331
        LD      $f22, 0*SIZE($2)        # atemp1
 
1332
        LD      $f1,  0*SIZE($4)        # b1_offset
 
1333
 
 
1334
        LD      $f20, 1*SIZE($2)        # atemp2
 
1335
        LD      $f18, 2*SIZE($2)        # atemp3
 
1336
        LD      $f16, 3*SIZE($2)        # atemp4
 
1337
        lda     $2,   4*SIZE($2)        # a1_offset += 4
 
1338
 
 
1339
        subl    $5, 1, $5               # l--
 
1340
        lda     $4,   2*SIZE($4)        # b1_offset += 2
 
1341
 
 
1342
        ble     $5,$L89                 # if l<=0 goto $L89
 
1343
        unop
 
1344
        .align 4
 
1345
 
 
1346
$L90:
 
1347
        addt    $f12,$f11,$f12
 
1348
        unop
 
1349
        mult    $f1,$f22,$f11
 
1350
        LD      $f22,  0*SIZE($2)       # atemp1
 
1351
 
 
1352
        addt    $f25,$f13,$f25
 
1353
        unop
 
1354
        mult    $f1,$f20,$f13
 
1355
        LD      $f20,  1*SIZE($2)       # atemp2
 
1356
 
 
1357
        addt    $f26,$f14,$f26
 
1358
        unop
 
1359
        mult    $f1,$f18,$f14
 
1360
        LD      $f18,  2*SIZE($2)       # atemp3
 
1361
 
 
1362
        addt    $f27,$f15,$f27
 
1363
        lda     $2,    4*SIZE($2)       # a1_offset += 4
 
1364
        mult    $f1,$f16,$f15
 
1365
        LD      $f1,   0*SIZE($4)       # btemp1
 
1366
 
 
1367
        LD      $f16, -1*SIZE($2)       # atemp4
 
1368
        subl    $5, 1, $5               # l--
 
1369
        lda     $4,    2*SIZE($4)       # b1_offset += 2
 
1370
        bgt     $5, $L90                # if l>0 goto $L90
 
1371
        .align 4
 
1372
 
 
1373
$L89:
 
1374
        addt    $f12,$f11,$f12
 
1375
        mult    $f1,$f22,$f11
 
1376
        addt    $f25,$f13,$f25
 
1377
        mult    $f1,$f20,$f13
 
1378
 
 
1379
        addt    $f26,$f14,$f26
 
1380
        mult    $f1,$f18,$f14
 
1381
        addt    $f27,$f15,$f27
 
1382
        mult    $f1,$f16,$f15
 
1383
        .align 4
 
1384
 
 
1385
$L87:
 
1386
        addt    $f12,$f11,$f12
 
1387
        LD      $f22, 0*SIZE($22)
 
1388
        addt    $f25,$f13,$f25
 
1389
        LD      $f20, 1*SIZE($22)
 
1390
 
 
1391
        addt    $f26,$f14,$f26
 
1392
        LD      $f18, 2*SIZE($22)
 
1393
        addt    $f27,$f15,$f27
 
1394
        LD      $f16, 3*SIZE($22)
 
1395
 
 
1396
        mult    $f3,$f12,$f11
 
1397
        mult    $f3,$f25,$f13
 
1398
        mult    $f3,$f26,$f14
 
1399
        mult    $f3,$f27,$f15
 
1400
 
 
1401
        addt    $f22,$f11,$f12
 
1402
        addt    $f20,$f13,$f25
 
1403
        addt    $f18,$f14,$f26
 
1404
        addt    $f16,$f15,$f27
 
1405
 
 
1406
        ST      $f12, 0*SIZE($22)
 
1407
        fclr    $f11
 
1408
        ST      $f25, 1*SIZE($22)
 
1409
        fclr    $f13
 
1410
        ST      $f26, 2*SIZE($22)
 
1411
        fclr    $f14
 
1412
        ST      $f27, 3*SIZE($22)
 
1413
        fclr    $f15
 
1414
 
 
1415
        subl    $8, 1, $8               # i--
 
1416
        addq    $22, 4*SIZE, $22        # c1_offset += 4
 
1417
        bgt     $8, $L81
 
1418
        unop
 
1419
        .align 4
 
1420
 
 
1421
$L79:
 
1422
        and     $15,3,$8                # i = (min_i&3)
 
1423
        beq     $8,$L29                 # if i<=0 goto $L29
 
1424
        unop
 
1425
        unop
 
1426
        .align 4
 
1427
 
 
1428
$L96:
 
1429
        mov     $24, $2                 # a1_offset = a_offset
 
1430
        fclr    $f12
 
1431
        addq    $24, SIZE, $24          # a_offset ++
 
1432
        fclr    $f11
 
1433
 
 
1434
        mov     $0, $4                  # b1_offset = b_offset
 
1435
        mov     $7, $5                  # l = min_l
 
1436
        ble     $7,$L98                 # if l<=0 goto $L98
 
1437
        unop
 
1438
        .align 4
 
1439
 
 
1440
$L100:
 
1441
        LD      $f22, 0*SIZE($2)        # atemp1
 
1442
        LD      $f1,  0*SIZE($4)        # btemp1
 
1443
 
 
1444
        lda     $2,   4*SIZE($2)        # a1_offset += 4
 
1445
        lda     $4,   2*SIZE($4)        # b1_offset += 2
 
1446
 
 
1447
        addt    $f12,$f11,$f12
 
1448
        subl    $5,1,$5                 # l--
 
1449
        mult    $f1,$f22,$f11
 
1450
        bgt     $5,$L100                # if l>0 goto $L100
 
1451
        .align 4
 
1452
 
 
1453
$L98:
 
1454
        addt    $f12,$f11,$f12          # ctemp1 += temp1
 
1455
        mult    $f3,$f12,$f11           # temp1 = alpha*ctemp1
 
1456
        LD      $f22, 0*SIZE($22)       # atemp1 = *c1_offset
 
1457
        addt    $f22,$f11,$f12          # ctemp1 = atemp1 + temp1
 
1458
 
 
1459
        subl    $8,1,$8                 # i--
 
1460
        ST      $f12, 0*SIZE($22)       # *c1_offset = ctemp1
 
1461
        addq    $22, SIZE, $22          # c1_offset ++
 
1462
        bgt     $8,$L96                 # if i>0 goto $L98
 
1463
        .align 4
 
1464
 
 
1465
$L29:
 
1466
        lda     $11,  P($11)            # is += P
 
1467
        nop
 
1468
#ifndef C_VERSION
 
1469
        cmplt   $11,$16,$1              # is < m ?
 
1470
#else
 
1471
        cmplt   $11,$17,$1              # is < m ?
 
1472
#endif
 
1473
        bne     $1,$L30
 
1474
        .align 4
 
1475
 
 
1476
$L9:
 
1477
        lda     $14, R($14)             # js += R
 
1478
        nop
 
1479
#ifndef C_VERSION
 
1480
        cmplt   $14,$17,$1              # js < n ?
 
1481
#else
 
1482
        cmplt   $14,$16,$1              # js < n ?
 
1483
#endif
 
1484
        bne     $1,$L10
 
1485
        .align 4
 
1486
 
 
1487
$L4:
 
1488
        lda     $3, Q($3)               # ls += Q
 
1489
        clr     $14                     # js = 0
 
1490
        cmplt   $3,$18,$1               # ls < k ??
 
1491
        bne     $1,$L5
 
1492
        .align 4
 
1493
 
 
1494
$L3:
 
1495
        ldq     $26, 0($30)
 
1496
        ldq     $9,  8($30)
 
1497
        ldq     $10,16($30)
 
1498
        ldq     $11,24($30)
 
1499
        ldq     $12,32($30)
 
1500
        ldq     $13,40($30)
 
1501
        ldq     $14,48($30)
 
1502
        ldq     $15,56($30)
 
1503
        ldt     $f2,64($30)
 
1504
        ldt     $f3,72($30)
 
1505
        ldt     $f4,80($30)
 
1506
        ldt     $f5,96($30)
 
1507
        ldt     $f6,104($30)
 
1508
        ldt     $f7,112($30)
 
1509
        ldt     $f8,120($30)
 
1510
 
 
1511
        lda     $30, STACKSIZE($30)
 
1512
        clr     $0
 
1513
 
 
1514
        ret     $31,($26),1
 
1515
        .ident  VERSION
 
1516
        .end    ROUTINE
 
1517
 
 
1518
/* Finish !! */