Blame thirdparty/openblas/xianyi-OpenBLAS-e6e87a2/kernel/mips64/zsymv_U.S

kusano 2b45e8
/*********************************************************************/
kusano 2b45e8
/* Copyright 2009, 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 M	$4
kusano 2b45e8
#define A	$7
kusano 2b45e8
#define LDA	$8
kusano 2b45e8
#define X	$9
kusano 2b45e8
#define INCX	$10
kusano 2b45e8
#define Y	$11
kusano 2b45e8
#define INCY	$5
kusano 2b45e8
#define BUFFER	$6
kusano 2b45e8
kusano 2b45e8
#define XX	$12
kusano 2b45e8
#define YY	$13
kusano 2b45e8
kusano 2b45e8
#define I	$14
kusano 2b45e8
#define IS	$15
kusano 2b45e8
kusano 2b45e8
#define AO1	$16
kusano 2b45e8
#define AO2	$17
kusano 2b45e8
kusano 2b45e8
#define Y1	$18
kusano 2b45e8
#define TEMP	$19
kusano 2b45e8
kusano 2b45e8
#define ALPHA_R	$f13
kusano 2b45e8
#define ALPHA_I	$f14
kusano 2b45e8
kusano 2b45e8
#define a1	$f0
kusano 2b45e8
#define a2	$f1
kusano 2b45e8
#define a3	$f2
kusano 2b45e8
#define a4	$f3
kusano 2b45e8
#define a5	$f4
kusano 2b45e8
#define a6	$f5
kusano 2b45e8
#define a7	$f6
kusano 2b45e8
#define a8	$f7
kusano 2b45e8
kusano 2b45e8
#define alpha1	$f8
kusano 2b45e8
#define alpha2	$f9
kusano 2b45e8
#define alpha3	$f10
kusano 2b45e8
#define alpha4	$f11
kusano 2b45e8
kusano 2b45e8
#define x1	$f12
kusano 2b45e8
#define x2	$f15
kusano 2b45e8
#define x3	$f16
kusano 2b45e8
#define x4	$f17
kusano 2b45e8
kusano 2b45e8
#define xsum1	$f18
kusano 2b45e8
#define xsum2	$f19
kusano 2b45e8
#define xsum3	$f20
kusano 2b45e8
#define xsum4	$f21
kusano 2b45e8
kusano 2b45e8
#define ysum1	$f22
kusano 2b45e8
#define ysum2	$f23
kusano 2b45e8
#define ysum3	$f24
kusano 2b45e8
#define ysum4	$f25
kusano 2b45e8
kusano 2b45e8
#ifndef HEMV
kusano 2b45e8
#define ADD1	NMSUB
kusano 2b45e8
#define ADD2	MADD
kusano 2b45e8
#else
kusano 2b45e8
#define ADD1	MADD
kusano 2b45e8
#define ADD2	NMSUB
kusano 2b45e8
#endif
kusano 2b45e8
	
kusano 2b45e8
	PROLOGUE
kusano 2b45e8
	
kusano 2b45e8
	LDARG	INCY,    0($sp)
kusano 2b45e8
	LDARG	BUFFER,  8($sp)
kusano 2b45e8
#ifdef __64BIT__
kusano 2b45e8
	daddiu	$sp, $sp, -64
kusano 2b45e8
#else
kusano 2b45e8
	daddiu	$sp, $sp, -80
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	SDARG	$16,   0($sp)
kusano 2b45e8
	dsll	LDA,  LDA,  ZBASE_SHIFT
kusano 2b45e8
	SDARG	$17,   8($sp)
kusano 2b45e8
	dsll	INCX, INCX, ZBASE_SHIFT
kusano 2b45e8
	SDARG	$18,  16($sp)
kusano 2b45e8
	dsll	INCY, INCY, ZBASE_SHIFT
kusano 2b45e8
	SDARG	$19,  24($sp)
kusano 2b45e8
	nop
kusano 2b45e8
kusano 2b45e8
	sdc1	$f24, 32($sp)
kusano 2b45e8
	sdc1	$f25, 40($sp)
kusano 2b45e8
kusano 2b45e8
#ifndef __64BIT__
kusano 2b45e8
	sdc1	$f20, 48($sp)
kusano 2b45e8
	sdc1	$f21, 56($sp)
kusano 2b45e8
	sdc1	$f22, 64($sp)
kusano 2b45e8
	sdc1	$f23, 72($sp)
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	blez	M, .L999
kusano 2b45e8
	li	IS, 2 * SIZE
kusano 2b45e8
kusano 2b45e8
	beq	IS, INCX, .L05
kusano 2b45e8
	move	Y1, Y
kusano 2b45e8
kusano 2b45e8
	dsra	I,  M, 2
kusano 2b45e8
	move	XX, X
kusano 2b45e8
kusano 2b45e8
	blez	I, .L02
kusano 2b45e8
	move	X,  BUFFER
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L01:
kusano 2b45e8
	LD	a1, 0 * SIZE(XX)
kusano 2b45e8
	LD	a2, 1 * SIZE(XX)
kusano 2b45e8
	daddu	XX, XX, INCX
kusano 2b45e8
	LD	a3, 0 * SIZE(XX)
kusano 2b45e8
	LD	a4, 1 * SIZE(XX)
kusano 2b45e8
	daddu	XX, XX, INCX
kusano 2b45e8
	LD	a5, 0 * SIZE(XX)
kusano 2b45e8
	LD	a6, 1 * SIZE(XX)
kusano 2b45e8
	daddu	XX, XX, INCX
kusano 2b45e8
	LD	a7, 0 * SIZE(XX)
kusano 2b45e8
	LD	a8, 1 * SIZE(XX)
kusano 2b45e8
	daddu	XX, XX, INCX
kusano 2b45e8
kusano 2b45e8
	ST	a1, 0 * SIZE(BUFFER)
kusano 2b45e8
	ST	a2, 1 * SIZE(BUFFER)
kusano 2b45e8
	ST	a3, 2 * SIZE(BUFFER)
kusano 2b45e8
	ST	a4, 3 * SIZE(BUFFER)
kusano 2b45e8
	ST	a5, 4 * SIZE(BUFFER)
kusano 2b45e8
	ST	a6, 5 * SIZE(BUFFER)
kusano 2b45e8
	ST	a7, 6 * SIZE(BUFFER)
kusano 2b45e8
	ST	a8, 7 * SIZE(BUFFER)
kusano 2b45e8
kusano 2b45e8
	daddiu	I, I, -1
kusano 2b45e8
kusano 2b45e8
	bgtz	I, .L01
kusano 2b45e8
	daddiu	BUFFER, BUFFER, 8 * SIZE
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L02:
kusano 2b45e8
	andi	I,  M, 3
kusano 2b45e8
	blez	I, .L05
kusano 2b45e8
	NOP
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L03:
kusano 2b45e8
	LD	a1, 0 * SIZE(XX)
kusano 2b45e8
	LD	a2, 1 * SIZE(XX)
kusano 2b45e8
	daddu	XX, XX, INCX
kusano 2b45e8
kusano 2b45e8
	ST	a1, 0 * SIZE(BUFFER)
kusano 2b45e8
	ST	a2, 1 * SIZE(BUFFER)
kusano 2b45e8
	daddiu	I, I, -1
kusano 2b45e8
kusano 2b45e8
	bgtz	I, .L03
kusano 2b45e8
	daddiu	BUFFER, BUFFER, 2 * SIZE
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L05:
kusano 2b45e8
	beq	IS, INCY, .L10
kusano 2b45e8
	daddiu	BUFFER, BUFFER, 255
kusano 2b45e8
kusano 2b45e8
	li	TEMP, -256
kusano 2b45e8
	and	BUFFER, BUFFER, TEMP
kusano 2b45e8
kusano 2b45e8
	dsra	I,  M, 2
kusano 2b45e8
	move	Y1, BUFFER
kusano 2b45e8
kusano 2b45e8
	blez	I, .L07
kusano 2b45e8
	move	YY, Y
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L06:
kusano 2b45e8
	LD	a1, 0 * SIZE(YY)
kusano 2b45e8
	LD	a2, 1 * SIZE(YY)
kusano 2b45e8
	daddu	YY, YY, INCY
kusano 2b45e8
	LD	a3, 0 * SIZE(YY)
kusano 2b45e8
	LD	a4, 1 * SIZE(YY)
kusano 2b45e8
	daddu	YY, YY, INCY
kusano 2b45e8
	LD	a5, 0 * SIZE(YY)
kusano 2b45e8
	LD	a6, 1 * SIZE(YY)
kusano 2b45e8
	daddu	YY, YY, INCY
kusano 2b45e8
	LD	a7, 0 * SIZE(YY)
kusano 2b45e8
	LD	a8, 1 * SIZE(YY)
kusano 2b45e8
	daddu	YY, YY, INCY
kusano 2b45e8
kusano 2b45e8
	ST	a1, 0 * SIZE(BUFFER)
kusano 2b45e8
	ST	a2, 1 * SIZE(BUFFER)
kusano 2b45e8
	ST	a3, 2 * SIZE(BUFFER)
kusano 2b45e8
	ST	a4, 3 * SIZE(BUFFER)
kusano 2b45e8
	ST	a5, 4 * SIZE(BUFFER)
kusano 2b45e8
	ST	a6, 5 * SIZE(BUFFER)
kusano 2b45e8
	ST	a7, 6 * SIZE(BUFFER)
kusano 2b45e8
	ST	a8, 7 * SIZE(BUFFER)
kusano 2b45e8
	daddiu	I, I, -1
kusano 2b45e8
kusano 2b45e8
	bgtz	I, .L06
kusano 2b45e8
	daddiu	BUFFER, BUFFER, 8 * SIZE
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L07:
kusano 2b45e8
	andi	I,  M, 3
kusano 2b45e8
	blez	I, .L10
kusano 2b45e8
	NOP
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L08:
kusano 2b45e8
	LD	a1, 0 * SIZE(YY)
kusano 2b45e8
	LD	a2, 1 * SIZE(YY)
kusano 2b45e8
	daddu	YY, YY, INCY
kusano 2b45e8
kusano 2b45e8
	ST	a1, 0 * SIZE(BUFFER)
kusano 2b45e8
	ST	a2, 1 * SIZE(BUFFER)
kusano 2b45e8
	daddiu	I, I, -1
kusano 2b45e8
kusano 2b45e8
	bgtz	I, .L08
kusano 2b45e8
	daddiu	BUFFER, BUFFER, 2 * SIZE
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L10:
kusano 2b45e8
	slti	TEMP, M, 2
kusano 2b45e8
	nop
kusano 2b45e8
kusano 2b45e8
	bgtz	TEMP, .L20
kusano 2b45e8
	li	IS, 0
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L11:
kusano 2b45e8
	dsll	TEMP,  IS,  ZBASE_SHIFT
kusano 2b45e8
	daddu	TEMP, X, TEMP
kusano 2b45e8
kusano 2b45e8
	LD	x1, 0 * SIZE(TEMP)
kusano 2b45e8
	LD	x2, 1 * SIZE(TEMP)
kusano 2b45e8
	LD	x3, 2 * SIZE(TEMP)
kusano 2b45e8
	LD	x4, 3 * SIZE(TEMP)
kusano 2b45e8
kusano 2b45e8
	MTC	$0,  xsum1
kusano 2b45e8
	MTC	$0,  xsum2
kusano 2b45e8
	MTC	$0,  xsum3
kusano 2b45e8
	MTC	$0,  xsum4
kusano 2b45e8
kusano 2b45e8
	MUL	alpha1, ALPHA_R, x1
kusano 2b45e8
	move	AO1, A
kusano 2b45e8
	MUL	alpha2, ALPHA_I, x1
kusano 2b45e8
	dsra	I,  IS, 1
kusano 2b45e8
	MUL	alpha3, ALPHA_R, x3
kusano 2b45e8
	daddu	AO2, A,   LDA
kusano 2b45e8
	MUL	alpha4, ALPHA_I, x3
kusano 2b45e8
	daddu	A,   AO2, LDA
kusano 2b45e8
kusano 2b45e8
	NMSUB	alpha1, alpha1, ALPHA_I, x2
kusano 2b45e8
	move	XX, X
kusano 2b45e8
	MADD	alpha2, alpha2, ALPHA_R, x2
kusano 2b45e8
	move	YY, Y1
kusano 2b45e8
	NMSUB	alpha3, alpha3, ALPHA_I, x4
kusano 2b45e8
	MADD	alpha4, alpha4, ALPHA_R, x4
kusano 2b45e8
kusano 2b45e8
	blez	I, .L15
kusano 2b45e8
	daddiu	I, I, -1
kusano 2b45e8
kusano 2b45e8
	LD	x1, 0 * SIZE(XX)
kusano 2b45e8
	LD	x2, 1 * SIZE(XX)
kusano 2b45e8
	LD	x4, 3 * SIZE(XX)
kusano 2b45e8
kusano 2b45e8
	LD	a1, 0 * SIZE(AO1)
kusano 2b45e8
	LD	a2, 1 * SIZE(AO1)
kusano 2b45e8
	LD	a3, 2 * SIZE(AO1)
kusano 2b45e8
	LD	a4, 3 * SIZE(AO1)
kusano 2b45e8
kusano 2b45e8
	LD	a5, 0 * SIZE(AO2)
kusano 2b45e8
	LD	a6, 1 * SIZE(AO2)
kusano 2b45e8
	LD	a7, 2 * SIZE(AO2)
kusano 2b45e8
	LD	a8, 3 * SIZE(AO2)
kusano 2b45e8
kusano 2b45e8
	LD	ysum1, 0 * SIZE(YY)
kusano 2b45e8
kusano 2b45e8
	blez	I, .L13
kusano 2b45e8
	LD	ysum2, 1 * SIZE(YY)
kusano 2b45e8
	.align	3
kusano 2b45e8
kusano 2b45e8
.L12:
kusano 2b45e8
	MADD	ysum1, ysum1, alpha1, a1
kusano 2b45e8
	LD	ysum3, 2 * SIZE(YY)
kusano 2b45e8
	MADD	ysum2, ysum2, alpha2, a1
kusano 2b45e8
	LD	ysum4, 3 * SIZE(YY)
kusano 2b45e8
	MADD	xsum1, xsum1, x1, a1
kusano 2b45e8
	LD	a8, 3 * SIZE(AO2)
kusano 2b45e8
	MADD	xsum2, xsum2, x2, a1
kusano 2b45e8
	LD	a1, 4 * SIZE(AO1)
kusano 2b45e8
kusano 2b45e8
	MADD	ysum3, ysum3, alpha1, a3
kusano 2b45e8
	LD	x3, 2 * SIZE(XX)
kusano 2b45e8
	MADD	ysum4, ysum4, alpha2, a3
kusano 2b45e8
	daddiu	I, I, -1
kusano 2b45e8
	MADD	xsum3, xsum3, x1, a5
kusano 2b45e8
	MADD	xsum4, xsum4, x2, a5
kusano 2b45e8
kusano 2b45e8
	NMSUB	ysum1, ysum1, alpha2, a2
kusano 2b45e8
	MADD	ysum2, ysum2, alpha1, a2
kusano 2b45e8
	ADD1	xsum1, xsum1, x2, a2
kusano 2b45e8
	daddiu	AO2, AO2, 4 * SIZE
kusano 2b45e8
	ADD2	xsum2, xsum2, x1, a2
kusano 2b45e8
	LD	a2, 5 * SIZE(AO1)
kusano 2b45e8
kusano 2b45e8
	NMSUB	ysum3, ysum3, alpha2, a4
kusano 2b45e8
	MADD	ysum4, ysum4, alpha1, a4
kusano 2b45e8
	ADD1	xsum3, xsum3, x2, a6
kusano 2b45e8
	LD	x2, 5 * SIZE(XX)
kusano 2b45e8
	ADD2	xsum4, xsum4, x1, a6
kusano 2b45e8
	LD	x1, 4 * SIZE(XX)
kusano 2b45e8
kusano 2b45e8
	MADD	ysum1, ysum1, alpha3, a5
kusano 2b45e8
	MADD	ysum2, ysum2, alpha4, a5
kusano 2b45e8
	MADD	xsum1, xsum1, x3, a3
kusano 2b45e8
	LD	a5, 0 * SIZE(AO2)
kusano 2b45e8
	MADD	xsum2, xsum2, x4, a3
kusano 2b45e8
	LD	a3, 6 * SIZE(AO1)
kusano 2b45e8
kusano 2b45e8
	MADD	ysum3, ysum3, alpha3, a7
kusano 2b45e8
	MADD	ysum4, ysum4, alpha4, a7
kusano 2b45e8
	MADD	xsum3, xsum3, x3, a7
kusano 2b45e8
	daddiu	AO1, AO1, 4 * SIZE
kusano 2b45e8
	MADD	xsum4, xsum4, x4, a7
kusano 2b45e8
	LD	a7, 2 * SIZE(AO2)
kusano 2b45e8
kusano 2b45e8
	NMSUB	ysum1, ysum1, alpha4, a6
kusano 2b45e8
	daddiu	XX,  XX,  4 * SIZE
kusano 2b45e8
	MADD	ysum2, ysum2, alpha3, a6
kusano 2b45e8
	LD	a6, 1 * SIZE(AO2)
kusano 2b45e8
	ADD1	xsum1, xsum1, x4, a4
kusano 2b45e8
	daddiu	YY,  YY,  4 * SIZE
kusano 2b45e8
	ADD2	xsum2, xsum2, x3, a4
kusano 2b45e8
	LD	a4, 3 * SIZE(AO1)
kusano 2b45e8
kusano 2b45e8
	NMSUB	ysum3, ysum3, alpha4, a8
kusano 2b45e8
	ST	ysum1,-4 * SIZE(YY)
kusano 2b45e8
	MADD	ysum4, ysum4, alpha3, a8
kusano 2b45e8
	ST	ysum2,-3 * SIZE(YY)
kusano 2b45e8
kusano 2b45e8
	LD	ysum1, 0 * SIZE(YY)
kusano 2b45e8
	LD	ysum2, 1 * SIZE(YY)
kusano 2b45e8
kusano 2b45e8
	ADD1	xsum3, xsum3, x4, a8
kusano 2b45e8
	LD	x4, 3 * SIZE(XX)
kusano 2b45e8
	ADD2	xsum4, xsum4, x3, a8
kusano 2b45e8
kusano 2b45e8
	ST	ysum3,-2 * SIZE(YY)
kusano 2b45e8
	bgtz	I, .L12
kusano 2b45e8
	ST	ysum4,-1 * SIZE(YY)
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L13:
kusano 2b45e8
	MADD	ysum1, ysum1, alpha1, a1
kusano 2b45e8
	LD	ysum3, 2 * SIZE(YY)
kusano 2b45e8
	MADD	ysum2, ysum2, alpha2, a1
kusano 2b45e8
	LD	ysum4, 3 * SIZE(YY)
kusano 2b45e8
	MADD	xsum1, xsum1, x1, a1
kusano 2b45e8
	LD	a8, 3 * SIZE(AO2)
kusano 2b45e8
	MADD	xsum2, xsum2, x2, a1
kusano 2b45e8
	LD	x3, 2 * SIZE(XX)
kusano 2b45e8
kusano 2b45e8
	MADD	ysum3, ysum3, alpha1, a3
kusano 2b45e8
	MADD	ysum4, ysum4, alpha2, a3
kusano 2b45e8
	MADD	xsum3, xsum3, x1, a5
kusano 2b45e8
	MADD	xsum4, xsum4, x2, a5
kusano 2b45e8
kusano 2b45e8
	NMSUB	ysum1, ysum1, alpha2, a2
kusano 2b45e8
	MADD	ysum2, ysum2, alpha1, a2
kusano 2b45e8
	ADD1	xsum1, xsum1, x2, a2
kusano 2b45e8
	ADD2	xsum2, xsum2, x1, a2
kusano 2b45e8
kusano 2b45e8
	NMSUB	ysum3, ysum3, alpha2, a4
kusano 2b45e8
	MADD	ysum4, ysum4, alpha1, a4
kusano 2b45e8
	ADD1	xsum3, xsum3, x2, a6
kusano 2b45e8
	ADD2	xsum4, xsum4, x1, a6
kusano 2b45e8
kusano 2b45e8
	MADD	ysum1, ysum1, alpha3, a5
kusano 2b45e8
	MADD	ysum2, ysum2, alpha4, a5
kusano 2b45e8
	MADD	xsum1, xsum1, x3, a3
kusano 2b45e8
	MADD	xsum2, xsum2, x4, a3
kusano 2b45e8
kusano 2b45e8
	MADD	ysum3, ysum3, alpha3, a7
kusano 2b45e8
	MADD	ysum4, ysum4, alpha4, a7
kusano 2b45e8
	MADD	xsum3, xsum3, x3, a7
kusano 2b45e8
	MADD	xsum4, xsum4, x4, a7
kusano 2b45e8
kusano 2b45e8
	NMSUB	ysum1, ysum1, alpha4, a6
kusano 2b45e8
	MADD	ysum2, ysum2, alpha3, a6
kusano 2b45e8
	ADD1	xsum1, xsum1, x4, a4
kusano 2b45e8
	ADD2	xsum2, xsum2, x3, a4
kusano 2b45e8
kusano 2b45e8
	NMSUB	ysum3, ysum3, alpha4, a8
kusano 2b45e8
	daddiu	XX,  XX,  4 * SIZE
kusano 2b45e8
	MADD	ysum4, ysum4, alpha3, a8
kusano 2b45e8
	daddiu	YY,  YY,  4 * SIZE
kusano 2b45e8
	ADD1	xsum3, xsum3, x4, a8
kusano 2b45e8
	daddiu	AO1, AO1, 4 * SIZE
kusano 2b45e8
	ADD2	xsum4, xsum4, x3, a8
kusano 2b45e8
	daddiu	AO2, AO2, 4 * SIZE
kusano 2b45e8
kusano 2b45e8
	ST	ysum1, -4 * SIZE(YY)
kusano 2b45e8
	ST	ysum2, -3 * SIZE(YY)
kusano 2b45e8
	ST	ysum3, -2 * SIZE(YY)
kusano 2b45e8
	ST	ysum4, -1 * SIZE(YY)
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L15:
kusano 2b45e8
	dsll	TEMP,  IS,  ZBASE_SHIFT
kusano 2b45e8
	daddu	TEMP, Y1, TEMP
kusano 2b45e8
kusano 2b45e8
	LD	ysum1, 0 * SIZE(TEMP)
kusano 2b45e8
	LD	ysum2, 1 * SIZE(TEMP)
kusano 2b45e8
	LD	ysum3, 2 * SIZE(TEMP)
kusano 2b45e8
	LD	ysum4, 3 * SIZE(TEMP)
kusano 2b45e8
kusano 2b45e8
	LD	a1, 0 * SIZE(AO1)
kusano 2b45e8
	LD	a2, 1 * SIZE(AO1)
kusano 2b45e8
	LD	a3, 2 * SIZE(AO1)
kusano 2b45e8
	LD	a4, 3 * SIZE(AO1)
kusano 2b45e8
kusano 2b45e8
	LD	a5, 0 * SIZE(AO2)
kusano 2b45e8
	LD	a6, 1 * SIZE(AO2)
kusano 2b45e8
	LD	a7, 2 * SIZE(AO2)
kusano 2b45e8
	LD	a8, 3 * SIZE(AO2)
kusano 2b45e8
kusano 2b45e8
	MOV	x1, xsum1
kusano 2b45e8
	MOV	x2, xsum2
kusano 2b45e8
	MOV	x3, xsum3
kusano 2b45e8
	MOV	x4, xsum4
kusano 2b45e8
kusano 2b45e8
	MUL	xsum1, ALPHA_R, xsum1
kusano 2b45e8
	MUL	xsum2, ALPHA_R, xsum2
kusano 2b45e8
	MUL	xsum3, ALPHA_R, xsum3
kusano 2b45e8
	MUL	xsum4, ALPHA_R, xsum4
kusano 2b45e8
kusano 2b45e8
	NMSUB	xsum1, xsum1, ALPHA_I, x2
kusano 2b45e8
	MADD	xsum2, xsum2, ALPHA_I, x1
kusano 2b45e8
	NMSUB	xsum3, xsum3, ALPHA_I, x4
kusano 2b45e8
	MADD	xsum4, xsum4, ALPHA_I, x3
kusano 2b45e8
kusano 2b45e8
	MADD	xsum1, xsum1, alpha1, a1
kusano 2b45e8
	MADD	xsum2, xsum2, alpha2, a1
kusano 2b45e8
	MADD	xsum3, xsum3, alpha1, a5
kusano 2b45e8
	MADD	xsum4, xsum4, alpha2, a5
kusano 2b45e8
kusano 2b45e8
#ifndef HEMV
kusano 2b45e8
	ADD1	xsum1, xsum1, alpha2, a2
kusano 2b45e8
	ADD2	xsum2, xsum2, alpha1, a2
kusano 2b45e8
#endif
kusano 2b45e8
	ADD1	xsum3, xsum3, alpha2, a6
kusano 2b45e8
	ADD2	xsum4, xsum4, alpha1, a6
kusano 2b45e8
kusano 2b45e8
	MADD	xsum1, xsum1, alpha3, a5
kusano 2b45e8
	MADD	xsum2, xsum2, alpha4, a5
kusano 2b45e8
	MADD	xsum3, xsum3, alpha3, a7
kusano 2b45e8
	MADD	xsum4, xsum4, alpha4, a7
kusano 2b45e8
kusano 2b45e8
	NMSUB	xsum1, xsum1, alpha4, a6
kusano 2b45e8
	MADD	xsum2, xsum2, alpha3, a6
kusano 2b45e8
#ifndef HEMV
kusano 2b45e8
	ADD1	xsum3, xsum3, alpha4, a8
kusano 2b45e8
	ADD2	xsum4, xsum4, alpha3, a8
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	ADD	ysum1, ysum1, xsum1
kusano 2b45e8
	ADD	ysum2, ysum2, xsum2
kusano 2b45e8
	ADD	ysum3, ysum3, xsum3
kusano 2b45e8
	ADD	ysum4, ysum4, xsum4
kusano 2b45e8
kusano 2b45e8
	ST	ysum1, 0 * SIZE(TEMP)
kusano 2b45e8
	ST	ysum2, 1 * SIZE(TEMP)
kusano 2b45e8
	ST	ysum3, 2 * SIZE(TEMP)
kusano 2b45e8
	ST	ysum4, 3 * SIZE(TEMP)
kusano 2b45e8
kusano 2b45e8
	daddiu	TEMP, IS, 4
kusano 2b45e8
	slt	TEMP, M, TEMP
kusano 2b45e8
kusano 2b45e8
	beqz	TEMP, .L11
kusano 2b45e8
	daddiu	IS, IS, 2
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L20:
kusano 2b45e8
	andi	TEMP, M, 1
kusano 2b45e8
	nop
kusano 2b45e8
	blez	TEMP, .L900
kusano 2b45e8
	nop
kusano 2b45e8
kusano 2b45e8
	dsll	TEMP,  IS,  ZBASE_SHIFT
kusano 2b45e8
	daddu	TEMP, X, TEMP
kusano 2b45e8
kusano 2b45e8
	LD	x1, 0 * SIZE(TEMP)
kusano 2b45e8
	LD	x2, 1 * SIZE(TEMP)
kusano 2b45e8
kusano 2b45e8
	MTC	$0,  xsum1
kusano 2b45e8
	MTC	$0,  xsum2
kusano 2b45e8
kusano 2b45e8
	MUL	alpha1, ALPHA_R, x1
kusano 2b45e8
	move	AO1, A
kusano 2b45e8
	MUL	alpha2, ALPHA_I, x1
kusano 2b45e8
	move	I,  IS
kusano 2b45e8
	daddu	A,   AO1, LDA
kusano 2b45e8
kusano 2b45e8
	NMSUB	alpha1, alpha1, ALPHA_I, x2
kusano 2b45e8
	move	XX, X
kusano 2b45e8
	MADD	alpha2, alpha2, ALPHA_R, x2
kusano 2b45e8
	move	YY, Y1
kusano 2b45e8
kusano 2b45e8
	blez	I, .L25
kusano 2b45e8
	daddiu	I, I, -1
kusano 2b45e8
kusano 2b45e8
	LD	x1, 0 * SIZE(XX)
kusano 2b45e8
	LD	x2, 1 * SIZE(XX)
kusano 2b45e8
kusano 2b45e8
	LD	a1, 0 * SIZE(AO1)
kusano 2b45e8
	LD	a2, 1 * SIZE(AO1)
kusano 2b45e8
kusano 2b45e8
	LD	ysum1, 0 * SIZE(YY)
kusano 2b45e8
	blez	I, .L23
kusano 2b45e8
	LD	ysum2, 1 * SIZE(YY)
kusano 2b45e8
	.align	3
kusano 2b45e8
kusano 2b45e8
.L22:
kusano 2b45e8
	MADD	ysum1, ysum1, alpha1, a1
kusano 2b45e8
	daddiu	XX,  XX,  2 * SIZE
kusano 2b45e8
	MADD	ysum2, ysum2, alpha2, a1
kusano 2b45e8
	daddiu	YY,  YY,  2 * SIZE
kusano 2b45e8
	MADD	xsum1, xsum1, x1, a1
kusano 2b45e8
	daddiu	AO1, AO1, 2 * SIZE
kusano 2b45e8
	MADD	xsum2, xsum2, x2, a1
kusano 2b45e8
	daddiu	I, I, -1
kusano 2b45e8
kusano 2b45e8
	NMSUB	ysum1, ysum1, alpha2, a2
kusano 2b45e8
	MADD	ysum2, ysum2, alpha1, a2
kusano 2b45e8
	ADD1	xsum1, xsum1, x2, a2
kusano 2b45e8
	LD	x2, 1 * SIZE(XX)
kusano 2b45e8
	ADD2	xsum2, xsum2, x1, a2
kusano 2b45e8
	LD	x1, 0 * SIZE(XX)
kusano 2b45e8
kusano 2b45e8
	LD	a1, 0 * SIZE(AO1)
kusano 2b45e8
	LD	a2, 1 * SIZE(AO1)
kusano 2b45e8
kusano 2b45e8
	ST	ysum1, -2 * SIZE(YY)
kusano 2b45e8
	LD	ysum1, 0 * SIZE(YY)
kusano 2b45e8
	ST	ysum2, -1 * SIZE(YY)
kusano 2b45e8
	bgtz	I, .L22
kusano 2b45e8
	LD	ysum2, 1 * SIZE(YY)
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L23:
kusano 2b45e8
	MADD	ysum1, ysum1, alpha1, a1
kusano 2b45e8
	MADD	ysum2, ysum2, alpha2, a1
kusano 2b45e8
	MADD	xsum1, xsum1, x1, a1
kusano 2b45e8
	MADD	xsum2, xsum2, x2, a1
kusano 2b45e8
kusano 2b45e8
	NMSUB	ysum1, ysum1, alpha2, a2
kusano 2b45e8
	daddiu	XX,  XX,  2 * SIZE
kusano 2b45e8
	MADD	ysum2, ysum2, alpha1, a2
kusano 2b45e8
	daddiu	YY,  YY,  2 * SIZE
kusano 2b45e8
	ADD1	xsum1, xsum1, x2, a2
kusano 2b45e8
	daddiu	AO1, AO1, 2 * SIZE
kusano 2b45e8
	ADD2	xsum2, xsum2, x1, a2
kusano 2b45e8
	nop
kusano 2b45e8
kusano 2b45e8
	ST	ysum1, -2 * SIZE(YY)
kusano 2b45e8
	ST	ysum2, -1 * SIZE(YY)
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L25:
kusano 2b45e8
	dsll	TEMP,  IS,  ZBASE_SHIFT
kusano 2b45e8
	daddu	TEMP, Y1, TEMP
kusano 2b45e8
kusano 2b45e8
	LD	ysum1, 0 * SIZE(TEMP)
kusano 2b45e8
	LD	ysum2, 1 * SIZE(TEMP)
kusano 2b45e8
kusano 2b45e8
	LD	a1, 0 * SIZE(AO1)
kusano 2b45e8
	LD	a2, 1 * SIZE(AO1)
kusano 2b45e8
kusano 2b45e8
	MOV	x1, xsum1
kusano 2b45e8
	MOV	x2, xsum2
kusano 2b45e8
kusano 2b45e8
	MUL	xsum1, ALPHA_R, xsum1
kusano 2b45e8
	MUL	xsum2, ALPHA_R, xsum2
kusano 2b45e8
kusano 2b45e8
	NMSUB	xsum1, xsum1, ALPHA_I, x2
kusano 2b45e8
	MADD	xsum2, xsum2, ALPHA_I, x1
kusano 2b45e8
kusano 2b45e8
	MADD	xsum1, xsum1, alpha1, a1
kusano 2b45e8
	MADD	xsum2, xsum2, alpha2, a1
kusano 2b45e8
kusano 2b45e8
#ifndef HEMV
kusano 2b45e8
	NMSUB	xsum1, xsum1, alpha2, a2
kusano 2b45e8
	MADD	xsum2, xsum2, alpha1, a2
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	ADD	ysum1, ysum1, xsum1
kusano 2b45e8
	ADD	ysum2, ysum2, xsum2
kusano 2b45e8
kusano 2b45e8
	ST	ysum1, 0 * SIZE(TEMP)
kusano 2b45e8
	ST	ysum2, 1 * SIZE(TEMP)
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L900:
kusano 2b45e8
	li	IS, 2 * SIZE
kusano 2b45e8
kusano 2b45e8
	beq	INCY, IS, .L999
kusano 2b45e8
	NOP
kusano 2b45e8
kusano 2b45e8
	dsra	I,  M, 2
kusano 2b45e8
	blez	I, .L905
kusano 2b45e8
	NOP
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L902:
kusano 2b45e8
	LD	a1, 0 * SIZE(Y1)
kusano 2b45e8
	LD	a2, 1 * SIZE(Y1)
kusano 2b45e8
	LD	a3, 2 * SIZE(Y1)
kusano 2b45e8
	LD	a4, 3 * SIZE(Y1)
kusano 2b45e8
	LD	a5, 4 * SIZE(Y1)
kusano 2b45e8
	LD	a6, 5 * SIZE(Y1)
kusano 2b45e8
	LD	a7, 6 * SIZE(Y1)
kusano 2b45e8
	LD	a8, 7 * SIZE(Y1)
kusano 2b45e8
kusano 2b45e8
	ST	a1, 0 * SIZE(Y)
kusano 2b45e8
	ST	a2, 1 * SIZE(Y)
kusano 2b45e8
	daddu	Y, Y, INCY
kusano 2b45e8
	ST	a3, 0 * SIZE(Y)
kusano 2b45e8
	ST	a4, 1 * SIZE(Y)
kusano 2b45e8
	daddu	Y, Y, INCY
kusano 2b45e8
	ST	a5, 0 * SIZE(Y)
kusano 2b45e8
	ST	a6, 1 * SIZE(Y)
kusano 2b45e8
	daddu	Y, Y, INCY
kusano 2b45e8
	ST	a7, 0 * SIZE(Y)
kusano 2b45e8
	ST	a8, 1 * SIZE(Y)
kusano 2b45e8
	daddu	Y, Y, INCY
kusano 2b45e8
kusano 2b45e8
	daddiu	I, I, -1
kusano 2b45e8
kusano 2b45e8
	bgtz	I, .L902
kusano 2b45e8
	daddiu	Y1, Y1, 8 * SIZE
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L905:
kusano 2b45e8
	andi	I,  M, 3
kusano 2b45e8
	blez	I, .L999
kusano 2b45e8
	NOP
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L906:
kusano 2b45e8
	LD	a1, 0 * SIZE(Y1)
kusano 2b45e8
	LD	a2, 1 * SIZE(Y1)
kusano 2b45e8
	daddiu	Y1, Y1, 2 * SIZE
kusano 2b45e8
kusano 2b45e8
	ST	a1, 0 * SIZE(Y)
kusano 2b45e8
	ST	a2, 1 * SIZE(Y)
kusano 2b45e8
	daddiu	I, I, -1
kusano 2b45e8
kusano 2b45e8
	bgtz	I, .L906
kusano 2b45e8
	daddu	Y, Y, INCY
kusano 2b45e8
	.align 3
kusano 2b45e8
kusano 2b45e8
.L999:
kusano 2b45e8
	LDARG	$16,   0($sp)
kusano 2b45e8
	LDARG	$17,   8($sp)
kusano 2b45e8
	LDARG	$18,  16($sp)
kusano 2b45e8
	LDARG	$19,  24($sp)
kusano 2b45e8
	ldc1	$f24, 32($sp)
kusano 2b45e8
	ldc1	$f25, 40($sp)
kusano 2b45e8
kusano 2b45e8
#ifndef __64BIT__
kusano 2b45e8
	ldc1	$f20, 48($sp)
kusano 2b45e8
	ldc1	$f21, 56($sp)
kusano 2b45e8
	ldc1	$f22, 64($sp)
kusano 2b45e8
	ldc1	$f23, 72($sp)
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	j	$31
kusano 2b45e8
#ifdef __64BIT__
kusano 2b45e8
	daddiu	$sp, $sp, 64
kusano 2b45e8
#else
kusano 2b45e8
	daddiu	$sp, $sp, 80
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	EPILOGUE