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
#ifdef ATOM
kusano 2b45e8
#define PREFETCH	prefetcht0
kusano 2b45e8
#define PREFETCHW	prefetcht0
kusano 2b45e8
#define PREFETCHSIZE	(16 * 24)
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef CORE2
kusano 2b45e8
#define PREFETCH	prefetcht0
kusano 2b45e8
#define PREFETCHW	prefetcht0
kusano 2b45e8
#define PREFETCHSIZE	(16 * 24)
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(PENRYN) || defined(DUNNINGTON)
kusano 2b45e8
#define PREFETCH	prefetcht0
kusano 2b45e8
#define PREFETCHW	prefetcht0
kusano 2b45e8
#define PREFETCHSIZE	(16 * 24)
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef NEHALEM
kusano 2b45e8
#define PREFETCH	prefetcht0
kusano 2b45e8
#define PREFETCHW	prefetcht0
kusano 2b45e8
#define PREFETCHSIZE	(16 * 24)
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef PENTIUM4
kusano 2b45e8
#define PREFETCH	prefetcht0
kusano 2b45e8
#define PREFETCHW	prefetcht0
kusano 2b45e8
#define PREFETCHSIZE	(16 * 28)
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef OPTERON
kusano 2b45e8
#define PREFETCH	prefetch
kusano 2b45e8
#define PREFETCHW	prefetchw
kusano 2b45e8
#define PREFETCHSIZE	(16 * 12)
kusano 2b45e8
#define movsd		movlpd
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(BARCELONA)  || defined(SHANGHAI)
kusano 2b45e8
#define PREFETCH	prefetch
kusano 2b45e8
#define PREFETCHW	prefetchw
kusano 2b45e8
#define PREFETCHSIZE	(16 * 16)
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef NANO
kusano 2b45e8
#define PREFETCH	prefetcht0
kusano 2b45e8
#define PREFETCHW	prefetcht0
kusano 2b45e8
#define PREFETCHSIZE	(16 * 24)
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef GENERIC
kusano 2b45e8
#define PREFETCH	prefetcht0
kusano 2b45e8
#define PREFETCHW	prefetcht0
kusano 2b45e8
#define PREFETCHSIZE	(16 * 14)
kusano 2b45e8
#endif
kusano 2b45e8
	
kusano 2b45e8
#ifndef WINDOWS_ABI
kusano 2b45e8
kusano 2b45e8
#define STACKSIZE	80
kusano 2b45e8
	
kusano 2b45e8
#define OLD_Y		 8 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_INCY	16 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_BUFFER	24 + STACKSIZE(%rsp)
kusano 2b45e8
kusano 2b45e8
#define M	  ARG1
kusano 2b45e8
#define	N	  ARG2
kusano 2b45e8
#define	A	  ARG3
kusano 2b45e8
#define LDA	  ARG4	
kusano 2b45e8
#define	X	  ARG5
kusano 2b45e8
#define INCX	  ARG6	
kusano 2b45e8
kusano 2b45e8
#else
kusano 2b45e8
kusano 2b45e8
#define STACKSIZE	256
kusano 2b45e8
	
kusano 2b45e8
#define OLD_A		 40 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_LDA		 48 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_X		 56 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_INCX	 64 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_Y		 72 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_INCY	 80 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_BUFFER	 88 + STACKSIZE(%rsp)
kusano 2b45e8
kusano 2b45e8
#define M	  ARG1
kusano 2b45e8
#define N	  ARG2
kusano 2b45e8
#define	A	  ARG4
kusano 2b45e8
#define LDA	  ARG3
kusano 2b45e8
#define	X	  %rdi
kusano 2b45e8
#define INCX	  %rsi
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#define	Y	%r10
kusano 2b45e8
#define INCY	%r11
kusano 2b45e8
#define BUFFER	%r12
kusano 2b45e8
kusano 2b45e8
#define TEMP	%rax
kusano 2b45e8
#define I	%rax
kusano 2b45e8
#define A1	%rbx
kusano 2b45e8
#define A2	%rbp
kusano 2b45e8
#define XX	%r13
kusano 2b45e8
#define YY	%r14
kusano 2b45e8
#define IS	%r15
kusano 2b45e8
#define NEW_X	BUFFER
kusano 2b45e8
#define NEW_Y	X
kusano 2b45e8
kusano 2b45e8
#define ALPHA_R  %xmm0
kusano 2b45e8
#define ALPHA_I  %xmm1
kusano 2b45e8
kusano 2b45e8
#define xsum1  %xmm0
kusano 2b45e8
#define xsum2  %xmm1
kusano 2b45e8
#define xsum3  %xmm2
kusano 2b45e8
#define xsum4  %xmm3
kusano 2b45e8
kusano 2b45e8
#define atemp1 %xmm4
kusano 2b45e8
#define atemp2 %xmm5
kusano 2b45e8
#define atemp3 %xmm6
kusano 2b45e8
#define atemp4 %xmm7
kusano 2b45e8
kusano 2b45e8
#define xtemp1 %xmm8
kusano 2b45e8
#define xtemp2 %xmm9
kusano 2b45e8
#define a1     %xmm10
kusano 2b45e8
#define a2     %xmm11
kusano 2b45e8
kusano 2b45e8
#define a3     %xmm12
kusano 2b45e8
#define yy1    %xmm13
kusano 2b45e8
#define	xt1    %xmm14
kusano 2b45e8
#define	xt2    %xmm15
kusano 2b45e8
kusano 2b45e8
#if (defined(HAVE_SSE3) && !defined(CORE_OPTERON)) || defined(BARCELONA) || defined(SHANGHAI)
kusano 2b45e8
#define MOVDDUP(a, b, c)	movddup	a(b), c
kusano 2b45e8
#define MOVDDUP2(a, b, c)	movddup	a##b, c
kusano 2b45e8
#else
kusano 2b45e8
#define MOVDDUP(a, b, c)	movlpd	a(b), c;movhpd	a(b), c
kusano 2b45e8
#define MOVDDUP2(a, b, c)	movlpd	a##b, c;movhpd	a##b, c
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	PROLOGUE
kusano 2b45e8
	PROFCODE
kusano 2b45e8
kusano 2b45e8
	subq	$STACKSIZE, %rsp
kusano 2b45e8
	movq	%rbx,  0(%rsp)
kusano 2b45e8
	movq	%rbp,  8(%rsp)
kusano 2b45e8
	movq	%r12, 16(%rsp)
kusano 2b45e8
	movq	%r13, 24(%rsp)
kusano 2b45e8
	movq	%r14, 32(%rsp)
kusano 2b45e8
	movq	%r15, 40(%rsp)
kusano 2b45e8
kusano 2b45e8
#ifdef WINDOWS_ABI
kusano 2b45e8
	movq	%rdi,    48(%rsp)
kusano 2b45e8
	movq	%rsi,    56(%rsp)
kusano 2b45e8
	movups	%xmm6,   64(%rsp)
kusano 2b45e8
	movups	%xmm7,   80(%rsp)
kusano 2b45e8
	movups	%xmm8,   96(%rsp)
kusano 2b45e8
	movups	%xmm9,  112(%rsp)
kusano 2b45e8
	movups	%xmm10, 128(%rsp)
kusano 2b45e8
	movups	%xmm11, 144(%rsp)
kusano 2b45e8
	movups	%xmm12, 160(%rsp)
kusano 2b45e8
	movups	%xmm13, 176(%rsp)
kusano 2b45e8
	movups	%xmm14, 192(%rsp)
kusano 2b45e8
	movups	%xmm15, 208(%rsp)
kusano 2b45e8
kusano 2b45e8
	movq	OLD_A,     A
kusano 2b45e8
	movq	OLD_LDA,   LDA
kusano 2b45e8
	movq	OLD_X,     X
kusano 2b45e8
	movq	OLD_INCX,  INCX
kusano 2b45e8
kusano 2b45e8
	movaps	%xmm2, %xmm0
kusano 2b45e8
	movaps	%xmm3, %xmm1
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movq	OLD_Y,     Y
kusano 2b45e8
	movq	OLD_INCY,   INCY
kusano 2b45e8
	movq	OLD_BUFFER, BUFFER
kusano 2b45e8
kusano 2b45e8
	salq	$ZBASE_SHIFT, INCX
kusano 2b45e8
	salq	$ZBASE_SHIFT, INCY
kusano 2b45e8
	salq	$ZBASE_SHIFT, LDA
kusano 2b45e8
kusano 2b45e8
	testq	M, M
kusano 2b45e8
	jle	.L999
kusano 2b45e8
kusano 2b45e8
	negq	IS
kusano 2b45e8
	addq	M, IS
kusano 2b45e8
kusano 2b45e8
	movq	IS,  TEMP
kusano 2b45e8
	imulq	LDA, TEMP
kusano 2b45e8
	addq	TEMP, A
kusano 2b45e8
kusano 2b45e8
	pcmpeqb	%xmm3,  %xmm3
kusano 2b45e8
	xorpd	%xmm2,  %xmm2
kusano 2b45e8
	pslld	$31,    %xmm3
kusano 2b45e8
	unpckhps %xmm3, %xmm2
kusano 2b45e8
kusano 2b45e8
	shufps	 $0, ALPHA_R, ALPHA_R
kusano 2b45e8
	shufps	 $0, ALPHA_I, ALPHA_I
kusano 2b45e8
	movaps	 ALPHA_I, %xmm3
kusano 2b45e8
kusano 2b45e8
	unpcklps ALPHA_R, ALPHA_I
kusano 2b45e8
	unpcklps %xmm3,   ALPHA_R
kusano 2b45e8
	pxor	 %xmm2,   ALPHA_R
kusano 2b45e8
kusano 2b45e8
	movq	BUFFER, XX
kusano 2b45e8
kusano 2b45e8
	movq	M,  %rax
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	jle	.L02
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L01:
kusano 2b45e8
	movsd	0 * SIZE(X), %xmm4
kusano 2b45e8
	addq	INCX, X
kusano 2b45e8
	movhps	0 * SIZE(X), %xmm4
kusano 2b45e8
	addq	INCX, X
kusano 2b45e8
	movsd	0 * SIZE(X), %xmm6
kusano 2b45e8
	addq	INCX, X
kusano 2b45e8
	movhps	0 * SIZE(X), %xmm6
kusano 2b45e8
	addq	INCX, X
kusano 2b45e8
kusano 2b45e8
	movsldup %xmm4, %xmm3
kusano 2b45e8
	movshdup %xmm4, %xmm4
kusano 2b45e8
	movsldup %xmm6, %xmm5
kusano 2b45e8
	movshdup %xmm6, %xmm6
kusano 2b45e8
kusano 2b45e8
	mulps	ALPHA_I, %xmm3
kusano 2b45e8
	mulps	ALPHA_R, %xmm4
kusano 2b45e8
	mulps	ALPHA_I, %xmm5
kusano 2b45e8
	mulps	ALPHA_R, %xmm6
kusano 2b45e8
kusano 2b45e8
	addps	%xmm4, %xmm3
kusano 2b45e8
	addps	%xmm6, %xmm5
kusano 2b45e8
kusano 2b45e8
	movaps	%xmm3,  4 * SIZE(XX)
kusano 2b45e8
	movaps	%xmm5, 12 * SIZE(XX)
kusano 2b45e8
kusano 2b45e8
	shufps	$0xb1, %xmm3, %xmm3
kusano 2b45e8
	shufps	$0xb1, %xmm5, %xmm5
kusano 2b45e8
kusano 2b45e8
	pxor	%xmm2, %xmm3
kusano 2b45e8
	pxor	%xmm2, %xmm5
kusano 2b45e8
kusano 2b45e8
	movaps	%xmm3,  0 * SIZE(XX)
kusano 2b45e8
	movaps	%xmm5,  8 * SIZE(XX)
kusano 2b45e8
kusano 2b45e8
	subq	$-16 * SIZE, XX
kusano 2b45e8
	decq	%rax
kusano 2b45e8
	jg	.L01
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L02:
kusano 2b45e8
	testq	$2, M
kusano 2b45e8
	jle	.L03
kusano 2b45e8
kusano 2b45e8
	movsd	0 * SIZE(X), %xmm4
kusano 2b45e8
	addq	INCX, X
kusano 2b45e8
	movhps	0 * SIZE(X), %xmm4
kusano 2b45e8
	addq	INCX, X
kusano 2b45e8
kusano 2b45e8
	movsldup %xmm4, %xmm3
kusano 2b45e8
	movshdup %xmm4, %xmm4
kusano 2b45e8
kusano 2b45e8
	mulps	ALPHA_I, %xmm3
kusano 2b45e8
	mulps	ALPHA_R, %xmm4
kusano 2b45e8
kusano 2b45e8
	addps	%xmm4, %xmm3
kusano 2b45e8
kusano 2b45e8
	movaps	%xmm3,  4 * SIZE(XX)
kusano 2b45e8
kusano 2b45e8
	shufps	$0xb1, %xmm3, %xmm3
kusano 2b45e8
	pxor	%xmm2, %xmm3
kusano 2b45e8
	movaps	%xmm3,  0 * SIZE(XX)
kusano 2b45e8
kusano 2b45e8
	subq	$-8 * SIZE, XX
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L03:
kusano 2b45e8
	testq	$1, M
kusano 2b45e8
	jle	.L05
kusano 2b45e8
kusano 2b45e8
	movsd	0 * SIZE(X), %xmm4
kusano 2b45e8
	addq	INCX, X
kusano 2b45e8
kusano 2b45e8
	movsldup %xmm4, %xmm3
kusano 2b45e8
	movshdup %xmm4, %xmm4
kusano 2b45e8
kusano 2b45e8
	mulps	ALPHA_I, %xmm3
kusano 2b45e8
	mulps	ALPHA_R, %xmm4
kusano 2b45e8
kusano 2b45e8
	addps	%xmm4, %xmm3
kusano 2b45e8
kusano 2b45e8
	movlps	%xmm3,  2 * SIZE(XX)
kusano 2b45e8
kusano 2b45e8
	shufps	$0xb1, %xmm3, %xmm3
kusano 2b45e8
	pxor	%xmm2, %xmm3
kusano 2b45e8
	movlps	%xmm3,  0 * SIZE(XX)
kusano 2b45e8
kusano 2b45e8
	subq	$-4 * SIZE, XX
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L05:
kusano 2b45e8
	/* now we don't need original X */
kusano 2b45e8
	movq   Y, NEW_Y
kusano 2b45e8
kusano 2b45e8
	addq   $512, XX
kusano 2b45e8
	andq   $-512, XX
kusano 2b45e8
kusano 2b45e8
	cmpq   $2 * SIZE, INCY
kusano 2b45e8
	je    .L10
kusano 2b45e8
kusano 2b45e8
	movq   Y,  YY
kusano 2b45e8
	movq   XX, NEW_Y
kusano 2b45e8
kusano 2b45e8
	movq	M,  %rax
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	jle	.L07
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L06:
kusano 2b45e8
	movsd	0 * SIZE(YY), %xmm0
kusano 2b45e8
	addq	INCY, YY
kusano 2b45e8
	movhps	0 * SIZE(YY), %xmm0
kusano 2b45e8
	addq	INCY, YY
kusano 2b45e8
	movsd	0 * SIZE(YY), %xmm1
kusano 2b45e8
	addq	INCY, YY
kusano 2b45e8
	movhps	0 * SIZE(YY), %xmm1
kusano 2b45e8
	addq	INCY, YY
kusano 2b45e8
kusano 2b45e8
	movaps	%xmm0, 0 * SIZE(XX)
kusano 2b45e8
	movaps	%xmm1, 8 * SIZE(XX)
kusano 2b45e8
kusano 2b45e8
	addq	$8 * SIZE, XX
kusano 2b45e8
	decq	%rax
kusano 2b45e8
	jg	.L06
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L07:
kusano 2b45e8
	movq	M, %rax
kusano 2b45e8
	andq	$3, %rax
kusano 2b45e8
	jle	.L10
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L08:
kusano 2b45e8
	movsd	0 * SIZE(YY), %xmm0
kusano 2b45e8
	addq	INCY, YY
kusano 2b45e8
kusano 2b45e8
	movlps	%xmm0, 0 * SIZE(XX)
kusano 2b45e8
kusano 2b45e8
	addq	$2 * SIZE, XX
kusano 2b45e8
	decq	%rax
kusano 2b45e8
	jg	.L08
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L10:
kusano 2b45e8
	movq	 IS, I
kusano 2b45e8
	addq	 $2, I
kusano 2b45e8
	cmpq	 M,  I
kusano 2b45e8
	jg	 .L20
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L11:
kusano 2b45e8
	movq	A,  A1
kusano 2b45e8
	leaq	(A, LDA, 1), A2
kusano 2b45e8
	leaq	(A, LDA, 2), A
kusano 2b45e8
kusano 2b45e8
	leaq	(, IS, 4), I
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(NEW_X, I, SIZE), atemp2
kusano 2b45e8
	movhps	 4 * SIZE(NEW_X, I, SIZE), atemp2
kusano 2b45e8
	movsd	 2 * SIZE(NEW_X, I, SIZE), atemp4
kusano 2b45e8
	movhps	 6 * SIZE(NEW_X, I, SIZE), atemp4
kusano 2b45e8
kusano 2b45e8
	pshufd	 $0xcc, atemp2, atemp1
kusano 2b45e8
	pshufd	 $0x99, atemp2, atemp2
kusano 2b45e8
	pshufd	 $0xcc, atemp4, atemp3
kusano 2b45e8
	pshufd	 $0x99, atemp4, atemp4
kusano 2b45e8
kusano 2b45e8
	pxor		xsum1, xsum1
kusano 2b45e8
	pxor		xsum2, xsum2
kusano 2b45e8
	pxor		xsum3, xsum3
kusano 2b45e8
	pxor		xsum4, xsum4
kusano 2b45e8
kusano 2b45e8
	movq		NEW_X, XX
kusano 2b45e8
	movq		NEW_Y, YY
kusano 2b45e8
kusano 2b45e8
	movq	IS,  I
kusano 2b45e8
	sarq	$2,  I
kusano 2b45e8
	jle	.L15
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L12:
kusano 2b45e8
	HALT
kusano 2b45e8
kusano 2b45e8
	subq	 $-16 * SIZE, XX
kusano 2b45e8
	addq	 $  8 * SIZE, YY
kusano 2b45e8
	addq	 $  8 * SIZE, A1
kusano 2b45e8
	addq	 $  8 * SIZE, A2
kusano 2b45e8
kusano 2b45e8
	decq	 I
kusano 2b45e8
	jg	 .L12
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L15:
kusano 2b45e8
	testq	$2, IS
kusano 2b45e8
	jle	.L18
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(YY), yy1
kusano 2b45e8
	movhps	 2 * SIZE(YY), yy1
kusano 2b45e8
kusano 2b45e8
	movaps	 0 * SIZE(XX), xtemp1
kusano 2b45e8
	movaps	 4 * SIZE(XX), xtemp2
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(A1), a1
kusano 2b45e8
	movhps	 2 * SIZE(A1), a1
kusano 2b45e8
kusano 2b45e8
	movaps	 xtemp1, xt1
kusano 2b45e8
	movaps	 xtemp2, xt2
kusano 2b45e8
	mulps	 a1, xt1
kusano 2b45e8
	mulps	 a1, xt2
kusano 2b45e8
	addps	 xt1, xsum1
kusano 2b45e8
	addps	 xt2, xsum2
kusano 2b45e8
kusano 2b45e8
	pshufd	 $0xb1, a1, xt2
kusano 2b45e8
	mulps	 atemp1, a1
kusano 2b45e8
	mulps	 atemp2, xt2
kusano 2b45e8
	addps	 a1,  yy1
kusano 2b45e8
	addps	 xt2, yy1
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(A2), a1
kusano 2b45e8
	movhps	 2 * SIZE(A2), a1
kusano 2b45e8
kusano 2b45e8
	movaps	 xtemp1, xt1
kusano 2b45e8
	movaps	 xtemp2, xt2
kusano 2b45e8
	mulps	 a1, xt1
kusano 2b45e8
	mulps	 a1, xt2
kusano 2b45e8
	addps	 xt1, xsum3
kusano 2b45e8
	addps	 xt2, xsum4
kusano 2b45e8
kusano 2b45e8
	pshufd	 $0xb1, a1, xt2
kusano 2b45e8
	mulps	 atemp1, a1
kusano 2b45e8
	mulps	 atemp2, xt2
kusano 2b45e8
	addps	  a1, yy1
kusano 2b45e8
	addps	 xt2, yy1
kusano 2b45e8
kusano 2b45e8
	movlps	 yy1, 0 * SIZE(YY)
kusano 2b45e8
	movhps	 yy1, 2 * SIZE(YY)
kusano 2b45e8
kusano 2b45e8
	addq	 $8 * SIZE, XX
kusano 2b45e8
	addq	 $4 * SIZE, YY
kusano 2b45e8
	addq	 $4 * SIZE, A1
kusano 2b45e8
	addq	 $4 * SIZE, A2
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L18:
kusano 2b45e8
	leaq	(, IS, 4), I
kusano 2b45e8
kusano 2b45e8
	movaps	 0 * SIZE(NEW_X, I, SIZE), atemp1
kusano 2b45e8
	movaps	 4 * SIZE(NEW_X, I, SIZE), atemp2
kusano 2b45e8
kusano 2b45e8
	movlps	 0 * SIZE(YY), yy1
kusano 2b45e8
	movhps	 2 * SIZE(YY), yy1
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(A1), a1
kusano 2b45e8
	movhps	 0 * SIZE(A2), a1
kusano 2b45e8
kusano 2b45e8
	movaps	 a1, a2
kusano 2b45e8
	mulps	 atemp1, a1
kusano 2b45e8
	mulps	 atemp2, a2
kusano 2b45e8
	addps	 a1, xsum1
kusano 2b45e8
	addps	 a2, xsum2
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(A2), a1
kusano 2b45e8
	movhps	 2 * SIZE(A2), a1
kusano 2b45e8
kusano 2b45e8
	movaps	 a1, a2
kusano 2b45e8
	mulps	 atemp1, a1
kusano 2b45e8
	mulps	 atemp2, a2
kusano 2b45e8
	addps	 a1, xsum3
kusano 2b45e8
	addps	 a2, xsum4
kusano 2b45e8
kusano 2b45e8
	haddps	 xsum2, xsum1
kusano 2b45e8
	haddps	 xsum4, xsum3
kusano 2b45e8
kusano 2b45e8
	haddps	 xsum3, xsum1
kusano 2b45e8
	addps	 xsum1, yy1
kusano 2b45e8
kusano 2b45e8
	movlps	 yy1, 0 * SIZE(YY)
kusano 2b45e8
	movhps	 yy1, 2 * SIZE(YY)
kusano 2b45e8
kusano 2b45e8
	addq	 $2, IS
kusano 2b45e8
kusano 2b45e8
	movq	 IS, I
kusano 2b45e8
	addq	 $2, I
kusano 2b45e8
	cmpq	 M, I
kusano 2b45e8
	jle	 .L11
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L20:
kusano 2b45e8
	testq	$1, M
kusano 2b45e8
	jle	.L990
kusano 2b45e8
kusano 2b45e8
kusano 2b45e8
.L990:
kusano 2b45e8
	cmpq   $2 * SIZE, INCY
kusano 2b45e8
	je    .L999
kusano 2b45e8
kusano 2b45e8
	movq	M,  %rax
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	jle	.L997
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L996:
kusano 2b45e8
	movaps	 0 * SIZE(NEW_Y), %xmm0
kusano 2b45e8
	movaps	 4 * SIZE(NEW_Y), %xmm1
kusano 2b45e8
kusano 2b45e8
	movlps	%xmm0,  0 * SIZE(Y)
kusano 2b45e8
	addq	INCY, Y
kusano 2b45e8
	movhps	%xmm0,  0 * SIZE(Y)
kusano 2b45e8
	addq	INCY, Y
kusano 2b45e8
	movlps	%xmm1,  0 * SIZE(Y)
kusano 2b45e8
	addq	INCY, Y
kusano 2b45e8
	movhps	%xmm1,  0 * SIZE(Y)
kusano 2b45e8
	addq	INCY, Y
kusano 2b45e8
kusano 2b45e8
	addq	$8 * SIZE, NEW_Y
kusano 2b45e8
	decq	%rax
kusano 2b45e8
	jg	.L996
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L997:
kusano 2b45e8
	movq	M, %rax
kusano 2b45e8
	andq	$3, %rax
kusano 2b45e8
	jle	.L999
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L998:
kusano 2b45e8
	movlps	0 * SIZE(NEW_Y), %xmm0
kusano 2b45e8
	addq	$2 * SIZE, NEW_Y
kusano 2b45e8
kusano 2b45e8
	movlps	%xmm0,  0 * SIZE(Y)
kusano 2b45e8
	addq	INCY, Y
kusano 2b45e8
kusano 2b45e8
	decq	%rax
kusano 2b45e8
	jg	.L998
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L999:
kusano 2b45e8
	movq	  0(%rsp), %rbx
kusano 2b45e8
	movq	  8(%rsp), %rbp
kusano 2b45e8
	movq	 16(%rsp), %r12
kusano 2b45e8
	movq	 24(%rsp), %r13
kusano 2b45e8
	movq	 32(%rsp), %r14
kusano 2b45e8
	movq	 40(%rsp), %r15
kusano 2b45e8
	addq	$STACKSIZE, %rsp
kusano 2b45e8
	ret
kusano 2b45e8
	EPILOGUE