File: gemm_beta.S

package info (click to toggle)
openblas 0.3.5%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 46,800 kB
  • sloc: asm: 1,110,696; ansic: 216,025; fortran: 74,466; makefile: 11,282; perl: 3,991; python: 661; sh: 152
file content (179 lines) | stat: -rw-r--r-- 4,754 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/*********************************************************************/
/* Copyright 2009, 2010 The University of Texas at Austin.           */
/* All rights reserved.                                              */
/*                                                                   */
/* Redistribution and use in source and binary forms, with or        */
/* without modification, are permitted provided that the following   */
/* conditions are met:                                               */
/*                                                                   */
/*   1. Redistributions of source code must retain the above         */
/*      copyright notice, this list of conditions and the following  */
/*      disclaimer.                                                  */
/*                                                                   */
/*   2. Redistributions in binary form must reproduce the above      */
/*      copyright notice, this list of conditions and the following  */
/*      disclaimer in the documentation and/or other materials       */
/*      provided with the distribution.                              */
/*                                                                   */
/*    THIS  SOFTWARE IS PROVIDED  BY THE  UNIVERSITY OF  TEXAS AT    */
/*    AUSTIN  ``AS IS''  AND ANY  EXPRESS OR  IMPLIED WARRANTIES,    */
/*    INCLUDING, BUT  NOT LIMITED  TO, THE IMPLIED  WARRANTIES OF    */
/*    MERCHANTABILITY  AND FITNESS FOR  A PARTICULAR  PURPOSE ARE    */
/*    DISCLAIMED.  IN  NO EVENT SHALL THE UNIVERSITY  OF TEXAS AT    */
/*    AUSTIN OR CONTRIBUTORS BE  LIABLE FOR ANY DIRECT, INDIRECT,    */
/*    INCIDENTAL,  SPECIAL, EXEMPLARY,  OR  CONSEQUENTIAL DAMAGES    */
/*    (INCLUDING, BUT  NOT LIMITED TO,  PROCUREMENT OF SUBSTITUTE    */
/*    GOODS  OR  SERVICES; LOSS  OF  USE,  DATA,  OR PROFITS;  OR    */
/*    BUSINESS INTERRUPTION) HOWEVER CAUSED  AND ON ANY THEORY OF    */
/*    LIABILITY, WHETHER  IN CONTRACT, STRICT  LIABILITY, OR TORT    */
/*    (INCLUDING NEGLIGENCE OR OTHERWISE)  ARISING IN ANY WAY OUT    */
/*    OF  THE  USE OF  THIS  SOFTWARE,  EVEN  IF ADVISED  OF  THE    */
/*    POSSIBILITY OF SUCH DAMAGE.                                    */
/*                                                                   */
/* The views and conclusions contained in the software and           */
/* documentation are those of the authors and should not be          */
/* interpreted as representing official policies, either expressed   */
/* or implied, of The University of Texas at Austin.                 */
/*********************************************************************/

#define ASSEMBLER
#include "common.h"
#include "version.h"

	.set noat
	.set noreorder
.text
	.align 5
	.globl	CNAME
	.ent	CNAME
CNAME:
	.frame	$sp, 0, $26, 0

#ifdef PROFILE
	ldgp	$gp, 0($27)
	lda	$28, _mcount
	jsr	$28, ($28), _mcount
#endif

	ldq	$18,   16($sp)
	ble	$16, $End
	ldl	$19,   24($sp)
	ble	$17, $End
#ifndef PROFILE
	.prologue 0
#else
	.prologue 1
#endif

	fbeq	$f19, $BETA_EQ_ZERO		# if (beta == ZERO)
	.align 4

$BETA_NE_ZERO:
	sra	$16, 3,  $2		# i = (m >> 3)
 	mov	$18, $1			# c_offset = c
	lda	$17,  -1($17)		# j --
	ble	$2,$L52
	.align 4

$L51:
	lds	$f31,  64($1)
	lda	$2,    -1($2)

	LD	$f14, 0*SIZE($1)
	LD	$f15, 1*SIZE($1)
	LD	$f16, 2*SIZE($1)
	LD	$f17, 3*SIZE($1)
	LD	$f18, 4*SIZE($1)
	LD	$f11, 5*SIZE($1)
	LD	$f21, 6*SIZE($1)
	LD	$f22, 7*SIZE($1)

	MUL	$f19, $f14, $f23
	MUL	$f19, $f15, $f24
	MUL	$f19, $f16, $f25
	MUL	$f19, $f17, $f26
	MUL	$f19, $f18, $f27
	MUL	$f19, $f11, $f28
	MUL	$f19, $f21, $f29
	MUL	$f19, $f22, $f30

	ST	$f23, 0*SIZE($1)
	ST	$f24, 1*SIZE($1)
	ST	$f25, 2*SIZE($1)
	ST	$f26, 3*SIZE($1)
	ST	$f27, 4*SIZE($1)
	ST	$f28, 5*SIZE($1)
	ST	$f29, 6*SIZE($1)
	ST	$f30, 7*SIZE($1)

	lda	$1,8*SIZE($1)
	bgt	$2,$L51
	.align 4

$L52:
	and	$16, 7,  $2
	ble	$2,$L54
	.align	4

$L53:
	LD	$f12,   0($1)
	lda	$2,    -1($2)
	MUL	$f19, $f12, $f23
	ST	$f23,   0($1)
	lda	$1,  SIZE($1)
	bgt	$2,$L53
	.align 4

$L54:
	SXADDQ	$19, $18, $18		# c += ldc
	bgt	$17,$BETA_NE_ZERO
	clr	$0
	ret
	.align 4

$BETA_EQ_ZERO:
	sra	$16, 3,  $2		# i = (m >> 3)
	lda	$4,  8*SIZE($18)
 	mov	$18, $1			# c_offset = c
	lda	$17,  -1($17)		# j --
	ble	$2,$L42
	.align 4

$L41:
	ST	$f31, 0*SIZE($1)
	ST	$f31, 1*SIZE($1)
	ST	$f31, 2*SIZE($1)
	ST	$f31, 3*SIZE($1)
	ST	$f31, 4*SIZE($1)
	ST	$f31, 5*SIZE($1)
	ST	$f31, 6*SIZE($1)
	ST	$f31, 7*SIZE($1)
	lda	$2,    -1($2)

	lda	$4,   8*SIZE($4)
	lda	$1,  8*SIZE($1)
	bgt	$2,$L41
	.align 4

$L42:
	and	$16, 7,  $2
	ble	$2,$L44
	.align	4

$L43:
	lda	$2,    -1($2)
	ST	$f31,   0($1)
	lda	$1,  SIZE($1)
	bgt	$2, $L43
	.align 4

$L44:
	SXADDQ	$19, $18, $18		# c += ldc
	bgt	$17,$BETA_EQ_ZERO
	clr	$0
	.align 4

$End:
	ret
	.ident	VERSION
	.end CNAME