Blame thirdparty/openblas/xianyi-OpenBLAS-e6e87a2/kernel/x86_64/gemm_kernel_4x8_nehalem.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 OLD_M	%rdi
kusano 2b45e8
#define OLD_N	%rsi
kusano 2b45e8
#define OLD_K	%rdx
kusano 2b45e8
kusano 2b45e8
#define M	%r13
kusano 2b45e8
#define N	%r14
kusano 2b45e8
#define K	%r15
kusano 2b45e8
kusano 2b45e8
#define A	%rcx
kusano 2b45e8
#define B	%r8
kusano 2b45e8
#define C	%r9
kusano 2b45e8
#define LDC	%rbp
kusano 2b45e8
	
kusano 2b45e8
#define I	%r11
kusano 2b45e8
#define AO	%rdi
kusano 2b45e8
#define BO	%rsi
kusano 2b45e8
#define	CO1	%rbx
kusano 2b45e8
#define CO2	%rdx
kusano 2b45e8
#define BB	%r12
kusano 2b45e8
kusano 2b45e8
#define PREA	%r10
kusano 2b45e8
kusano 2b45e8
#ifndef WINDOWS_ABI
kusano 2b45e8
kusano 2b45e8
#define STACKSIZE 128
kusano 2b45e8
kusano 2b45e8
#define OLD_LDC		 8 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_OFFSET	16 + STACKSIZE(%rsp)
kusano 2b45e8
kusano 2b45e8
#define ALPHA	   48(%rsp)
kusano 2b45e8
#define J	   56(%rsp)
kusano 2b45e8
#define OFFSET	   64(%rsp)
kusano 2b45e8
#define KK	   72(%rsp)
kusano 2b45e8
#define KKK	   80(%rsp)
kusano 2b45e8
kusano 2b45e8
#else
kusano 2b45e8
kusano 2b45e8
#define STACKSIZE 512
kusano 2b45e8
kusano 2b45e8
#define OLD_A		40 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_B		48 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_C		56 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_LDC		64 + STACKSIZE(%rsp)
kusano 2b45e8
#define OLD_OFFSET	72 + STACKSIZE(%rsp)
kusano 2b45e8
kusano 2b45e8
#define ALPHA	  224(%rsp)
kusano 2b45e8
#define J	  232(%rsp)
kusano 2b45e8
#define OFFSET	  240(%rsp)
kusano 2b45e8
#define KK	  248(%rsp)
kusano 2b45e8
#define KKK	  256(%rsp)
kusano 2b45e8
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#define PREFETCHSIZE  8
kusano 2b45e8
#define PREFETCH     prefetcht0
kusano 2b45e8
kusano 2b45e8
	PROLOGUE
kusano 2b45e8
	PROFCODE
kusano 2b45e8
	
kusano 2b45e8
	subq	$STACKSIZE, %rsp
kusano 2b45e8
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	ARG1,      OLD_M
kusano 2b45e8
	movq	ARG2,      OLD_N
kusano 2b45e8
	movq	ARG3,      OLD_K
kusano 2b45e8
	movq	OLD_A,     A
kusano 2b45e8
	movq	OLD_B,     B
kusano 2b45e8
	movq	OLD_C,     C
kusano 2b45e8
	movq	OLD_LDC,   LDC
kusano 2b45e8
#ifdef TRMMKERNEL
kusano 2b45e8
	movq	OLD_OFFSET, %r11
kusano 2b45e8
#endif
kusano 2b45e8
	movaps	%xmm3, %xmm0
kusano 2b45e8
kusano 2b45e8
#else
kusano 2b45e8
	movq	OLD_LDC,   LDC
kusano 2b45e8
#ifdef TRMMKERNEL
kusano 2b45e8
	movq	OLD_OFFSET, %r11
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	unpcklps %xmm0, %xmm0
kusano 2b45e8
	movlps	 %xmm0, ALPHA
kusano 2b45e8
	
kusano 2b45e8
	subq	$-32 * SIZE, A
kusano 2b45e8
	subq	$-32 * SIZE, B
kusano 2b45e8
kusano 2b45e8
	movq	OLD_M, M
kusano 2b45e8
	movq	OLD_N, N
kusano 2b45e8
	movq	OLD_K, K
kusano 2b45e8
kusano 2b45e8
	salq	$BASE_SHIFT, LDC
kusano 2b45e8
kusano 2b45e8
#ifdef TRMMKERNEL
kusano 2b45e8
	movq	%r11, OFFSET
kusano 2b45e8
#ifndef LEFT
kusano 2b45e8
	negq	%r11
kusano 2b45e8
#endif	
kusano 2b45e8
	movq	%r11, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movq	N,  J
kusano 2b45e8
	sarq	$3, J
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L40
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L10:
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
        movq    OFFSET, %rax
kusano 2b45e8
	movq    %rax, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movq	C, CO1
kusano 2b45e8
	leaq	(C, LDC, 4), CO2
kusano 2b45e8
	movq	A, AO
kusano 2b45e8
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	salq	$BASE_SHIFT + 3, %rax
kusano 2b45e8
	leaq	(B, %rax), BB
kusano 2b45e8
kusano 2b45e8
	movq	M,  I
kusano 2b45e8
	sarq	$2, I
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L20
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L11:
kusano 2b45e8
	prefetcht2	 -32 * SIZE(BB)
kusano 2b45e8
	subq		 $-16 * SIZE, BB
kusano 2b45e8
kusano 2b45e8
#if !defined(TRMMKERNEL) || \
kusano 2b45e8
	(defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
	(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
#else
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
	leaq	(, %rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 4), AO
kusano 2b45e8
	leaq	(BO, %rax, 8), BO
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
	leaq	(LDC, LDC, 2), %rax
kusano 2b45e8
kusano 2b45e8
	xorps	%xmm1, %xmm1
kusano 2b45e8
	xorps	%xmm2, %xmm2
kusano 2b45e8
	xorps	%xmm3, %xmm3
kusano 2b45e8
	PADDING
kusano 2b45e8
	xorps	%xmm4, %xmm4
kusano 2b45e8
kusano 2b45e8
	PADDING
kusano 2b45e8
	xorps	%xmm8,  %xmm8
kusano 2b45e8
	prefetcht0     3 * SIZE(CO1)
kusano 2b45e8
	xorps	%xmm9,  %xmm9
kusano 2b45e8
	prefetcht0     7 * SIZE(CO1, LDC,  1)
kusano 2b45e8
	PADDING
kusano 2b45e8
	xorps	%xmm10, %xmm10
kusano 2b45e8
	prefetcht0     3 * SIZE(CO1, LDC,  2)
kusano 2b45e8
	PADDING
kusano 2b45e8
	xorps	%xmm11, %xmm11
kusano 2b45e8
	prefetcht0     7 * SIZE(CO1, %rax, 1)
kusano 2b45e8
kusano 2b45e8
	movaps	-32 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	PADDING
kusano 2b45e8
	xorps	%xmm12, %xmm12
kusano 2b45e8
	prefetcht0     3 * SIZE(CO2)
kusano 2b45e8
	xorps	%xmm13, %xmm13
kusano 2b45e8
	prefetcht0     7 * SIZE(CO2, LDC,  1)
kusano 2b45e8
	xorps	%xmm14, %xmm14
kusano 2b45e8
	prefetcht0     3 * SIZE(CO2, LDC,  2)
kusano 2b45e8
	xorps	%xmm15, %xmm15
kusano 2b45e8
	prefetcht0     7 * SIZE(CO2, %rax, 1)
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KK, %rax
kusano 2b45e8
	movq	%rax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addq	$4, %rax
kusano 2b45e8
#else
kusano 2b45e8
	addq	$8, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	movq	%rax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L15
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L12:	
kusano 2b45e8
	PREFETCH	(PREFETCHSIZE +  0) * SIZE(AO)
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm12
kusano 2b45e8
	movaps	-32 * SIZE(BO), %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm13
kusano 2b45e8
	pshufd	$0x39, %xmm1, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	pshufd	$0x39, %xmm2, %xmm5
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
kusano 2b45e8
	addps	%xmm3, %xmm14
kusano 2b45e8
	addps	%xmm4, %xmm15
kusano 2b45e8
	pshufd	$0x39, %xmm5, %xmm6
kusano 2b45e8
	mulps	%xmm0, %xmm5
kusano 2b45e8
	mulps	%xmm0, %xmm6
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movaps	-28 * SIZE(BO), %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0x39, %xmm1, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	pshufd	$0x39, %xmm2, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
kusano 2b45e8
	addps	%xmm5, %xmm10
kusano 2b45e8
	addps	%xmm6, %xmm11
kusano 2b45e8
	pshufd	$0x39, %xmm3, %xmm4
kusano 2b45e8
 	movaps	-28 * SIZE(AO), %xmm7
kusano 2b45e8
	mulps	%xmm0, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm4
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm12
kusano 2b45e8
	movaps	-24 * SIZE(BO), %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm13
kusano 2b45e8
	pshufd	$0x39, %xmm1, %xmm2
kusano 2b45e8
	mulps	%xmm7, %xmm1
kusano 2b45e8
	pshufd	$0x39, %xmm2, %xmm5
kusano 2b45e8
	mulps	%xmm7, %xmm2
kusano 2b45e8
kusano 2b45e8
	addps	%xmm3, %xmm14
kusano 2b45e8
	addps	%xmm4, %xmm15
kusano 2b45e8
	pshufd	$0x39, %xmm5, %xmm6
kusano 2b45e8
	mulps	%xmm7, %xmm5
kusano 2b45e8
	mulps	%xmm7, %xmm6
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movaps	-20 * SIZE(BO), %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0x39, %xmm1, %xmm2
kusano 2b45e8
	mulps	%xmm7, %xmm1
kusano 2b45e8
	pshufd	$0x39, %xmm2, %xmm3
kusano 2b45e8
	mulps	%xmm7, %xmm2
kusano 2b45e8
kusano 2b45e8
	addps	%xmm5, %xmm10
kusano 2b45e8
	addps	%xmm6, %xmm11
kusano 2b45e8
	pshufd	$0x39, %xmm3, %xmm4
kusano 2b45e8
	movaps	-24 * SIZE(AO), %xmm0
kusano 2b45e8
	mulps	%xmm7, %xmm3
kusano 2b45e8
	mulps	%xmm7, %xmm4
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm12
kusano 2b45e8
	movaps	-16 * SIZE(BO), %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm13
kusano 2b45e8
	pshufd	$0x39, %xmm1, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	pshufd	$0x39, %xmm2, %xmm5
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
kusano 2b45e8
	addps	%xmm3, %xmm14
kusano 2b45e8
	addps	%xmm4, %xmm15
kusano 2b45e8
	pshufd	$0x39, %xmm5, %xmm6
kusano 2b45e8
	mulps	%xmm0, %xmm5
kusano 2b45e8
	mulps	%xmm0, %xmm6
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movaps	-12 * SIZE(BO), %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0x39, %xmm1, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	pshufd	$0x39, %xmm2, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
kusano 2b45e8
	addps	%xmm5, %xmm10
kusano 2b45e8
	addps	%xmm6, %xmm11
kusano 2b45e8
	pshufd	$0x39, %xmm3, %xmm4
kusano 2b45e8
	movaps	-20 * SIZE(AO), %xmm7
kusano 2b45e8
	mulps	%xmm0, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm4
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm12
kusano 2b45e8
	movaps	 -8 * SIZE(BO), %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm13
kusano 2b45e8
	pshufd	$0x39, %xmm1, %xmm2
kusano 2b45e8
	mulps	%xmm7, %xmm1
kusano 2b45e8
	pshufd	$0x39, %xmm2, %xmm5
kusano 2b45e8
	mulps	%xmm7, %xmm2
kusano 2b45e8
kusano 2b45e8
	addps	%xmm3, %xmm14
kusano 2b45e8
	addps	%xmm4, %xmm15
kusano 2b45e8
	pshufd	$0x39, %xmm5, %xmm6
kusano 2b45e8
	mulps	%xmm7, %xmm5
kusano 2b45e8
	mulps	%xmm7, %xmm6
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movaps	 -4 * SIZE(BO), %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	subq	$-32 * SIZE, BO
kusano 2b45e8
	pshufd	$0x39, %xmm1, %xmm2
kusano 2b45e8
	mulps	%xmm7, %xmm1
kusano 2b45e8
	pshufd	$0x39, %xmm2, %xmm3
kusano 2b45e8
	mulps	%xmm7, %xmm2
kusano 2b45e8
kusano 2b45e8
	addps	%xmm5, %xmm10
kusano 2b45e8
	addps	%xmm6, %xmm11
kusano 2b45e8
	pshufd	$0x39, %xmm3, %xmm4
kusano 2b45e8
	mulps	%xmm7, %xmm3
kusano 2b45e8
	movaps	-16 * SIZE(AO), %xmm0
kusano 2b45e8
	mulps	%xmm7, %xmm4
kusano 2b45e8
kusano 2b45e8
	subq	$-16 * SIZE, AO
kusano 2b45e8
	decq	%rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L12
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L15:
kusano 2b45e8
	movddup	ALPHA, %xmm7
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#else
kusano 2b45e8
	movq	KKK, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	andq	$3, %rax		# if (k & 1)
kusano 2b45e8
	BRANCH
kusano 2b45e8
	je	.L18
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L16:
kusano 2b45e8
	addps	%xmm1, %xmm12
kusano 2b45e8
	movaps	-32 * SIZE(BO), %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm13
kusano 2b45e8
	pshufd	$0x39, %xmm1, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	pshufd	$0x39, %xmm2, %xmm5
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
kusano 2b45e8
	addps	%xmm3, %xmm14
kusano 2b45e8
	addps	%xmm4, %xmm15
kusano 2b45e8
	pshufd	$0x39, %xmm5, %xmm6
kusano 2b45e8
	mulps	%xmm0, %xmm5
kusano 2b45e8
	mulps	%xmm0, %xmm6
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movaps	-28 * SIZE(BO), %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0x39, %xmm1, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	pshufd	$0x39, %xmm2, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
kusano 2b45e8
	addps	%xmm5, %xmm10
kusano 2b45e8
	addps	%xmm6, %xmm11
kusano 2b45e8
	pshufd	$0x39, %xmm3, %xmm4
kusano 2b45e8
	mulps	%xmm0, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm4
kusano 2b45e8
kusano 2b45e8
	movaps	-28 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addq	$4 * SIZE, AO
kusano 2b45e8
	addq	$8 * SIZE, BO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L16
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L18:
kusano 2b45e8
	addps	%xmm1, %xmm12
kusano 2b45e8
	addps	%xmm2, %xmm13
kusano 2b45e8
	addps	%xmm3, %xmm14
kusano 2b45e8
	addps	%xmm4, %xmm15
kusano 2b45e8
kusano 2b45e8
	movaps	%xmm9, %xmm4
kusano 2b45e8
	shufps	$0xd8, %xmm8, %xmm9
kusano 2b45e8
	shufps	$0xd8, %xmm11, %xmm8
kusano 2b45e8
	shufps	$0xd8, %xmm10, %xmm11
kusano 2b45e8
	shufps	$0xd8, %xmm4, %xmm10
kusano 2b45e8
kusano 2b45e8
	movaps	%xmm8, %xmm4
kusano 2b45e8
	shufps	$0xd8, %xmm10, %xmm8
kusano 2b45e8
	shufps	$0xd8, %xmm4, %xmm10
kusano 2b45e8
	movaps	%xmm9, %xmm5
kusano 2b45e8
	shufps	$0xd8, %xmm11, %xmm9
kusano 2b45e8
	shufps	$0xd8, %xmm5, %xmm11
kusano 2b45e8
kusano 2b45e8
	movaps	%xmm13, %xmm4
kusano 2b45e8
	shufps	$0xd8, %xmm12, %xmm13
kusano 2b45e8
	shufps	$0xd8, %xmm15, %xmm12
kusano 2b45e8
	shufps	$0xd8, %xmm14, %xmm15
kusano 2b45e8
	shufps	$0xd8, %xmm4, %xmm14
kusano 2b45e8
kusano 2b45e8
	movaps	%xmm12, %xmm4
kusano 2b45e8
	shufps	$0xd8, %xmm14, %xmm12
kusano 2b45e8
	shufps	$0xd8, %xmm4, %xmm14
kusano 2b45e8
	movaps	%xmm13, %xmm5
kusano 2b45e8
	shufps	$0xd8, %xmm15, %xmm13
kusano 2b45e8
	shufps	$0xd8, %xmm5, %xmm15
kusano 2b45e8
kusano 2b45e8
	mulps	%xmm7, %xmm8
kusano 2b45e8
	mulps	%xmm7, %xmm9
kusano 2b45e8
	mulps	%xmm7, %xmm10
kusano 2b45e8
	mulps	%xmm7, %xmm11
kusano 2b45e8
kusano 2b45e8
	mulps	%xmm7, %xmm12
kusano 2b45e8
	mulps	%xmm7, %xmm13
kusano 2b45e8
	mulps	%xmm7, %xmm14
kusano 2b45e8
	mulps	%xmm7, %xmm15
kusano 2b45e8
kusano 2b45e8
	leaq	(LDC, LDC, 2), %rax
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movups	(CO1), %xmm0
kusano 2b45e8
	movups	(CO1, LDC,  1), %xmm1
kusano 2b45e8
	movups	(CO1, LDC,  2), %xmm2
kusano 2b45e8
	movups	(CO1, %rax, 1), %xmm3
kusano 2b45e8
kusano 2b45e8
	movups	(CO2), %xmm4
kusano 2b45e8
	movups	(CO2, LDC,  1), %xmm5
kusano 2b45e8
	movups	(CO2, LDC,  2), %xmm6
kusano 2b45e8
	movups	(CO2, %rax, 1), %xmm7
kusano 2b45e8
kusano 2b45e8
	addps	%xmm0, %xmm8
kusano 2b45e8
	addps	%xmm1, %xmm9
kusano 2b45e8
	addps	%xmm2, %xmm10
kusano 2b45e8
	addps	%xmm3, %xmm11
kusano 2b45e8
	addps	%xmm4, %xmm12
kusano 2b45e8
	addps	%xmm5, %xmm13
kusano 2b45e8
	addps	%xmm6, %xmm14
kusano 2b45e8
	addps	%xmm7, %xmm15
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movups	%xmm8,  (CO1)
kusano 2b45e8
	movups	%xmm9,  (CO1, LDC,  1)
kusano 2b45e8
	movups	%xmm10, (CO1, LDC,  2)
kusano 2b45e8
	movups	%xmm11, (CO1, %rax, 1)
kusano 2b45e8
kusano 2b45e8
	movups	%xmm12, (CO2)
kusano 2b45e8
	movups	%xmm13, (CO2, LDC,  1)
kusano 2b45e8
	movups	%xmm14, (CO2, LDC,  2)
kusano 2b45e8
	movups	%xmm15, (CO2, %rax, 1)
kusano 2b45e8
kusano 2b45e8
#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KKK, %rax
kusano 2b45e8
	leaq	(,%rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 4), AO
kusano 2b45e8
	leaq	(BO, %rax, 8), BO
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	addq	$4, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	addq	$4 * SIZE, CO1
kusano 2b45e8
	addq	$4 * SIZE, CO2
kusano 2b45e8
	decq	I
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L11
kusano 2b45e8
	ALIGN_4	
kusano 2b45e8
kusano 2b45e8
.L20:
kusano 2b45e8
	testq	$2, M
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jle	.L30
kusano 2b45e8
kusano 2b45e8
#if !defined(TRMMKERNEL) || \
kusano 2b45e8
	(defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
	(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
#else
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
	leaq	(, %rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 2), AO
kusano 2b45e8
	leaq	(BO, %rax, 8), BO
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
	xorps	%xmm1, %xmm1
kusano 2b45e8
	movddup	-32 * SIZE(AO), %xmm0
kusano 2b45e8
	xorps	%xmm2, %xmm2
kusano 2b45e8
	movaps	-32 * SIZE(BO), %xmm5
kusano 2b45e8
	xorps	%xmm3, %xmm3
kusano 2b45e8
	xorps	%xmm4, %xmm4
kusano 2b45e8
kusano 2b45e8
	xorps	%xmm8,  %xmm8
kusano 2b45e8
	xorps	%xmm9,  %xmm9
kusano 2b45e8
	xorps	%xmm10, %xmm10
kusano 2b45e8
	xorps	%xmm11, %xmm11
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KK, %rax
kusano 2b45e8
	movq	%rax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addq	$2, %rax
kusano 2b45e8
#else
kusano 2b45e8
	addq	$8, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	movq	%rax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L25
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L22:	
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x50, %xmm5, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0xfa, %xmm5, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
	movaps	-28 * SIZE(BO), %xmm5
kusano 2b45e8
kusano 2b45e8
	addps	%xmm3, %xmm10
kusano 2b45e8
	pshufd	$0x50, %xmm5, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm3
kusano 2b45e8
	addps	%xmm4, %xmm11
kusano 2b45e8
	pshufd	$0xfa, %xmm5, %xmm4
kusano 2b45e8
	mulps	%xmm0, %xmm4
kusano 2b45e8
	movaps	-24 * SIZE(BO), %xmm5
kusano 2b45e8
kusano 2b45e8
	movddup	-30 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x50, %xmm5, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0xfa, %xmm5, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
	movaps	-20 * SIZE(BO), %xmm5
kusano 2b45e8
kusano 2b45e8
	addps	%xmm3, %xmm10
kusano 2b45e8
	pshufd	$0x50, %xmm5, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm3
kusano 2b45e8
	addps	%xmm4, %xmm11
kusano 2b45e8
	pshufd	$0xfa, %xmm5, %xmm4
kusano 2b45e8
	mulps	%xmm0, %xmm4
kusano 2b45e8
	movaps	-16 * SIZE(BO), %xmm5
kusano 2b45e8
kusano 2b45e8
	movddup	-28 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x50, %xmm5, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0xfa, %xmm5, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
	movaps	-12 * SIZE(BO), %xmm5
kusano 2b45e8
kusano 2b45e8
	addps	%xmm3, %xmm10
kusano 2b45e8
	pshufd	$0x50, %xmm5, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm3
kusano 2b45e8
	addps	%xmm4, %xmm11
kusano 2b45e8
	pshufd	$0xfa, %xmm5, %xmm4
kusano 2b45e8
	mulps	%xmm0, %xmm4
kusano 2b45e8
	movaps	 -8 * SIZE(BO), %xmm5
kusano 2b45e8
kusano 2b45e8
	movddup	-26 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x50, %xmm5, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0xfa, %xmm5, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
	movaps	 -4 * SIZE(BO), %xmm5
kusano 2b45e8
kusano 2b45e8
	addps	%xmm3, %xmm10
kusano 2b45e8
	pshufd	$0x50, %xmm5, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm3
kusano 2b45e8
	addps	%xmm4, %xmm11
kusano 2b45e8
	pshufd	$0xfa, %xmm5, %xmm4
kusano 2b45e8
	mulps	%xmm0, %xmm4
kusano 2b45e8
	movaps	 0 * SIZE(BO), %xmm5
kusano 2b45e8
kusano 2b45e8
	movddup	-24 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	subq	$-32 * SIZE, BO
kusano 2b45e8
	subq	$ -8 * SIZE, AO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L22
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L25:
kusano 2b45e8
	movddup	ALPHA, %xmm7
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#else
kusano 2b45e8
	movq	KKK, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	andq	$3, %rax		# if (k & 1)
kusano 2b45e8
	BRANCH
kusano 2b45e8
	je	.L28
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L26:
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x50, %xmm5, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0xfa, %xmm5, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
	movaps	-28 * SIZE(BO), %xmm5
kusano 2b45e8
kusano 2b45e8
	addps	%xmm3, %xmm10
kusano 2b45e8
	pshufd	$0x50, %xmm5, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm3
kusano 2b45e8
	addps	%xmm4, %xmm11
kusano 2b45e8
	pshufd	$0xfa, %xmm5, %xmm4
kusano 2b45e8
	mulps	%xmm0, %xmm4
kusano 2b45e8
	movaps	-24 * SIZE(BO), %xmm5
kusano 2b45e8
kusano 2b45e8
	movddup	-30 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addq	$2 * SIZE, AO
kusano 2b45e8
	addq	$8 * SIZE, BO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L26
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L28:
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	addps	%xmm3, %xmm10
kusano 2b45e8
	addps	%xmm4, %xmm11
kusano 2b45e8
kusano 2b45e8
	mulps	%xmm7, %xmm8
kusano 2b45e8
	mulps	%xmm7, %xmm9
kusano 2b45e8
	mulps	%xmm7, %xmm10
kusano 2b45e8
	mulps	%xmm7, %xmm11
kusano 2b45e8
kusano 2b45e8
	leaq	(LDC, LDC, 2), %rax
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movsd	(CO1), %xmm0
kusano 2b45e8
	movhps	(CO1, LDC,  1), %xmm0
kusano 2b45e8
	movsd	(CO1, LDC,  2), %xmm1
kusano 2b45e8
	movhps	(CO1, %rax, 1), %xmm1
kusano 2b45e8
kusano 2b45e8
	movsd	(CO2), %xmm2
kusano 2b45e8
	movhps	(CO2, LDC,  1), %xmm2
kusano 2b45e8
	movsd	(CO2, LDC,  2), %xmm3
kusano 2b45e8
	movhps	(CO2, %rax, 1), %xmm3
kusano 2b45e8
kusano 2b45e8
	addps	%xmm0, %xmm8
kusano 2b45e8
	addps	%xmm1, %xmm9
kusano 2b45e8
	addps	%xmm2, %xmm10
kusano 2b45e8
	addps	%xmm3, %xmm11
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movsd	%xmm8,  (CO1)
kusano 2b45e8
	movhps	%xmm8,  (CO1, LDC,  1)
kusano 2b45e8
	movsd	%xmm9, (CO1, LDC,  2)
kusano 2b45e8
	movhps	%xmm9, (CO1, %rax, 1)
kusano 2b45e8
kusano 2b45e8
	movsd	%xmm10, (CO2)
kusano 2b45e8
	movhps	%xmm10, (CO2, LDC,  1)
kusano 2b45e8
	movsd	%xmm11, (CO2, LDC,  2)
kusano 2b45e8
	movhps	%xmm11, (CO2, %rax, 1)
kusano 2b45e8
kusano 2b45e8
#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KKK, %rax
kusano 2b45e8
	leaq	(,%rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 2), AO
kusano 2b45e8
	leaq	(BO, %rax, 8), BO
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	addq	$2, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	addq	$2 * SIZE, CO1
kusano 2b45e8
	addq	$2 * SIZE, CO2
kusano 2b45e8
	ALIGN_4	
kusano 2b45e8
kusano 2b45e8
.L30:
kusano 2b45e8
	testq	$1, M
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jle	.L39
kusano 2b45e8
kusano 2b45e8
#if !defined(TRMMKERNEL) || \
kusano 2b45e8
	(defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
	(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
#else
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
	leaq	(, %rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 1), AO
kusano 2b45e8
	leaq	(BO, %rax, 8), BO
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
	xorps	%xmm2, %xmm2
kusano 2b45e8
	movsd	-32 * SIZE(AO), %xmm0
kusano 2b45e8
	xorps	%xmm3, %xmm3
kusano 2b45e8
	xorps	%xmm8,  %xmm8
kusano 2b45e8
	xorps	%xmm12, %xmm12
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KK, %rax
kusano 2b45e8
	movq	%rax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addq	$1, %rax
kusano 2b45e8
#else
kusano 2b45e8
	addq	$8, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	movq	%rax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L35
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L32:	
kusano 2b45e8
	pshufd	$0x00, %xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm8
kusano 2b45e8
	movaps	-32 * SIZE(BO), %xmm2
kusano 2b45e8
	mulps	%xmm1, %xmm2
kusano 2b45e8
	addps	%xmm3, %xmm12
kusano 2b45e8
	movaps	-28 * SIZE(BO), %xmm3
kusano 2b45e8
	mulps	%xmm1, %xmm3
kusano 2b45e8
kusano 2b45e8
	pshufd	$0x55, %xmm0, %xmm1
kusano 2b45e8
	movsd	-30 * SIZE(AO), %xmm0
kusano 2b45e8
	addps	%xmm2, %xmm8
kusano 2b45e8
	movaps	-24 * SIZE(BO), %xmm2
kusano 2b45e8
	mulps	%xmm1, %xmm2
kusano 2b45e8
	addps	%xmm3, %xmm12
kusano 2b45e8
	movaps	-20 * SIZE(BO), %xmm3
kusano 2b45e8
	mulps	%xmm1, %xmm3
kusano 2b45e8
kusano 2b45e8
	pshufd	$0x00, %xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm8
kusano 2b45e8
	movaps	-16 * SIZE(BO), %xmm2
kusano 2b45e8
	mulps	%xmm1, %xmm2
kusano 2b45e8
	addps	%xmm3, %xmm12
kusano 2b45e8
	movaps	-12 * SIZE(BO), %xmm3
kusano 2b45e8
	mulps	%xmm1, %xmm3
kusano 2b45e8
kusano 2b45e8
	pshufd	$0x55, %xmm0, %xmm1
kusano 2b45e8
	movsd	-28 * SIZE(AO), %xmm0
kusano 2b45e8
	addps	%xmm2, %xmm8
kusano 2b45e8
	movaps	 -8 * SIZE(BO), %xmm2
kusano 2b45e8
	mulps	%xmm1, %xmm2
kusano 2b45e8
	addps	%xmm3, %xmm12
kusano 2b45e8
	movaps	 -4 * SIZE(BO), %xmm3
kusano 2b45e8
	mulps	%xmm1, %xmm3
kusano 2b45e8
kusano 2b45e8
	subq	$-32 * SIZE, BO
kusano 2b45e8
	subq	$ -4 * SIZE, AO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L32
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L35:
kusano 2b45e8
	movddup	ALPHA, %xmm7
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#else
kusano 2b45e8
	movq	KKK, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	andq	$3, %rax		# if (k & 1)
kusano 2b45e8
	BRANCH
kusano 2b45e8
	je	.L38
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L36:
kusano 2b45e8
	pshufd	$0x00, %xmm0, %xmm1
kusano 2b45e8
	movss	-31 * SIZE(AO), %xmm0
kusano 2b45e8
	addps	%xmm2, %xmm8
kusano 2b45e8
	movaps	-32 * SIZE(BO), %xmm2
kusano 2b45e8
	mulps	%xmm1, %xmm2
kusano 2b45e8
	addps	%xmm3, %xmm12
kusano 2b45e8
	movaps	-28 * SIZE(BO), %xmm3
kusano 2b45e8
	mulps	%xmm1, %xmm3
kusano 2b45e8
kusano 2b45e8
	addq	$1 * SIZE, AO
kusano 2b45e8
	addq	$8 * SIZE, BO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L36
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L38:
kusano 2b45e8
	addps	%xmm2, %xmm8
kusano 2b45e8
	addps	%xmm3, %xmm12
kusano 2b45e8
kusano 2b45e8
	mulps	%xmm7, %xmm8
kusano 2b45e8
	mulps	%xmm7, %xmm12
kusano 2b45e8
kusano 2b45e8
	pshufd	$0xff, %xmm8,  %xmm11
kusano 2b45e8
	pshufd	$0xaa, %xmm8,  %xmm10
kusano 2b45e8
	pshufd	$0x55, %xmm8,  %xmm9
kusano 2b45e8
	pshufd	$0x00, %xmm8,  %xmm8
kusano 2b45e8
kusano 2b45e8
	pshufd	$0xff, %xmm12, %xmm15
kusano 2b45e8
	pshufd	$0xaa, %xmm12, %xmm14
kusano 2b45e8
	pshufd	$0x55, %xmm12, %xmm13
kusano 2b45e8
	pshufd	$0x00, %xmm12, %xmm12
kusano 2b45e8
kusano 2b45e8
	leaq	(LDC, LDC, 2), %rax
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	addss	(CO1), %xmm8
kusano 2b45e8
	addss	(CO1, LDC,  1), %xmm9
kusano 2b45e8
	addss	(CO1, LDC,  2), %xmm10
kusano 2b45e8
	addss	(CO1, %rax, 1), %xmm11
kusano 2b45e8
kusano 2b45e8
	addss	(CO2), %xmm12
kusano 2b45e8
	addss	(CO2, LDC,  1), %xmm13
kusano 2b45e8
	addss	(CO2, LDC,  2), %xmm14
kusano 2b45e8
	addss	(CO2, %rax, 1), %xmm15
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movss	%xmm8,  (CO1)
kusano 2b45e8
	movss	%xmm9,  (CO1, LDC,  1)
kusano 2b45e8
	movss	%xmm10, (CO1, LDC,  2)
kusano 2b45e8
	movss	%xmm11, (CO1, %rax, 1)
kusano 2b45e8
kusano 2b45e8
	movss	%xmm12, (CO2)
kusano 2b45e8
	movss	%xmm13, (CO2, LDC,  1)
kusano 2b45e8
	movss	%xmm14, (CO2, LDC,  2)
kusano 2b45e8
	movss	%xmm15, (CO2, %rax, 1)
kusano 2b45e8
kusano 2b45e8
#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KKK, %rax
kusano 2b45e8
	leaq	(,%rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 1), AO
kusano 2b45e8
	leaq	(BO, %rax, 8), BO
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	addq	$1, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	ALIGN_4	
kusano 2b45e8
	
kusano 2b45e8
.L39:
kusano 2b45e8
#if defined(TRMMKERNEL) && !defined(LEFT)
kusano 2b45e8
	addq	$8, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movq	BO, B
kusano 2b45e8
kusano 2b45e8
	leaq	(C, LDC, 8), C
kusano 2b45e8
kusano 2b45e8
	subq	$1, J
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L10
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L40:
kusano 2b45e8
	testq	$4, N
kusano 2b45e8
	jle	.L70
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
        movq    OFFSET, %rax
kusano 2b45e8
	movq    %rax, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movq	C, CO1
kusano 2b45e8
	leaq	(C, LDC, 2), CO2
kusano 2b45e8
	movq	A, AO
kusano 2b45e8
kusano 2b45e8
	movq	M,  I
kusano 2b45e8
	sarq	$2, I
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L50
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L41:
kusano 2b45e8
#if !defined(TRMMKERNEL) || \
kusano 2b45e8
	(defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
	(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
#else
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
	leaq	(, %rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 4), AO
kusano 2b45e8
	leaq	(BO, %rax, 4), BO
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
	xorps	%xmm1, %xmm1
kusano 2b45e8
	movaps	-32 * SIZE(AO), %xmm0
kusano 2b45e8
	xorps	%xmm2, %xmm2
kusano 2b45e8
	xorps	%xmm3, %xmm3
kusano 2b45e8
	xorps	%xmm4, %xmm4
kusano 2b45e8
kusano 2b45e8
	xorps	%xmm8,  %xmm8
kusano 2b45e8
	prefetcht2     4 * SIZE(CO1)
kusano 2b45e8
	xorps	%xmm9,  %xmm9
kusano 2b45e8
	prefetcht2     4 * SIZE(CO1, LDC,  1)
kusano 2b45e8
	xorps	%xmm10, %xmm10
kusano 2b45e8
	prefetcht2     4 * SIZE(CO2)
kusano 2b45e8
	xorps	%xmm11, %xmm11
kusano 2b45e8
	prefetcht2     4 * SIZE(CO2, LDC,  1)
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KK, %rax
kusano 2b45e8
	movq	%rax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addq	$4, %rax
kusano 2b45e8
#else
kusano 2b45e8
	addq	$4, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	movq	%rax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L45
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L42:	
kusano 2b45e8
	PREFETCH	(PREFETCHSIZE +  0) * SIZE(AO)
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movaps	-32 * SIZE(BO), %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0x39, %xmm1, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm3, %xmm10
kusano 2b45e8
	pshufd	$0x39, %xmm2, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
kusano 2b45e8
	addps	%xmm4, %xmm11
kusano 2b45e8
	pshufd	$0x39, %xmm3, %xmm4
kusano 2b45e8
	mulps	%xmm0, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm4
kusano 2b45e8
	movaps	-28 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movaps	-28 * SIZE(BO), %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0x39, %xmm1, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm3, %xmm10
kusano 2b45e8
	pshufd	$0x39, %xmm2, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
kusano 2b45e8
	addps	%xmm4, %xmm11
kusano 2b45e8
	pshufd	$0x39, %xmm3, %xmm4
kusano 2b45e8
	mulps	%xmm0, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm4
kusano 2b45e8
	movaps	-24 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movaps	-24 * SIZE(BO), %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0x39, %xmm1, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm3, %xmm10
kusano 2b45e8
	pshufd	$0x39, %xmm2, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
kusano 2b45e8
	addps	%xmm4, %xmm11
kusano 2b45e8
	pshufd	$0x39, %xmm3, %xmm4
kusano 2b45e8
	mulps	%xmm0, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm4
kusano 2b45e8
	movaps	-20 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movaps	-20 * SIZE(BO), %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0x39, %xmm1, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm3, %xmm10
kusano 2b45e8
	pshufd	$0x39, %xmm2, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
kusano 2b45e8
	addps	%xmm4, %xmm11
kusano 2b45e8
	pshufd	$0x39, %xmm3, %xmm4
kusano 2b45e8
	mulps	%xmm0, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm4
kusano 2b45e8
	movaps	-16 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	subq	$-16 * SIZE, AO
kusano 2b45e8
	subq	$-16 * SIZE, BO
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L42
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L45:
kusano 2b45e8
	movddup	ALPHA, %xmm7
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#else
kusano 2b45e8
	movq	KKK, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	andq	$3, %rax		# if (k & 1)
kusano 2b45e8
	BRANCH
kusano 2b45e8
	je	.L48
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L46:
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movaps	-32 * SIZE(BO), %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0x39, %xmm1, %xmm2
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm3, %xmm10
kusano 2b45e8
	pshufd	$0x39, %xmm2, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
kusano 2b45e8
	addps	%xmm4, %xmm11
kusano 2b45e8
	pshufd	$0x39, %xmm3, %xmm4
kusano 2b45e8
	mulps	%xmm0, %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm4
kusano 2b45e8
	movaps	-28 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addq	$4 * SIZE, AO
kusano 2b45e8
	addq	$4 * SIZE, BO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L46
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L48:
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	addps	%xmm3, %xmm10
kusano 2b45e8
	addps	%xmm4, %xmm11
kusano 2b45e8
kusano 2b45e8
	movaps	%xmm9, %xmm4
kusano 2b45e8
	shufps	$0xd8, %xmm8, %xmm9
kusano 2b45e8
	shufps	$0xd8, %xmm11, %xmm8
kusano 2b45e8
	shufps	$0xd8, %xmm10, %xmm11
kusano 2b45e8
	shufps	$0xd8, %xmm4, %xmm10
kusano 2b45e8
kusano 2b45e8
	movaps	%xmm8, %xmm4
kusano 2b45e8
	shufps	$0xd8, %xmm10, %xmm8
kusano 2b45e8
	shufps	$0xd8, %xmm4, %xmm10
kusano 2b45e8
	movaps	%xmm9, %xmm5
kusano 2b45e8
	shufps	$0xd8, %xmm11, %xmm9
kusano 2b45e8
	shufps	$0xd8, %xmm5, %xmm11
kusano 2b45e8
kusano 2b45e8
	mulps	%xmm7, %xmm8
kusano 2b45e8
	mulps	%xmm7, %xmm9
kusano 2b45e8
	mulps	%xmm7, %xmm10
kusano 2b45e8
	mulps	%xmm7, %xmm11
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movsd	0 * SIZE(CO1), %xmm0
kusano 2b45e8
	movhps	2 * SIZE(CO1), %xmm0
kusano 2b45e8
	movsd	0 * SIZE(CO1, LDC,  1), %xmm1
kusano 2b45e8
 	movhps	2 * SIZE(CO1, LDC,  1), %xmm1
kusano 2b45e8
kusano 2b45e8
	movsd	0 * SIZE(CO2), %xmm2
kusano 2b45e8
	movhps	2 * SIZE(CO2), %xmm2
kusano 2b45e8
	movsd	0 * SIZE(CO2, LDC,  1), %xmm3
kusano 2b45e8
	movhps	2 * SIZE(CO2, LDC,  1), %xmm3
kusano 2b45e8
kusano 2b45e8
	addps	%xmm0, %xmm8
kusano 2b45e8
	addps	%xmm1, %xmm9
kusano 2b45e8
	addps	%xmm2, %xmm10
kusano 2b45e8
	addps	%xmm3, %xmm11
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movsd	%xmm8,  0 * SIZE(CO1)
kusano 2b45e8
	movhps	%xmm8,  2 * SIZE(CO1)
kusano 2b45e8
	movsd	%xmm9,  0 * SIZE(CO1, LDC,  1)
kusano 2b45e8
	movhps	%xmm9,  2 * SIZE(CO1, LDC,  1)
kusano 2b45e8
kusano 2b45e8
	movsd	%xmm10, 0 * SIZE(CO2)
kusano 2b45e8
	movhps	%xmm10, 2 * SIZE(CO2)
kusano 2b45e8
	movsd	%xmm11, 0 * SIZE(CO2, LDC,  1)
kusano 2b45e8
	movhps	%xmm11, 2 * SIZE(CO2, LDC,  1)
kusano 2b45e8
kusano 2b45e8
#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KKK, %rax
kusano 2b45e8
	leaq	(,%rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 4), AO
kusano 2b45e8
	leaq	(BO, %rax, 4), BO
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	addq	$4, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	addq	$4 * SIZE, CO1
kusano 2b45e8
	addq	$4 * SIZE, CO2
kusano 2b45e8
	decq	I
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L41
kusano 2b45e8
	ALIGN_4	
kusano 2b45e8
kusano 2b45e8
.L50:
kusano 2b45e8
	testq	$2, M
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jle	.L60
kusano 2b45e8
kusano 2b45e8
#if !defined(TRMMKERNEL) || \
kusano 2b45e8
	(defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
	(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
#else
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
	leaq	(, %rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 2), AO
kusano 2b45e8
	leaq	(BO, %rax, 4), BO
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
	xorps	%xmm1, %xmm1
kusano 2b45e8
	movddup	-32 * SIZE(AO), %xmm0
kusano 2b45e8
	xorps	%xmm2, %xmm2
kusano 2b45e8
	movaps	-32 * SIZE(BO), %xmm5
kusano 2b45e8
	xorps	%xmm8,  %xmm8
kusano 2b45e8
	xorps	%xmm9,  %xmm9
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KK, %rax
kusano 2b45e8
	movq	%rax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addq	$2, %rax
kusano 2b45e8
#else
kusano 2b45e8
	addq	$4, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	movq	%rax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L55
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L52:	
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x50, %xmm5, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0xfa, %xmm5, %xmm2
kusano 2b45e8
	movaps	-28 * SIZE(BO), %xmm5
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
	movddup	-30 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x50, %xmm5, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0xfa, %xmm5, %xmm2
kusano 2b45e8
	movaps	-24 * SIZE(BO), %xmm5
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
	movddup	-28 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x50, %xmm5, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0xfa, %xmm5, %xmm2
kusano 2b45e8
	movaps	-20 * SIZE(BO), %xmm5
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
	movddup	-26 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x50, %xmm5, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0xfa, %xmm5, %xmm2
kusano 2b45e8
	movaps	-16 * SIZE(BO), %xmm5
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
	movddup	-24 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	subq	$-16 * SIZE, BO
kusano 2b45e8
	subq	$ -8 * SIZE, AO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L52
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L55:
kusano 2b45e8
	movddup	ALPHA, %xmm7
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#else
kusano 2b45e8
	movq	KKK, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	andq	$3, %rax		# if (k & 1)
kusano 2b45e8
	BRANCH
kusano 2b45e8
	je	.L58
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L56:
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x50, %xmm5, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0xfa, %xmm5, %xmm2
kusano 2b45e8
	movaps	-28 * SIZE(BO), %xmm5
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
	movddup	-30 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addq	$2 * SIZE, AO
kusano 2b45e8
	addq	$4 * SIZE, BO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L56
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L58:
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
kusano 2b45e8
	mulps	%xmm7, %xmm8
kusano 2b45e8
	mulps	%xmm7, %xmm9
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movsd	(CO1), %xmm0
kusano 2b45e8
	movhps	(CO1, LDC,  1), %xmm0
kusano 2b45e8
	movsd	(CO2), %xmm1
kusano 2b45e8
	movhps	(CO2, LDC,  1), %xmm1
kusano 2b45e8
kusano 2b45e8
	addps	%xmm0, %xmm8
kusano 2b45e8
	addps	%xmm1, %xmm9
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movsd	%xmm8,  (CO1)
kusano 2b45e8
	movhps	%xmm8,  (CO1, LDC,  1)
kusano 2b45e8
	movsd	%xmm9,  (CO2)
kusano 2b45e8
	movhps	%xmm9,  (CO2, LDC,  1)
kusano 2b45e8
kusano 2b45e8
#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KKK, %rax
kusano 2b45e8
	leaq	(,%rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 2), AO
kusano 2b45e8
	leaq	(BO, %rax, 4), BO
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	addq	$2, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	addq	$2 * SIZE, CO1
kusano 2b45e8
	addq	$2 * SIZE, CO2
kusano 2b45e8
	ALIGN_4	
kusano 2b45e8
kusano 2b45e8
.L60:
kusano 2b45e8
	testq	$1, M
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jle	.L69
kusano 2b45e8
kusano 2b45e8
#if !defined(TRMMKERNEL) || \
kusano 2b45e8
	(defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
	(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
#else
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
	leaq	(, %rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 1), AO
kusano 2b45e8
	leaq	(BO, %rax, 4), BO
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
	xorps	%xmm2, %xmm2
kusano 2b45e8
	movsd	-32 * SIZE(AO), %xmm0
kusano 2b45e8
	xorps	%xmm8, %xmm8
kusano 2b45e8
	xorps	%xmm9, %xmm9
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KK, %rax
kusano 2b45e8
	movq	%rax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addq	$1, %rax
kusano 2b45e8
#else
kusano 2b45e8
	addq	$4, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	movq	%rax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L65
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L62:	
kusano 2b45e8
	pshufd	$0x00, %xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm8
kusano 2b45e8
	movaps	-32 * SIZE(BO), %xmm2
kusano 2b45e8
	mulps	%xmm1, %xmm2
kusano 2b45e8
kusano 2b45e8
	pshufd	$0x55, %xmm0, %xmm1
kusano 2b45e8
	movsd	-30 * SIZE(AO), %xmm0
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	movaps	-28 * SIZE(BO), %xmm2
kusano 2b45e8
	mulps	%xmm1, %xmm2
kusano 2b45e8
kusano 2b45e8
	pshufd	$0x00, %xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm8
kusano 2b45e8
	movaps	-24 * SIZE(BO), %xmm2
kusano 2b45e8
	mulps	%xmm1, %xmm2
kusano 2b45e8
kusano 2b45e8
	pshufd	$0x55, %xmm0, %xmm1
kusano 2b45e8
	movsd	-28 * SIZE(AO), %xmm0
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	movaps	-20 * SIZE(BO), %xmm2
kusano 2b45e8
	mulps	%xmm1, %xmm2
kusano 2b45e8
kusano 2b45e8
	subq	$-16 * SIZE, BO
kusano 2b45e8
	subq	$ -4 * SIZE, AO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L62
kusano 2b45e8
	addps	%xmm9, %xmm8
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L65:
kusano 2b45e8
	movddup	ALPHA, %xmm7
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#else
kusano 2b45e8
	movq	KKK, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	andq	$3, %rax		# if (k & 1)
kusano 2b45e8
	BRANCH
kusano 2b45e8
	je	.L68
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L66:
kusano 2b45e8
	pshufd	$0x00, %xmm0, %xmm1
kusano 2b45e8
	movss	-31 * SIZE(AO), %xmm0
kusano 2b45e8
	addps	%xmm2, %xmm8
kusano 2b45e8
	movaps	-32 * SIZE(BO), %xmm2
kusano 2b45e8
	mulps	%xmm1, %xmm2
kusano 2b45e8
kusano 2b45e8
	addq	$1 * SIZE, AO
kusano 2b45e8
	addq	$4 * SIZE, BO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L66
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L68:
kusano 2b45e8
	addps	%xmm2, %xmm8
kusano 2b45e8
	mulps	%xmm7, %xmm8
kusano 2b45e8
kusano 2b45e8
	pshufd	$0xff, %xmm8,  %xmm11
kusano 2b45e8
	pshufd	$0xaa, %xmm8,  %xmm10
kusano 2b45e8
	pshufd	$0x55, %xmm8,  %xmm9
kusano 2b45e8
	pshufd	$0x00, %xmm8,  %xmm8
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	addss	(CO1), %xmm8
kusano 2b45e8
	addss	(CO1, LDC,  1), %xmm9
kusano 2b45e8
	addss	(CO2), %xmm10
kusano 2b45e8
	addss	(CO2, LDC,  1), %xmm11
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movss	%xmm8,  (CO1)
kusano 2b45e8
	movss	%xmm9,  (CO1, LDC,  1)
kusano 2b45e8
	movss	%xmm10, (CO2)
kusano 2b45e8
	movss	%xmm11, (CO2, LDC,  1)
kusano 2b45e8
kusano 2b45e8
#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KKK, %rax
kusano 2b45e8
	leaq	(,%rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 1), AO
kusano 2b45e8
	leaq	(BO, %rax, 4), BO
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	addq	$1, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	ALIGN_4	
kusano 2b45e8
	
kusano 2b45e8
.L69:
kusano 2b45e8
#if defined(TRMMKERNEL) && !defined(LEFT)
kusano 2b45e8
	addq	$4, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movq	BO, B
kusano 2b45e8
kusano 2b45e8
	leaq	(C, LDC, 4), C
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L70:
kusano 2b45e8
	testq	$2, N
kusano 2b45e8
	jle	.L100
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
        movq    OFFSET, %rax
kusano 2b45e8
	movq    %rax, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movq	C, CO1
kusano 2b45e8
	leaq	(C, LDC), CO2
kusano 2b45e8
	movq	A, AO
kusano 2b45e8
kusano 2b45e8
	movq	M,  I
kusano 2b45e8
	sarq	$2, I
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L80
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L71:
kusano 2b45e8
#if !defined(TRMMKERNEL) || \
kusano 2b45e8
	(defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
	(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
#else
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
	leaq	(, %rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 4), AO
kusano 2b45e8
	leaq	(BO, %rax, 2), BO
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
	xorps	%xmm1, %xmm1
kusano 2b45e8
	movaps	-32 * SIZE(AO), %xmm0
kusano 2b45e8
	xorps	%xmm2, %xmm2
kusano 2b45e8
	movsd	-32 * SIZE(BO), %xmm3
kusano 2b45e8
kusano 2b45e8
	xorps	%xmm8,  %xmm8
kusano 2b45e8
	prefetcht2     4 * SIZE(CO1)
kusano 2b45e8
	xorps	%xmm9,  %xmm9
kusano 2b45e8
	prefetcht2     4 * SIZE(CO2)
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KK, %rax
kusano 2b45e8
	movq	%rax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addq	$4, %rax
kusano 2b45e8
#else
kusano 2b45e8
	addq	$2, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	movq	%rax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L75
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L72:	
kusano 2b45e8
	PREFETCH	(PREFETCHSIZE +  0) * SIZE(AO)
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x00,  %xmm3, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0x55,  %xmm3, %xmm2
kusano 2b45e8
	movsd	-30 * SIZE(BO), %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
	movaps	-28 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x00,  %xmm3, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0x55,  %xmm3, %xmm2
kusano 2b45e8
	movsd	-28 * SIZE(BO), %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
	movaps	-24 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x00,  %xmm3, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0x55,  %xmm3, %xmm2
kusano 2b45e8
	movsd	-26 * SIZE(BO), %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
	movaps	-20 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x00,  %xmm3, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0x55,  %xmm3, %xmm2
kusano 2b45e8
	movsd	-24 * SIZE(BO), %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
	movaps	-16 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	subq	$-16 * SIZE, AO
kusano 2b45e8
	subq	$ -8 * SIZE, BO
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L72
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L75:
kusano 2b45e8
	movddup	ALPHA, %xmm7
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#else
kusano 2b45e8
	movq	KKK, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	andq	$3, %rax		# if (k & 1)
kusano 2b45e8
	BRANCH
kusano 2b45e8
	je	.L78
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L76:
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x00,  %xmm3, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	pshufd	$0x55,  %xmm3, %xmm2
kusano 2b45e8
	movsd	-30 * SIZE(BO), %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm2
kusano 2b45e8
	movaps	-28 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addq	$4 * SIZE, AO
kusano 2b45e8
	addq	$2 * SIZE, BO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L76
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L78:
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
kusano 2b45e8
	mulps	%xmm7, %xmm8
kusano 2b45e8
	mulps	%xmm7, %xmm9
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movsd	0 * SIZE(CO1), %xmm0
kusano 2b45e8
	movhps	2 * SIZE(CO1), %xmm0
kusano 2b45e8
	movsd	0 * SIZE(CO2), %xmm1
kusano 2b45e8
	movhps	2 * SIZE(CO2), %xmm1
kusano 2b45e8
kusano 2b45e8
	addps	%xmm0, %xmm8
kusano 2b45e8
	addps	%xmm1, %xmm9
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movsd	%xmm8,  0 * SIZE(CO1)
kusano 2b45e8
	movhps	%xmm8,  2 * SIZE(CO1)
kusano 2b45e8
	movsd	%xmm9,  0 * SIZE(CO2)
kusano 2b45e8
	movhps	%xmm9,  2 * SIZE(CO2)
kusano 2b45e8
kusano 2b45e8
#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KKK, %rax
kusano 2b45e8
	leaq	(,%rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 4), AO
kusano 2b45e8
	leaq	(BO, %rax, 2), BO
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	addq	$4, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	addq	$4 * SIZE, CO1
kusano 2b45e8
	addq	$4 * SIZE, CO2
kusano 2b45e8
	decq	I
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L71
kusano 2b45e8
	ALIGN_4	
kusano 2b45e8
kusano 2b45e8
.L80:
kusano 2b45e8
	testq	$2, M
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jle	.L90
kusano 2b45e8
kusano 2b45e8
#if !defined(TRMMKERNEL) || \
kusano 2b45e8
	(defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
	(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
#else
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
	leaq	(, %rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 2), AO
kusano 2b45e8
	leaq	(BO, %rax, 2), BO
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
	xorps	%xmm1, %xmm1
kusano 2b45e8
	movddup	-32 * SIZE(AO), %xmm0
kusano 2b45e8
	xorps	%xmm2, %xmm2
kusano 2b45e8
	movsd	-32 * SIZE(BO), %xmm5
kusano 2b45e8
	xorps	%xmm8,  %xmm8
kusano 2b45e8
	xorps	%xmm9,  %xmm9
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KK, %rax
kusano 2b45e8
	movq	%rax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addq	$2, %rax
kusano 2b45e8
#else
kusano 2b45e8
	addq	$2, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	movq	%rax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L85
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L82:	
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movsd	-32 * SIZE(BO), %xmm1
kusano 2b45e8
	unpcklps    %xmm1, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	movddup	-30 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movsd	-30 * SIZE(BO), %xmm1
kusano 2b45e8
	unpcklps    %xmm1, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	movddup	-28 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movsd	-28 * SIZE(BO), %xmm1
kusano 2b45e8
	unpcklps    %xmm1, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	movddup	-26 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movsd	-26 * SIZE(BO), %xmm1
kusano 2b45e8
	unpcklps    %xmm1, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	movddup	-24 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	subq	$-8 * SIZE, BO
kusano 2b45e8
	subq	$-8 * SIZE, AO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L82
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L85:
kusano 2b45e8
	movddup	ALPHA, %xmm7
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#else
kusano 2b45e8
	movq	KKK, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	andq	$3, %rax		# if (k & 1)
kusano 2b45e8
	BRANCH
kusano 2b45e8
	je	.L88
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L86:
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movsd	-32 * SIZE(BO), %xmm1
kusano 2b45e8
	unpcklps    %xmm1, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	movddup	-30 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addq	$2 * SIZE, AO
kusano 2b45e8
	addq	$2 * SIZE, BO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L86
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L88:
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	mulps	%xmm7, %xmm8
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movsd	(CO1), %xmm0
kusano 2b45e8
	movhps	(CO2), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm0, %xmm8
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movsd	%xmm8,  (CO1)
kusano 2b45e8
	movhps	%xmm8,  (CO2)
kusano 2b45e8
kusano 2b45e8
#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KKK, %rax
kusano 2b45e8
	leaq	(,%rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 2), AO
kusano 2b45e8
	leaq	(BO, %rax, 2), BO
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	addq	$2, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	addq	$2 * SIZE, CO1
kusano 2b45e8
	addq	$2 * SIZE, CO2
kusano 2b45e8
	ALIGN_4	
kusano 2b45e8
kusano 2b45e8
.L90:
kusano 2b45e8
	testq	$1, M
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jle	.L99
kusano 2b45e8
kusano 2b45e8
#if !defined(TRMMKERNEL) || \
kusano 2b45e8
	(defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
	(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
#else
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
	leaq	(, %rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 1), AO
kusano 2b45e8
	leaq	(BO, %rax, 2), BO
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
	xorps	%xmm2, %xmm2
kusano 2b45e8
	movsd	-32 * SIZE(AO), %xmm0
kusano 2b45e8
	xorps	%xmm8, %xmm8
kusano 2b45e8
	xorps	%xmm9, %xmm9
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KK, %rax
kusano 2b45e8
	movq	%rax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addq	$1, %rax
kusano 2b45e8
#else
kusano 2b45e8
	addq	$2, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	movq	%rax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L95
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L92:	
kusano 2b45e8
	pshufd	$0x00, %xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm8
kusano 2b45e8
	movsd	-32 * SIZE(BO), %xmm2
kusano 2b45e8
	mulps	%xmm1, %xmm2
kusano 2b45e8
kusano 2b45e8
	pshufd	$0x55, %xmm0, %xmm1
kusano 2b45e8
	movsd	-30 * SIZE(AO), %xmm0
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	movsd	-30 * SIZE(BO), %xmm2
kusano 2b45e8
	mulps	%xmm1, %xmm2
kusano 2b45e8
kusano 2b45e8
	pshufd	$0x00, %xmm0, %xmm1
kusano 2b45e8
	addps	%xmm2, %xmm8
kusano 2b45e8
	movsd	-28 * SIZE(BO), %xmm2
kusano 2b45e8
	mulps	%xmm1, %xmm2
kusano 2b45e8
kusano 2b45e8
	pshufd	$0x55, %xmm0, %xmm1
kusano 2b45e8
	movsd	-28 * SIZE(AO), %xmm0
kusano 2b45e8
	addps	%xmm2, %xmm9
kusano 2b45e8
	movsd	-26 * SIZE(BO), %xmm2
kusano 2b45e8
	mulps	%xmm1, %xmm2
kusano 2b45e8
kusano 2b45e8
	subq	$-4 * SIZE, AO
kusano 2b45e8
	subq	$-8 * SIZE, BO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L92
kusano 2b45e8
	addps	%xmm9, %xmm8
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L95:
kusano 2b45e8
	movddup	ALPHA, %xmm7
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#else
kusano 2b45e8
	movq	KKK, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	andq	$3, %rax		# if (k & 1)
kusano 2b45e8
	BRANCH
kusano 2b45e8
	je	.L98
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L96:
kusano 2b45e8
	pshufd	$0x00, %xmm0, %xmm1
kusano 2b45e8
	movss	-31 * SIZE(AO), %xmm0
kusano 2b45e8
	addps	%xmm2, %xmm8
kusano 2b45e8
	movsd	-32 * SIZE(BO), %xmm2
kusano 2b45e8
	mulps	%xmm1, %xmm2
kusano 2b45e8
kusano 2b45e8
	addq	$1 * SIZE, AO
kusano 2b45e8
	addq	$2 * SIZE, BO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L96
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L98:
kusano 2b45e8
	addps	%xmm2, %xmm8
kusano 2b45e8
	mulps	%xmm7, %xmm8
kusano 2b45e8
kusano 2b45e8
	pshufd	$0x55, %xmm8,  %xmm9
kusano 2b45e8
	pshufd	$0x00, %xmm8,  %xmm8
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	addss	(CO1), %xmm8
kusano 2b45e8
	addss	(CO2), %xmm9
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movss	%xmm8, (CO1)
kusano 2b45e8
	movss	%xmm9, (CO2)
kusano 2b45e8
kusano 2b45e8
#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KKK, %rax
kusano 2b45e8
	leaq	(,%rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 1), AO
kusano 2b45e8
	leaq	(BO, %rax, 2), BO
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	addq	$1, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	ALIGN_4	
kusano 2b45e8
	
kusano 2b45e8
.L99:
kusano 2b45e8
#if defined(TRMMKERNEL) && !defined(LEFT)
kusano 2b45e8
	addq	$2, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movq	BO, B
kusano 2b45e8
kusano 2b45e8
	leaq	(C, LDC, 2), C
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L100:
kusano 2b45e8
	testq	$1, N
kusano 2b45e8
	jle	.L999
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
        movq    OFFSET, %rax
kusano 2b45e8
	movq    %rax, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movq	C, CO1
kusano 2b45e8
	movq	A, AO
kusano 2b45e8
kusano 2b45e8
	movq	M,  I
kusano 2b45e8
	sarq	$2, I
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L110
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L101:
kusano 2b45e8
#if !defined(TRMMKERNEL) || \
kusano 2b45e8
	(defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
	(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
#else
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
	leaq	(, %rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 4), AO
kusano 2b45e8
	leaq	(BO, %rax, 1), BO
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
	xorps	%xmm1, %xmm1
kusano 2b45e8
	movaps	-32 * SIZE(AO), %xmm0
kusano 2b45e8
	movsd	-32 * SIZE(BO), %xmm3
kusano 2b45e8
	xorps	%xmm8,  %xmm8
kusano 2b45e8
	prefetcht2     4 * SIZE(CO1)
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KK, %rax
kusano 2b45e8
	movq	%rax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addq	$4, %rax
kusano 2b45e8
#else
kusano 2b45e8
	addq	$1, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	movq	%rax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L105
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L102:	
kusano 2b45e8
	PREFETCH	(PREFETCHSIZE +  0) * SIZE(AO)
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x00,  %xmm3, %xmm1
kusano 2b45e8
	movss	-31 * SIZE(BO), %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	movaps	-28 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x00,  %xmm3, %xmm1
kusano 2b45e8
	movss	-30 * SIZE(BO), %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	movaps	-24 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x00,  %xmm3, %xmm1
kusano 2b45e8
	movss	-29 * SIZE(BO), %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	movaps	-20 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x00,  %xmm3, %xmm1
kusano 2b45e8
	movss	-28 * SIZE(BO), %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	movaps	-16 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	subq	$-16 * SIZE, AO
kusano 2b45e8
	subq	$ -4 * SIZE, BO
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L102
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L105:
kusano 2b45e8
	movddup	ALPHA, %xmm7
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#else
kusano 2b45e8
	movq	KKK, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	andq	$3, %rax		# if (k & 1)
kusano 2b45e8
	BRANCH
kusano 2b45e8
	je	.L108
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L106:
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	pshufd	$0x00,  %xmm3, %xmm1
kusano 2b45e8
	movss	-31 * SIZE(BO), %xmm3
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	movaps	-28 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addq	$4 * SIZE, AO
kusano 2b45e8
	addq	$1 * SIZE, BO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L106
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L108:
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
kusano 2b45e8
	mulps	%xmm7, %xmm8
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movsd	0 * SIZE(CO1), %xmm0
kusano 2b45e8
	movhps	2 * SIZE(CO1), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm0, %xmm8
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movsd	%xmm8,  0 * SIZE(CO1)
kusano 2b45e8
	movhps	%xmm8,  2 * SIZE(CO1)
kusano 2b45e8
kusano 2b45e8
#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KKK, %rax
kusano 2b45e8
	leaq	(,%rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 4), AO
kusano 2b45e8
	leaq	(BO, %rax, 1), BO
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	addq	$4, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	addq	$4 * SIZE, CO1
kusano 2b45e8
	decq	I
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L101
kusano 2b45e8
	ALIGN_4	
kusano 2b45e8
kusano 2b45e8
.L110:
kusano 2b45e8
	testq	$2, M
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jle	.L120
kusano 2b45e8
kusano 2b45e8
#if !defined(TRMMKERNEL) || \
kusano 2b45e8
	(defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
	(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
#else
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
	leaq	(, %rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 2), AO
kusano 2b45e8
	leaq	(BO, %rax, 1), BO
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
	xorps	%xmm1, %xmm1
kusano 2b45e8
	movddup	-32 * SIZE(AO), %xmm0
kusano 2b45e8
	xorps	%xmm8,  %xmm8
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KK, %rax
kusano 2b45e8
	movq	%rax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addq	$2, %rax
kusano 2b45e8
#else
kusano 2b45e8
	addq	$1, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	movq	%rax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L115
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L112:	
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movss	-32 * SIZE(BO), %xmm1
kusano 2b45e8
	unpcklps %xmm1, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	movsd	-30 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movss	-31 * SIZE(BO), %xmm1
kusano 2b45e8
	unpcklps %xmm1, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	movsd	-28 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movss	-30 * SIZE(BO), %xmm1
kusano 2b45e8
	unpcklps %xmm1, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	movsd	-26 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movss	-29 * SIZE(BO), %xmm1
kusano 2b45e8
	unpcklps %xmm1, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	movsd	-24 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	subq	$-4 * SIZE, BO
kusano 2b45e8
	subq	$-8 * SIZE, AO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L112
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L115:
kusano 2b45e8
	movddup	ALPHA, %xmm7
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#else
kusano 2b45e8
	movq	KKK, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	andq	$3, %rax		# if (k & 1)
kusano 2b45e8
	BRANCH
kusano 2b45e8
	je	.L118
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L116:
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	movss	-32 * SIZE(BO), %xmm1
kusano 2b45e8
	unpcklps %xmm1, %xmm1
kusano 2b45e8
	mulps	%xmm0, %xmm1
kusano 2b45e8
	movsd	-30 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addq	$2 * SIZE, AO
kusano 2b45e8
	addq	$1 * SIZE, BO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L116
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L118:
kusano 2b45e8
	addps	%xmm1, %xmm8
kusano 2b45e8
	mulps	%xmm7, %xmm8
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movsd	(CO1), %xmm0
kusano 2b45e8
	addps	%xmm0, %xmm8
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movsd	%xmm8,  (CO1)
kusano 2b45e8
kusano 2b45e8
#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KKK, %rax
kusano 2b45e8
	leaq	(,%rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 2), AO
kusano 2b45e8
	leaq	(BO, %rax, 1), BO
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	addq	$2, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	addq	$2 * SIZE, CO1
kusano 2b45e8
	ALIGN_4	
kusano 2b45e8
kusano 2b45e8
.L120:
kusano 2b45e8
	testq	$1, M
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jle	.L999
kusano 2b45e8
kusano 2b45e8
#if !defined(TRMMKERNEL) || \
kusano 2b45e8
	(defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
	(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
#else
kusano 2b45e8
	movq	B, BO
kusano 2b45e8
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
	leaq	(, %rax, SIZE), %rax
kusano 2b45e8
	leaq	(AO, %rax, 1), AO
kusano 2b45e8
	leaq	(BO, %rax, 1), BO
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
	xorps	%xmm2, %xmm2
kusano 2b45e8
	movss	-32 * SIZE(AO), %xmm0
kusano 2b45e8
	xorps	%xmm8, %xmm8
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
	subq	KK, %rax
kusano 2b45e8
	movq	%rax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movq	KK, %rax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addq	$1, %rax
kusano 2b45e8
#else
kusano 2b45e8
	addq	$1, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	movq	%rax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	sarq	$2, %rax
kusano 2b45e8
	NOBRANCH
kusano 2b45e8
	jle	.L125
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L122:	
kusano 2b45e8
	addss	%xmm2, %xmm8
kusano 2b45e8
	movss	-32 * SIZE(BO), %xmm2
kusano 2b45e8
	mulss	%xmm0, %xmm2
kusano 2b45e8
	movss	-31 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addss	%xmm2, %xmm8
kusano 2b45e8
	movss	-31 * SIZE(BO), %xmm2
kusano 2b45e8
	mulss	%xmm0, %xmm2
kusano 2b45e8
	movss	-30 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addss	%xmm2, %xmm8
kusano 2b45e8
	movss	-30 * SIZE(BO), %xmm2
kusano 2b45e8
	mulss	%xmm0, %xmm2
kusano 2b45e8
	movss	-29 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addss	%xmm2, %xmm8
kusano 2b45e8
	movss	-29 * SIZE(BO), %xmm2
kusano 2b45e8
	mulss	%xmm0, %xmm2
kusano 2b45e8
	movss	-28 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	subq	$-4 * SIZE, AO
kusano 2b45e8
	subq	$-4 * SIZE, BO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L122
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L125:
kusano 2b45e8
	movddup	ALPHA, %xmm7
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movq	K, %rax
kusano 2b45e8
#else
kusano 2b45e8
	movq	KKK, %rax
kusano 2b45e8
#endif
kusano 2b45e8
	andq	$3, %rax		# if (k & 1)
kusano 2b45e8
	BRANCH
kusano 2b45e8
	je	.L128
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L126:
kusano 2b45e8
	addss	%xmm2, %xmm8
kusano 2b45e8
	movss	-32 * SIZE(BO), %xmm2
kusano 2b45e8
	mulss	%xmm0, %xmm2
kusano 2b45e8
	movss	-31 * SIZE(AO), %xmm0
kusano 2b45e8
kusano 2b45e8
	addq	$1 * SIZE, AO
kusano 2b45e8
	addq	$1 * SIZE, BO
kusano 2b45e8
kusano 2b45e8
	subq	$1, %rax
kusano 2b45e8
	BRANCH
kusano 2b45e8
	jg	.L126
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L128:
kusano 2b45e8
	addps	%xmm2, %xmm8
kusano 2b45e8
kusano 2b45e8
	mulps	%xmm7, %xmm8
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	addss	(CO1), %xmm8
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	movss	%xmm8, (CO1)
kusano 2b45e8
	ALIGN_4	
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
kusano 2b45e8
	EPILOGUE