Blame thirdparty/openblas/xianyi-OpenBLAS-e6e87a2/kernel/sparc/gemm_ncopy_2.S

kusano 2b45e8
/*********************************************************************/
kusano 2b45e8
/* Copyright 2005-2010 The University of Texas at Austin.           */
kusano 2b45e8
/* All rights reserved.                                              */
kusano 2b45e8
/*                                                                   */
kusano 2b45e8
/* Redistribution and use in source and binary forms, with or        */
kusano 2b45e8
/* without modification, are permitted provided that the following   */
kusano 2b45e8
/* conditions are met:                                               */
kusano 2b45e8
/*                                                                   */
kusano 2b45e8
/*   1. Redistributions of source code must retain the above         */
kusano 2b45e8
/*      copyright notice, this list of conditions and the following  */
kusano 2b45e8
/*      disclaimer.                                                  */
kusano 2b45e8
/*                                                                   */
kusano 2b45e8
/*   2. Redistributions in binary form must reproduce the above      */
kusano 2b45e8
/*      copyright notice, this list of conditions and the following  */
kusano 2b45e8
/*      disclaimer in the documentation and/or other materials       */
kusano 2b45e8
/*      provided with the distribution.                              */
kusano 2b45e8
/*                                                                   */
kusano 2b45e8
/*    THIS  SOFTWARE IS PROVIDED  BY THE  UNIVERSITY OF  TEXAS AT    */
kusano 2b45e8
/*    AUSTIN  ``AS IS''  AND ANY  EXPRESS OR  IMPLIED WARRANTIES,    */
kusano 2b45e8
/*    INCLUDING, BUT  NOT LIMITED  TO, THE IMPLIED  WARRANTIES OF    */
kusano 2b45e8
/*    MERCHANTABILITY  AND FITNESS FOR  A PARTICULAR  PURPOSE ARE    */
kusano 2b45e8
/*    DISCLAIMED.  IN  NO EVENT SHALL THE UNIVERSITY  OF TEXAS AT    */
kusano 2b45e8
/*    AUSTIN OR CONTRIBUTORS BE  LIABLE FOR ANY DIRECT, INDIRECT,    */
kusano 2b45e8
/*    INCIDENTAL,  SPECIAL, EXEMPLARY,  OR  CONSEQUENTIAL DAMAGES    */
kusano 2b45e8
/*    (INCLUDING, BUT  NOT LIMITED TO,  PROCUREMENT OF SUBSTITUTE    */
kusano 2b45e8
/*    GOODS  OR  SERVICES; LOSS  OF  USE,  DATA,  OR PROFITS;  OR    */
kusano 2b45e8
/*    BUSINESS INTERRUPTION) HOWEVER CAUSED  AND ON ANY THEORY OF    */
kusano 2b45e8
/*    LIABILITY, WHETHER  IN CONTRACT, STRICT  LIABILITY, OR TORT    */
kusano 2b45e8
/*    (INCLUDING NEGLIGENCE OR OTHERWISE)  ARISING IN ANY WAY OUT    */
kusano 2b45e8
/*    OF  THE  USE OF  THIS  SOFTWARE,  EVEN  IF ADVISED  OF  THE    */
kusano 2b45e8
/*    POSSIBILITY OF SUCH DAMAGE.                                    */
kusano 2b45e8
/*                                                                   */
kusano 2b45e8
/* The views and conclusions contained in the software and           */
kusano 2b45e8
/* documentation are those of the authors and should not be          */
kusano 2b45e8
/* interpreted as representing official policies, either expressed   */
kusano 2b45e8
/* or implied, of The University of Texas at Austin.                 */
kusano 2b45e8
/*********************************************************************/
kusano 2b45e8
kusano 2b45e8
#define ASSEMBLER
kusano 2b45e8
#include "common.h"
kusano 2b45e8
kusano 2b45e8
#define  PREFETCHSIZE 72
kusano 2b45e8
#define WPREFETCHSIZE 20
kusano 2b45e8
kusano 2b45e8
#define M	%i0
kusano 2b45e8
#define N	%i1
kusano 2b45e8
#define A	%i2
kusano 2b45e8
#define LDA	%i3
kusano 2b45e8
#define B	%i4
kusano 2b45e8
kusano 2b45e8
#define A1	%l0
kusano 2b45e8
#define A2	%l1
kusano 2b45e8
#define A3	%l2
kusano 2b45e8
#define A4	%l3
kusano 2b45e8
kusano 2b45e8
#define I	%l4
kusano 2b45e8
#define J	%l5
kusano 2b45e8
kusano 2b45e8
#ifdef DOUBLE
kusano 2b45e8
#define c01	%f0
kusano 2b45e8
#define c02	%f2
kusano 2b45e8
#define c03	%f4
kusano 2b45e8
#define c04	%f6
kusano 2b45e8
#define c05	%f8
kusano 2b45e8
#define c06	%f10
kusano 2b45e8
#define c07	%f12
kusano 2b45e8
#define c08	%f14
kusano 2b45e8
#define c09	%f16
kusano 2b45e8
#define c10	%f18
kusano 2b45e8
#define c11	%f20
kusano 2b45e8
#define c12	%f22
kusano 2b45e8
#define c13	%f24
kusano 2b45e8
#define c14	%f26
kusano 2b45e8
#define c15	%f28
kusano 2b45e8
#define c16	%f30
kusano 2b45e8
#else
kusano 2b45e8
#define c01	%f0
kusano 2b45e8
#define c02	%f1
kusano 2b45e8
#define c03	%f2
kusano 2b45e8
#define c04	%f3
kusano 2b45e8
#define c05	%f4
kusano 2b45e8
#define c06	%f5
kusano 2b45e8
#define c07	%f6
kusano 2b45e8
#define c08	%f7
kusano 2b45e8
#define c09	%f8
kusano 2b45e8
#define c10	%f9
kusano 2b45e8
#define c11	%f10
kusano 2b45e8
#define c12	%f11
kusano 2b45e8
#define c13	%f12
kusano 2b45e8
#define c14	%f13
kusano 2b45e8
#define c15	%f14
kusano 2b45e8
#define c16	%f15
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	PROLOGUE
kusano 2b45e8
	SAVESP
kusano 2b45e8
kusano 2b45e8
	sra	N, 1, J
kusano 2b45e8
	cmp	J, 0
kusano 2b45e8
	ble,pn	%icc, .LL100
kusano 2b45e8
	sll	LDA, BASE_SHIFT, LDA
kusano 2b45e8
kusano 2b45e8
.LL11:
kusano 2b45e8
	add	A,  LDA, A2
kusano 2b45e8
	mov	A,  A1
kusano 2b45e8
	sra	M, 3, I
kusano 2b45e8
	cmp	I, 0
kusano 2b45e8
kusano 2b45e8
	ble,pn	%icc, .LL15
kusano 2b45e8
	add	A2, LDA, A
kusano 2b45e8
kusano 2b45e8
.LL12:
kusano 2b45e8
	prefetch [A1 + (PREFETCHSIZE + 0) * SIZE], 0
kusano 2b45e8
	LDF	[A1 +  0 * SIZE], c01
kusano 2b45e8
	LDF	[A2 +  0 * SIZE], c02
kusano 2b45e8
	LDF	[A1 +  1 * SIZE], c03
kusano 2b45e8
	LDF	[A2 +  1 * SIZE], c04
kusano 2b45e8
	LDF	[A1 +  2 * SIZE], c05
kusano 2b45e8
	LDF	[A2 +  2 * SIZE], c06
kusano 2b45e8
	LDF	[A1 +  3 * SIZE], c07
kusano 2b45e8
	LDF	[A2 +  3 * SIZE], c08
kusano 2b45e8
kusano 2b45e8
	prefetch [A2 + (PREFETCHSIZE + 0) * SIZE], 0
kusano 2b45e8
	LDF	[A1 +  4 * SIZE], c09
kusano 2b45e8
	LDF	[A2 +  4 * SIZE], c10
kusano 2b45e8
	LDF	[A1 +  5 * SIZE], c11
kusano 2b45e8
	LDF	[A2 +  5 * SIZE], c12
kusano 2b45e8
	LDF	[A1 +  6 * SIZE], c13
kusano 2b45e8
	LDF	[A2 +  6 * SIZE], c14
kusano 2b45e8
	LDF	[A1 +  7 * SIZE], c15
kusano 2b45e8
	LDF	[A2 +  7 * SIZE], c16
kusano 2b45e8
kusano 2b45e8
	add	A1,  8 * SIZE, A1
kusano 2b45e8
	add	I, -1, I
kusano 2b45e8
	add	A2,  8 * SIZE, A2
kusano 2b45e8
	cmp	I, 0
kusano 2b45e8
kusano 2b45e8
	prefetch [B + (WPREFETCHSIZE + 0) * SIZE], 2
kusano 2b45e8
	STF	c01, [B +  0 * SIZE]
kusano 2b45e8
	STF	c02, [B +  1 * SIZE]
kusano 2b45e8
	STF	c03, [B +  2 * SIZE]
kusano 2b45e8
	STF	c04, [B +  3 * SIZE]
kusano 2b45e8
	STF	c05, [B +  4 * SIZE]
kusano 2b45e8
	STF	c06, [B +  5 * SIZE]
kusano 2b45e8
	STF	c07, [B +  6 * SIZE]
kusano 2b45e8
	STF	c08, [B +  7 * SIZE]
kusano 2b45e8
kusano 2b45e8
	prefetch [B + (WPREFETCHSIZE + 8) * SIZE], 2
kusano 2b45e8
	STF	c09, [B +  8 * SIZE]
kusano 2b45e8
	STF	c10, [B +  9 * SIZE]
kusano 2b45e8
	STF	c11, [B + 10 * SIZE]
kusano 2b45e8
	STF	c12, [B + 11 * SIZE]
kusano 2b45e8
	STF	c13, [B + 12 * SIZE]
kusano 2b45e8
	STF	c14, [B + 13 * SIZE]
kusano 2b45e8
	STF	c15, [B + 14 * SIZE]
kusano 2b45e8
	STF	c16, [B + 15 * SIZE]
kusano 2b45e8
kusano 2b45e8
	bg,pt	%icc, .LL12
kusano 2b45e8
	add	B, 16 * SIZE, B
kusano 2b45e8
kusano 2b45e8
.LL15:
kusano 2b45e8
	and	M, 7, I
kusano 2b45e8
	cmp	I, 0
kusano 2b45e8
	ble,pn	%icc, .LL99
kusano 2b45e8
	nop
kusano 2b45e8
kusano 2b45e8
.LL16:
kusano 2b45e8
	LDF	[A1 +  0 * SIZE], c01
kusano 2b45e8
	add	A1,  1 * SIZE, A1
kusano 2b45e8
	LDF	[A2 +  0 * SIZE], c02
kusano 2b45e8
	add	A2,  1 * SIZE, A2
kusano 2b45e8
kusano 2b45e8
	STF	c01, [B +  0 * SIZE]
kusano 2b45e8
	add	I, -1, I
kusano 2b45e8
	STF	c02, [B +  1 * SIZE]
kusano 2b45e8
	cmp	I, 0
kusano 2b45e8
	bg,pt	%icc, .LL16
kusano 2b45e8
	add	B,   2 * SIZE, B
kusano 2b45e8
kusano 2b45e8
.LL99:
kusano 2b45e8
	add	J, -1, J
kusano 2b45e8
	cmp	J, 0
kusano 2b45e8
	bg,pt	%icc, .LL11
kusano 2b45e8
	nop
kusano 2b45e8
kusano 2b45e8
.LL100:
kusano 2b45e8
	and	N, 1, J
kusano 2b45e8
	cmp	J, 0
kusano 2b45e8
	ble,pn	%icc, .LL999
kusano 2b45e8
	nop
kusano 2b45e8
kusano 2b45e8
.LL111:
kusano 2b45e8
	sra	M, 2, I
kusano 2b45e8
	cmp	I, 0
kusano 2b45e8
	ble,pn	%icc, .LL115
kusano 2b45e8
	mov	A,  A1
kusano 2b45e8
kusano 2b45e8
.LL112:
kusano 2b45e8
	LDF	[A1 +  0 * SIZE], c01
kusano 2b45e8
	LDF	[A1 +  1 * SIZE], c02
kusano 2b45e8
	LDF	[A1 +  2 * SIZE], c03
kusano 2b45e8
	LDF	[A1 +  3 * SIZE], c04
kusano 2b45e8
kusano 2b45e8
	STF	c01, [B +  0 * SIZE]
kusano 2b45e8
	add	I, -1, I
kusano 2b45e8
	STF	c02, [B +  1 * SIZE]
kusano 2b45e8
	cmp	I, 0
kusano 2b45e8
	STF	c03, [B +  2 * SIZE]
kusano 2b45e8
	add	A1,  4 * SIZE, A1
kusano 2b45e8
	STF	c04, [B +  3 * SIZE]
kusano 2b45e8
kusano 2b45e8
	bg,pt	%icc, .LL112
kusano 2b45e8
	add	B,   4 * SIZE, B
kusano 2b45e8
kusano 2b45e8
.LL115:
kusano 2b45e8
	and	M, 3, I
kusano 2b45e8
	cmp	I, 0
kusano 2b45e8
	ble,pn	%icc, .LL999
kusano 2b45e8
	nop
kusano 2b45e8
kusano 2b45e8
.LL116:
kusano 2b45e8
	LDF	[A1 +  0 * SIZE], c01
kusano 2b45e8
	add	A1,  1 * SIZE, A1
kusano 2b45e8
	add	I, -1, I
kusano 2b45e8
	cmp	I, 0
kusano 2b45e8
kusano 2b45e8
	STF	c01, [B +  0 * SIZE]
kusano 2b45e8
	bg,pt	%icc, .LL116
kusano 2b45e8
	add	B,   1 * SIZE, B
kusano 2b45e8
kusano 2b45e8
.LL999:
kusano 2b45e8
	return	%i7 + 8
kusano 2b45e8
	clr	%o0
kusano 2b45e8
kusano 2b45e8
	EPILOGUE