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
#include "l2param.h"
kusano 2b45e8
kusano 2b45e8
#define PREFETCH	prefetchnta
kusano 2b45e8
#define PREFETCHW	prefetcht0
kusano 2b45e8
#define PREFETCH_SIZE	(8 * 6)
kusano 2b45e8
kusano 2b45e8
#ifndef WINDOWS_ABI
kusano 2b45e8
kusano 2b45e8
#define STACKSIZE	64
kusano 2b45e8
	
kusano 2b45e8
#define OLD_INCX	 8 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_Y		16 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_INCY	24 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_BUFFER	32 + STACKSIZE(%rsp)
kusano 2b45e8
#define STACK_ALPHA	48	      (%rsp)
kusano 2b45e8
kusano 2b45e8
#define M	  %rdi
kusano 2b45e8
#define N	  %rsi
kusano 2b45e8
#define A	  %rcx
kusano 2b45e8
#define LDA	  %r8
kusano 2b45e8
#define X	  %r9
kusano 2b45e8
#define INCX	  %rdx
kusano 2b45e8
#define Y	  %rbp
kusano 2b45e8
#define INCY	  %r10
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 STACK_ALPHA	224	       (%rsp)
kusano 2b45e8
kusano 2b45e8
#define M	  %rcx
kusano 2b45e8
#define N	  %rdx
kusano 2b45e8
#define A	  %r8
kusano 2b45e8
#define LDA	  %r9
kusano 2b45e8
#define X	  %rdi
kusano 2b45e8
#define INCX	  %rsi
kusano 2b45e8
#define Y	  %rbp
kusano 2b45e8
#define INCY	  %r10
kusano 2b45e8
kusano 2b45e8
#endif
kusano 2b45e8
	
kusano 2b45e8
#define I	%rax
kusano 2b45e8
#define J	%r11
kusano 2b45e8
#define A1	%r12
kusano 2b45e8
#define A2	%r13
kusano 2b45e8
#define Y1	%r14
kusano 2b45e8
#define BUFFER	%r15
kusano 2b45e8
#define MM	%rbx
kusano 2b45e8
	
kusano 2b45e8
#define ALPHA %xmm15
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
#endif
kusano 2b45e8
	movq	OLD_INCX,   INCX
kusano 2b45e8
	movq	OLD_Y,      Y
kusano 2b45e8
	movq	OLD_INCY,   INCY
kusano 2b45e8
	movq	OLD_BUFFER, BUFFER
kusano 2b45e8
kusano 2b45e8
#ifndef WINDOWS_ABI
kusano 2b45e8
	movsd	 %xmm0, STACK_ALPHA
kusano 2b45e8
#else
kusano 2b45e8
	movsd	 %xmm3, STACK_ALPHA
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	leaq	(,INCX, SIZE), INCX
kusano 2b45e8
	leaq	(,INCY, SIZE), INCY
kusano 2b45e8
	leaq	(,LDA,  SIZE), LDA
kusano 2b45e8
kusano 2b45e8
	testq	N, N
kusano 2b45e8
	jle	.L999
kusano 2b45e8
	testq	M, M
kusano 2b45e8
	jle	.L999
kusano 2b45e8
kusano 2b45e8
	cmpq	$SIZE, INCY
kusano 2b45e8
	cmoveq	Y, BUFFER
kusano 2b45e8
	je	.L10
kusano 2b45e8
kusano 2b45e8
	movq	BUFFER, Y1
kusano 2b45e8
	xorps	%xmm4, %xmm4
kusano 2b45e8
kusano 2b45e8
	movq	M,  %rax
kusano 2b45e8
	addq	$7, %rax
kusano 2b45e8
	sarq	$3, %rax
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L01:
kusano 2b45e8
	movsd	%xmm4, 0 * SIZE(Y1)
kusano 2b45e8
	movsd	%xmm4, 1 * SIZE(Y1)
kusano 2b45e8
	movsd	%xmm4, 2 * SIZE(Y1)
kusano 2b45e8
	movsd	%xmm4, 3 * SIZE(Y1)
kusano 2b45e8
	movsd	%xmm4, 4 * SIZE(Y1)
kusano 2b45e8
	movsd	%xmm4, 5 * SIZE(Y1)
kusano 2b45e8
	movsd	%xmm4, 6 * SIZE(Y1)
kusano 2b45e8
	movsd	%xmm4, 7 * SIZE(Y1)
kusano 2b45e8
kusano 2b45e8
	addq	$8 * SIZE, Y1
kusano 2b45e8
	decq	%rax
kusano 2b45e8
	jg	.L01
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L10:
kusano 2b45e8
	movq	N,  J
kusano 2b45e8
	sarq	$1, J
kusano 2b45e8
	jle	.L20
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L11:
kusano 2b45e8
	movq	BUFFER, Y1
kusano 2b45e8
kusano 2b45e8
	movq	A,  A1
kusano 2b45e8
	leaq	(A, LDA, 1), A2
kusano 2b45e8
	leaq	(A, LDA, 2), A
kusano 2b45e8
kusano 2b45e8
	movsd	STACK_ALPHA, %xmm0
kusano 2b45e8
kusano 2b45e8
	movsd	(X), %xmm14
kusano 2b45e8
	addq	INCX, X
kusano 2b45e8
	movsd	(X), %xmm15
kusano 2b45e8
	addq	INCX, X
kusano 2b45e8
kusano 2b45e8
	mulsd	%xmm0, %xmm14
kusano 2b45e8
	mulsd	%xmm0, %xmm15
kusano 2b45e8
kusano 2b45e8
	movq	M,  I
kusano 2b45e8
	sarq	$3, I
kusano 2b45e8
	jle	.L15
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(A1), %xmm0
kusano 2b45e8
	movsd	 1 * SIZE(A1), %xmm1
kusano 2b45e8
	movsd	 2 * SIZE(A1), %xmm2
kusano 2b45e8
	movsd	 3 * SIZE(A1), %xmm3
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(A2), %xmm4
kusano 2b45e8
	movsd	 1 * SIZE(A2), %xmm5
kusano 2b45e8
	movsd	 2 * SIZE(A2), %xmm6
kusano 2b45e8
	movsd	 3 * SIZE(A2), %xmm7
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(Y1), %xmm8
kusano 2b45e8
	mulsd	 %xmm14, %xmm0
kusano 2b45e8
	movsd	 1 * SIZE(Y1), %xmm9
kusano 2b45e8
	mulsd	 %xmm14, %xmm1
kusano 2b45e8
	movsd	 2 * SIZE(Y1), %xmm10
kusano 2b45e8
	mulsd	 %xmm14, %xmm2
kusano 2b45e8
	movsd	 3 * SIZE(Y1), %xmm11
kusano 2b45e8
	mulsd	 %xmm14, %xmm3
kusano 2b45e8
kusano 2b45e8
	decq	 I
kusano 2b45e8
	jle	 .L14
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L13:
kusano 2b45e8
	PREFETCH	PREFETCH_SIZE * SIZE(A1)
kusano 2b45e8
	mulsd	 %xmm15, %xmm4
kusano 2b45e8
	PREFETCH	PREFETCH_SIZE * SIZE(A2)
kusano 2b45e8
	addsd	 %xmm0,  %xmm8
kusano 2b45e8
	movsd	 4 * SIZE(A1), %xmm0
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm15, %xmm5
kusano 2b45e8
	addsd	 %xmm1,  %xmm9
kusano 2b45e8
	movsd	 5 * SIZE(A1), %xmm1
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm15, %xmm6
kusano 2b45e8
	addsd	 %xmm2,  %xmm10
kusano 2b45e8
	movsd	 6 * SIZE(A1), %xmm2
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm15, %xmm7
kusano 2b45e8
	addsd	 %xmm3,  %xmm11
kusano 2b45e8
	movsd	 7 * SIZE(A1), %xmm3
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm4,  %xmm8
kusano 2b45e8
	mulsd	 %xmm14, %xmm0
kusano 2b45e8
	movsd	 4 * SIZE(A2), %xmm4
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm5,  %xmm9
kusano 2b45e8
	mulsd	 %xmm14, %xmm1
kusano 2b45e8
	movsd	 5 * SIZE(A2), %xmm5
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm6,  %xmm10
kusano 2b45e8
	mulsd	 %xmm14, %xmm2
kusano 2b45e8
	movsd	 6 * SIZE(A2), %xmm6
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm7,  %xmm11
kusano 2b45e8
	mulsd	 %xmm14, %xmm3
kusano 2b45e8
	movsd	 7 * SIZE(A2), %xmm7
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm8,  0 * SIZE(Y1)
kusano 2b45e8
	movsd	 4 * SIZE(Y1), %xmm8
kusano 2b45e8
	movsd	 %xmm9,  1 * SIZE(Y1)
kusano 2b45e8
	movsd	 5 * SIZE(Y1), %xmm9
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm10, 2 * SIZE(Y1)
kusano 2b45e8
	movsd	 6 * SIZE(Y1), %xmm10
kusano 2b45e8
	movsd	 %xmm11, 3 * SIZE(Y1)
kusano 2b45e8
	movsd	 7 * SIZE(Y1), %xmm11
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm15, %xmm4
kusano 2b45e8
	addsd	 %xmm0,  %xmm8
kusano 2b45e8
	movsd	 8 * SIZE(A1), %xmm0
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm15, %xmm5
kusano 2b45e8
	addsd	 %xmm1,  %xmm9
kusano 2b45e8
	movsd	 9 * SIZE(A1), %xmm1
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm15, %xmm6
kusano 2b45e8
	addsd	 %xmm2,  %xmm10
kusano 2b45e8
	movsd	10 * SIZE(A1), %xmm2
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm15, %xmm7
kusano 2b45e8
	addq	 $8 * SIZE, A2
kusano 2b45e8
	addsd	 %xmm3,  %xmm11
kusano 2b45e8
	movsd	11 * SIZE(A1), %xmm3
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm0
kusano 2b45e8
	addsd	 %xmm4,  %xmm8
kusano 2b45e8
	movsd	 0 * SIZE(A2), %xmm4
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm1
kusano 2b45e8
	addq	 $8 * SIZE, Y1
kusano 2b45e8
	addsd	 %xmm5,  %xmm9
kusano 2b45e8
	movsd	 1 * SIZE(A2), %xmm5
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm2
kusano 2b45e8
	addq	 $8 * SIZE, A1
kusano 2b45e8
	addsd	 %xmm6,  %xmm10
kusano 2b45e8
	movsd	 2 * SIZE(A2), %xmm6
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm3
kusano 2b45e8
	decq	 I
kusano 2b45e8
	addsd	 %xmm7,  %xmm11
kusano 2b45e8
	movsd	 3 * SIZE(A2), %xmm7
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm8, -4 * SIZE(Y1)
kusano 2b45e8
	movsd	 0 * SIZE(Y1), %xmm8
kusano 2b45e8
	movsd	 %xmm9, -3 * SIZE(Y1)
kusano 2b45e8
	movsd	 1 * SIZE(Y1), %xmm9
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm10,-2 * SIZE(Y1)
kusano 2b45e8
	movsd	 2 * SIZE(Y1), %xmm10
kusano 2b45e8
	movsd	 %xmm11,-1 * SIZE(Y1)
kusano 2b45e8
	movsd	 3 * SIZE(Y1), %xmm11
kusano 2b45e8
	jg	.L13
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L14:
kusano 2b45e8
	mulsd	 %xmm15, %xmm4
kusano 2b45e8
	addsd	 %xmm0,  %xmm8
kusano 2b45e8
	movsd	 4 * SIZE(A1), %xmm0
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm15, %xmm5
kusano 2b45e8
	addsd	 %xmm1,  %xmm9
kusano 2b45e8
	movsd	 5 * SIZE(A1), %xmm1
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm15, %xmm6
kusano 2b45e8
	addsd	 %xmm2,  %xmm10
kusano 2b45e8
	movsd	 6 * SIZE(A1), %xmm2
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm15, %xmm7
kusano 2b45e8
	addsd	 %xmm3,  %xmm11
kusano 2b45e8
	movsd	 7 * SIZE(A1), %xmm3
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm4,  %xmm8
kusano 2b45e8
	mulsd	 %xmm14, %xmm0
kusano 2b45e8
	movsd	 4 * SIZE(A2), %xmm4
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm5,  %xmm9
kusano 2b45e8
	mulsd	 %xmm14, %xmm1
kusano 2b45e8
	movsd	 5 * SIZE(A2), %xmm5
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm6,  %xmm10
kusano 2b45e8
	mulsd	 %xmm14, %xmm2
kusano 2b45e8
	movsd	 6 * SIZE(A2), %xmm6
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm7,  %xmm11
kusano 2b45e8
	mulsd	 %xmm14, %xmm3
kusano 2b45e8
	movsd	 7 * SIZE(A2), %xmm7
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm8,  0 * SIZE(Y1)
kusano 2b45e8
	movsd	 4 * SIZE(Y1), %xmm8
kusano 2b45e8
	movsd	 %xmm9,  1 * SIZE(Y1)
kusano 2b45e8
	movsd	 5 * SIZE(Y1), %xmm9
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm10, 2 * SIZE(Y1)
kusano 2b45e8
	movsd	 6 * SIZE(Y1), %xmm10
kusano 2b45e8
	movsd	 %xmm11, 3 * SIZE(Y1)
kusano 2b45e8
	movsd	 7 * SIZE(Y1), %xmm11
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm15, %xmm4
kusano 2b45e8
	addsd	 %xmm0,  %xmm8
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm15, %xmm5
kusano 2b45e8
	addsd	 %xmm1,  %xmm9
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm15, %xmm6
kusano 2b45e8
	addsd	 %xmm2,  %xmm10
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm15, %xmm7
kusano 2b45e8
	addq	 $8 * SIZE, A2
kusano 2b45e8
	addsd	 %xmm3,  %xmm11
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm0
kusano 2b45e8
	addsd	 %xmm4,  %xmm8
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm1
kusano 2b45e8
	addq	 $8 * SIZE, Y1
kusano 2b45e8
	addsd	 %xmm5,  %xmm9
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm2
kusano 2b45e8
	addq	 $8 * SIZE, A1
kusano 2b45e8
	addsd	 %xmm6,  %xmm10
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm3
kusano 2b45e8
	addsd	 %xmm7,  %xmm11
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm8, -4 * SIZE(Y1)
kusano 2b45e8
	movsd	 %xmm9, -3 * SIZE(Y1)
kusano 2b45e8
	movsd	 %xmm10,-2 * SIZE(Y1)
kusano 2b45e8
	movsd	 %xmm11,-1 * SIZE(Y1)
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L15:
kusano 2b45e8
	testq	$4, M
kusano 2b45e8
	je	.L17
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(A1), %xmm0
kusano 2b45e8
	movsd	 1 * SIZE(A1), %xmm1
kusano 2b45e8
	movsd	 2 * SIZE(A1), %xmm2
kusano 2b45e8
	movsd	 3 * SIZE(A1), %xmm3
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(A2), %xmm4
kusano 2b45e8
	movsd	 1 * SIZE(A2), %xmm5
kusano 2b45e8
	movsd	 2 * SIZE(A2), %xmm6
kusano 2b45e8
	movsd	 3 * SIZE(A2), %xmm7
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(Y1), %xmm8
kusano 2b45e8
	mulsd	 %xmm14, %xmm0
kusano 2b45e8
	movsd	 1 * SIZE(Y1), %xmm9
kusano 2b45e8
	mulsd	 %xmm14, %xmm1
kusano 2b45e8
	movsd	 2 * SIZE(Y1), %xmm10
kusano 2b45e8
	mulsd	 %xmm14, %xmm2
kusano 2b45e8
	movsd	 3 * SIZE(Y1), %xmm11
kusano 2b45e8
	mulsd	 %xmm14, %xmm3
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm15, %xmm4
kusano 2b45e8
	addsd	 %xmm0,  %xmm8
kusano 2b45e8
	mulsd	 %xmm15, %xmm5
kusano 2b45e8
	addsd	 %xmm1,  %xmm9
kusano 2b45e8
	mulsd	 %xmm15, %xmm6
kusano 2b45e8
	addsd	 %xmm2,  %xmm10
kusano 2b45e8
	mulsd	 %xmm15, %xmm7
kusano 2b45e8
	addsd	 %xmm3,  %xmm11
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm4,  %xmm8
kusano 2b45e8
	addsd	 %xmm5,  %xmm9
kusano 2b45e8
	addsd	 %xmm6,  %xmm10
kusano 2b45e8
	addsd	 %xmm7,  %xmm11
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm8,  0 * SIZE(Y1)
kusano 2b45e8
	movsd	 %xmm9,  1 * SIZE(Y1)
kusano 2b45e8
	movsd	 %xmm10, 2 * SIZE(Y1)
kusano 2b45e8
	movsd	 %xmm11, 3 * SIZE(Y1)
kusano 2b45e8
kusano 2b45e8
	addq	 $4 * SIZE, A1
kusano 2b45e8
	addq	 $4 * SIZE, A2
kusano 2b45e8
	addq	 $4 * SIZE, Y1
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L17:
kusano 2b45e8
	testq	$2, M
kusano 2b45e8
	je	.L18
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(A1), %xmm0
kusano 2b45e8
	movsd	 1 * SIZE(A1), %xmm1
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(A2), %xmm4
kusano 2b45e8
	movsd	 1 * SIZE(A2), %xmm5
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm0
kusano 2b45e8
	movsd	 0 * SIZE(Y1), %xmm8
kusano 2b45e8
	mulsd	 %xmm14, %xmm1
kusano 2b45e8
	movsd	 1 * SIZE(Y1), %xmm9
kusano 2b45e8
	mulsd	 %xmm15, %xmm4
kusano 2b45e8
	mulsd	 %xmm15, %xmm5
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm0,  %xmm8
kusano 2b45e8
	addsd	 %xmm1,  %xmm9
kusano 2b45e8
	addsd	 %xmm4,  %xmm8
kusano 2b45e8
	addsd	 %xmm5,  %xmm9
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm8, 0 * SIZE(Y1)
kusano 2b45e8
	movsd	 %xmm9, 1 * SIZE(Y1)
kusano 2b45e8
kusano 2b45e8
	addq	 $2 * SIZE, A1
kusano 2b45e8
	addq	 $2 * SIZE, A2
kusano 2b45e8
	addq	 $2 * SIZE, Y1
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L18:
kusano 2b45e8
	testq	$1, M
kusano 2b45e8
	je	.L19
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(Y1), %xmm8
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(A1), %xmm0
kusano 2b45e8
	movsd	 0 * SIZE(A2), %xmm4
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm0
kusano 2b45e8
	mulsd	 %xmm15, %xmm4
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm0,  %xmm8
kusano 2b45e8
	addsd	 %xmm4,  %xmm8
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm8, 0 * SIZE(Y1)
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L19:
kusano 2b45e8
	decq	J
kusano 2b45e8
	jg	.L11
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L20:
kusano 2b45e8
	testq	$1, N
kusano 2b45e8
	je	.L990
kusano 2b45e8
kusano 2b45e8
	movq	BUFFER, Y1
kusano 2b45e8
	movq	A,  A1
kusano 2b45e8
kusano 2b45e8
	movsd	(X), %xmm14
kusano 2b45e8
	mulsd	STACK_ALPHA, %xmm14
kusano 2b45e8
kusano 2b45e8
	movq	M,  I
kusano 2b45e8
	sarq	$3, I
kusano 2b45e8
	jle	.L25
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(A1), %xmm0
kusano 2b45e8
	movsd	 1 * SIZE(A1), %xmm1
kusano 2b45e8
	movsd	 2 * SIZE(A1), %xmm2
kusano 2b45e8
	movsd	 3 * SIZE(A1), %xmm3
kusano 2b45e8
kusano 2b45e8
 	movsd	 4 * SIZE(A1), %xmm4
kusano 2b45e8
 	movsd	 5 * SIZE(A1), %xmm5
kusano 2b45e8
	movsd	 6 * SIZE(A1), %xmm6
kusano 2b45e8
	movsd	 7 * SIZE(A1), %xmm7
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(Y1), %xmm8
kusano 2b45e8
	mulsd	 %xmm14, %xmm0
kusano 2b45e8
	movsd	 1 * SIZE(Y1), %xmm9
kusano 2b45e8
	mulsd	 %xmm14, %xmm1
kusano 2b45e8
	movsd	 2 * SIZE(Y1), %xmm10
kusano 2b45e8
	mulsd	 %xmm14, %xmm2
kusano 2b45e8
	movsd	 3 * SIZE(Y1), %xmm11
kusano 2b45e8
	mulsd	 %xmm14, %xmm3
kusano 2b45e8
kusano 2b45e8
	decq	 I
kusano 2b45e8
	jle	 .L24
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L23:
kusano 2b45e8
	PREFETCH	PREFETCH_SIZE * SIZE(A1)
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm0,  %xmm8
kusano 2b45e8
	movsd	  8 * SIZE(A1), %xmm0
kusano 2b45e8
	addsd	 %xmm1,  %xmm9
kusano 2b45e8
	movsd	  9 * SIZE(A1), %xmm1
kusano 2b45e8
	addsd	 %xmm2,  %xmm10
kusano 2b45e8
	movsd	 10 * SIZE(A1), %xmm2
kusano 2b45e8
	addsd	 %xmm3,  %xmm11
kusano 2b45e8
	movsd	 11 * SIZE(A1), %xmm3
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm8,  0 * SIZE(Y1)
kusano 2b45e8
	movsd	 4 * SIZE(Y1), %xmm8
kusano 2b45e8
	mulsd	 %xmm14, %xmm4
kusano 2b45e8
	movsd	 %xmm9,  1 * SIZE(Y1)
kusano 2b45e8
	movsd	 5 * SIZE(Y1), %xmm9
kusano 2b45e8
	mulsd	 %xmm14, %xmm5
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm10, 2 * SIZE(Y1)
kusano 2b45e8
	movsd	 6 * SIZE(Y1), %xmm10
kusano 2b45e8
	mulsd	 %xmm14, %xmm6
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm11, 3 * SIZE(Y1)
kusano 2b45e8
	movsd	 7 * SIZE(Y1), %xmm11
kusano 2b45e8
	mulsd	 %xmm14, %xmm7
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm4,  %xmm8
kusano 2b45e8
 	movsd	 12 * SIZE(A1), %xmm4
kusano 2b45e8
	addsd	 %xmm5,  %xmm9
kusano 2b45e8
 	movsd	 13 * SIZE(A1), %xmm5
kusano 2b45e8
	addsd	 %xmm6,  %xmm10
kusano 2b45e8
	movsd	 14 * SIZE(A1), %xmm6
kusano 2b45e8
	addsd	 %xmm7,  %xmm11
kusano 2b45e8
	movsd	 15 * SIZE(A1), %xmm7
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm8,  4 * SIZE(Y1)
kusano 2b45e8
	movsd	  8 * SIZE(Y1), %xmm8
kusano 2b45e8
	mulsd	 %xmm14, %xmm0
kusano 2b45e8
	movsd	 %xmm9,  5 * SIZE(Y1)
kusano 2b45e8
	movsd	  9 * SIZE(Y1), %xmm9
kusano 2b45e8
	mulsd	 %xmm14, %xmm1
kusano 2b45e8
	movsd	 %xmm10, 6 * SIZE(Y1)
kusano 2b45e8
	movsd	 10 * SIZE(Y1), %xmm10
kusano 2b45e8
	mulsd	 %xmm14, %xmm2
kusano 2b45e8
	movsd	 %xmm11, 7 * SIZE(Y1)
kusano 2b45e8
	movsd	 11 * SIZE(Y1), %xmm11
kusano 2b45e8
	mulsd	 %xmm14, %xmm3
kusano 2b45e8
kusano 2b45e8
	addq	 $8 * SIZE, Y1
kusano 2b45e8
	addq	 $8 * SIZE, A1
kusano 2b45e8
kusano 2b45e8
	decq	 I
kusano 2b45e8
	jg	.L23
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L24:
kusano 2b45e8
	addsd	 %xmm0,  %xmm8
kusano 2b45e8
	addsd	 %xmm1,  %xmm9
kusano 2b45e8
	addsd	 %xmm2,  %xmm10
kusano 2b45e8
	addsd	 %xmm3,  %xmm11
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm4
kusano 2b45e8
	movsd	 %xmm8,  0 * SIZE(Y1)
kusano 2b45e8
	movsd	 4 * SIZE(Y1), %xmm8
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm5
kusano 2b45e8
	movsd	 %xmm9,  1 * SIZE(Y1)
kusano 2b45e8
	movsd	 5 * SIZE(Y1), %xmm9
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm6
kusano 2b45e8
	movsd	 %xmm10, 2 * SIZE(Y1)
kusano 2b45e8
	movsd	 6 * SIZE(Y1), %xmm10
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm7
kusano 2b45e8
	movsd	 %xmm11, 3 * SIZE(Y1)
kusano 2b45e8
	movsd	 7 * SIZE(Y1), %xmm11
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm4,  %xmm8
kusano 2b45e8
	addsd	 %xmm5,  %xmm9
kusano 2b45e8
	addsd	 %xmm6,  %xmm10
kusano 2b45e8
	addsd	 %xmm7,  %xmm11
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm8,  4 * SIZE(Y1)
kusano 2b45e8
	movsd	 %xmm9,  5 * SIZE(Y1)
kusano 2b45e8
	movsd	 %xmm10, 6 * SIZE(Y1)
kusano 2b45e8
	movsd	 %xmm11, 7 * SIZE(Y1)
kusano 2b45e8
kusano 2b45e8
	addq	 $8 * SIZE, Y1
kusano 2b45e8
	addq	 $8 * SIZE, A1
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L25:
kusano 2b45e8
	testq	$4, M
kusano 2b45e8
	je	.L27
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(A1), %xmm0
kusano 2b45e8
	movsd	 1 * SIZE(A1), %xmm1
kusano 2b45e8
	movsd	 2 * SIZE(A1), %xmm2
kusano 2b45e8
	movsd	 3 * SIZE(A1), %xmm3
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(Y1), %xmm8
kusano 2b45e8
	mulsd	 %xmm14, %xmm0
kusano 2b45e8
	movsd	 1 * SIZE(Y1), %xmm9
kusano 2b45e8
	mulsd	 %xmm14, %xmm1
kusano 2b45e8
	movsd	 2 * SIZE(Y1), %xmm10
kusano 2b45e8
	mulsd	 %xmm14, %xmm2
kusano 2b45e8
	movsd	 3 * SIZE(Y1), %xmm11
kusano 2b45e8
	mulsd	 %xmm14, %xmm3
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm0,  %xmm8
kusano 2b45e8
	addsd	 %xmm1,  %xmm9
kusano 2b45e8
	addsd	 %xmm2,  %xmm10
kusano 2b45e8
	addsd	 %xmm3,  %xmm11
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm8,  0 * SIZE(Y1)
kusano 2b45e8
	movsd	 %xmm9,  1 * SIZE(Y1)
kusano 2b45e8
	movsd	 %xmm10, 2 * SIZE(Y1)
kusano 2b45e8
	movsd	 %xmm11, 3 * SIZE(Y1)
kusano 2b45e8
kusano 2b45e8
	addq	 $4 * SIZE, A1
kusano 2b45e8
	addq	 $4 * SIZE, A2
kusano 2b45e8
	addq	 $4 * SIZE, Y1
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L27:
kusano 2b45e8
	testq	$2, M
kusano 2b45e8
	je	.L28
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(A1), %xmm0
kusano 2b45e8
	movsd	 1 * SIZE(A1), %xmm1
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm0
kusano 2b45e8
	movsd	 0 * SIZE(Y1), %xmm8
kusano 2b45e8
	mulsd	 %xmm14, %xmm1
kusano 2b45e8
	movsd	 1 * SIZE(Y1), %xmm9
kusano 2b45e8
kusano 2b45e8
	addsd	 %xmm0,  %xmm8
kusano 2b45e8
	addsd	 %xmm1,  %xmm9
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm8, 0 * SIZE(Y1)
kusano 2b45e8
	movsd	 %xmm9, 1 * SIZE(Y1)
kusano 2b45e8
kusano 2b45e8
	addq	 $2 * SIZE, A1
kusano 2b45e8
	addq	 $2 * SIZE, Y1
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L28:
kusano 2b45e8
	testq	$1, M
kusano 2b45e8
	je	.L990
kusano 2b45e8
kusano 2b45e8
	movsd	 0 * SIZE(Y1), %xmm8
kusano 2b45e8
	movsd	 0 * SIZE(A1), %xmm0
kusano 2b45e8
kusano 2b45e8
	mulsd	 %xmm14, %xmm0
kusano 2b45e8
	addsd	 %xmm0,  %xmm8
kusano 2b45e8
kusano 2b45e8
	movsd	 %xmm8, 0 * SIZE(Y1)
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L990:
kusano 2b45e8
	cmpq	$SIZE, INCY
kusano 2b45e8
	je	.L999
kusano 2b45e8
kusano 2b45e8
	movq	Y,  Y1
kusano 2b45e8
kusano 2b45e8
	movq	M,  %rax
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	jle	.L994
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L992:
kusano 2b45e8
	movsd	(Y), %xmm0
kusano 2b45e8
	addq	INCY, Y
kusano 2b45e8
	movsd	(Y), %xmm1
kusano 2b45e8
	addq	INCY, Y
kusano 2b45e8
	movsd	(Y), %xmm2
kusano 2b45e8
	addq	INCY, Y
kusano 2b45e8
	movsd	(Y), %xmm3
kusano 2b45e8
	addq	INCY, Y
kusano 2b45e8
kusano 2b45e8
	addsd	0 * SIZE(BUFFER), %xmm0
kusano 2b45e8
	addsd	1 * SIZE(BUFFER), %xmm1
kusano 2b45e8
	addsd	2 * SIZE(BUFFER), %xmm2
kusano 2b45e8
	addsd	3 * SIZE(BUFFER), %xmm3
kusano 2b45e8
	addq	$4 * SIZE, BUFFER
kusano 2b45e8
kusano 2b45e8
	movsd	%xmm0, (Y1)
kusano 2b45e8
	addq	INCY, Y1
kusano 2b45e8
	movsd	%xmm1, (Y1)
kusano 2b45e8
	addq	INCY, Y1
kusano 2b45e8
	movsd	%xmm2, (Y1)
kusano 2b45e8
	addq	INCY, Y1
kusano 2b45e8
	movsd	%xmm3, (Y1)
kusano 2b45e8
	addq	INCY, Y1
kusano 2b45e8
kusano 2b45e8
	decq	%rax
kusano 2b45e8
	jg	.L992
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L994:
kusano 2b45e8
	testq	$2, M
kusano 2b45e8
	jle	.L996
kusano 2b45e8
kusano 2b45e8
	movsd	(Y), %xmm0
kusano 2b45e8
	addq	INCY, Y
kusano 2b45e8
	movsd	(Y), %xmm1
kusano 2b45e8
	addq	INCY, Y
kusano 2b45e8
kusano 2b45e8
	addsd	0 * SIZE(BUFFER), %xmm0
kusano 2b45e8
	addsd	1 * SIZE(BUFFER), %xmm1
kusano 2b45e8
	addq	$2 * SIZE, BUFFER
kusano 2b45e8
kusano 2b45e8
	movsd	%xmm0, (Y1)
kusano 2b45e8
	addq	INCY, Y1
kusano 2b45e8
	movsd	%xmm1, (Y1)
kusano 2b45e8
	addq	INCY, Y1
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L996:
kusano 2b45e8
	testq	$1, M
kusano 2b45e8
	jle	.L999
kusano 2b45e8
kusano 2b45e8
	movsd	(Y), %xmm0
kusano 2b45e8
kusano 2b45e8
	addsd	(BUFFER), %xmm0
kusano 2b45e8
kusano 2b45e8
	movsd	%xmm0, (Y1)
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
kusano 2b45e8
#ifdef WINDOWS_ABI
kusano 2b45e8
	movq	 48(%rsp), %rdi
kusano 2b45e8
	movq	 56(%rsp), %rsi
kusano 2b45e8
	movups	 64(%rsp), %xmm6
kusano 2b45e8
	movups	 80(%rsp), %xmm7
kusano 2b45e8
	movups	 96(%rsp), %xmm8
kusano 2b45e8
	movups	112(%rsp), %xmm9
kusano 2b45e8
	movups	128(%rsp), %xmm10
kusano 2b45e8
	movups	144(%rsp), %xmm11
kusano 2b45e8
	movups	160(%rsp), %xmm12
kusano 2b45e8
	movups	176(%rsp), %xmm13
kusano 2b45e8
	movups	192(%rsp), %xmm14
kusano 2b45e8
	movups	208(%rsp), %xmm15
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	addq	$STACKSIZE, %rsp
kusano 2b45e8
	ret
kusano 2b45e8
	EPILOGUE