Blame thirdparty/openblas/xianyi-OpenBLAS-e6e87a2/kernel/x86/gemm_kernel_2x2.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 STACK	16
kusano 2b45e8
#define ARGS	16
kusano 2b45e8
	
kusano 2b45e8
#define J	 0 + STACK(%esp)
kusano 2b45e8
#define BX	 4 + STACK(%esp)
kusano 2b45e8
#define KK	 8 + STACK(%esp)
kusano 2b45e8
#define KKK	12 + STACK(%esp)
kusano 2b45e8
kusano 2b45e8
#define M	 4 + STACK + ARGS(%esp)
kusano 2b45e8
#define N	 8 + STACK + ARGS(%esp)
kusano 2b45e8
#define K	12 + STACK + ARGS(%esp)
kusano 2b45e8
#define ALPHA	16 + STACK + ARGS(%esp)
kusano 2b45e8
#ifdef DOUBLE
kusano 2b45e8
#define A	24 + STACK + ARGS(%esp)
kusano 2b45e8
#define B	28 + STACK + ARGS(%esp)
kusano 2b45e8
#define C	32 + STACK + ARGS(%esp)
kusano 2b45e8
#define LDC	36 + STACK + ARGS(%esp)
kusano 2b45e8
#define OFFSET	40 + STACK + ARGS(%esp)
kusano 2b45e8
#else
kusano 2b45e8
#define A	20 + STACK + ARGS(%esp)
kusano 2b45e8
#define B	24 + STACK + ARGS(%esp)
kusano 2b45e8
#define C	28 + STACK + ARGS(%esp)
kusano 2b45e8
#define LDC	32 + STACK + ARGS(%esp)
kusano 2b45e8
#define OFFSET	36 + STACK + ARGS(%esp)
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#define PREFETCH_OFFSET 48
kusano 2b45e8
kusano 2b45e8
#if defined(PENTIUM3) || defined(PENTIUMM)
kusano 2b45e8
#define REP rep
kusano 2b45e8
#else
kusano 2b45e8
#define REP rep
kusano 2b45e8
#endif
kusano 2b45e8
	
kusano 2b45e8
	PROLOGUE
kusano 2b45e8
kusano 2b45e8
	subl	$ARGS, %esp	# Generate Stack Frame
kusano 2b45e8
kusano 2b45e8
	pushl	%ebp
kusano 2b45e8
	pushl	%edi
kusano 2b45e8
	pushl	%esi
kusano 2b45e8
	pushl	%ebx
kusano 2b45e8
kusano 2b45e8
	PROFCODE
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && !defined(LEFT)
kusano 2b45e8
	movl	OFFSET, %eax
kusano 2b45e8
	negl	%eax
kusano 2b45e8
	movl	%eax, KK
kusano 2b45e8
#endif
kusano 2b45e8
	
kusano 2b45e8
	movl	N,   %eax		# j = (n >> 1)		# MEMORY
kusano 2b45e8
	movl	LDC, %ebp		# ldc			# MEMORY
kusano 2b45e8
	movl	B,   %ebx
kusano 2b45e8
kusano 2b45e8
	sarl	$1,  %eax		 
kusano 2b45e8
	leal	(, %ebp, SIZE), %ebp
kusano 2b45e8
	leal	0(%ecx) , %ecx		# NOP
kusano 2b45e8
	movl	%eax, J			# j = (n >> 1)		# MEMORY
kusano 2b45e8
	test	%eax, %eax
kusano 2b45e8
	je	.L8			# if !(n >> 1) goto .L8
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L34:
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	movl	OFFSET, %eax
kusano 2b45e8
	movl	%eax, KK
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
	movl	%ebx, BX
kusano 2b45e8
kusano 2b45e8
	movl	M, %esi			# m			# MEMORY
kusano 2b45e8
	movl	A, %edx			# a			# MEMORY
kusano 2b45e8
	movl	C, %edi			# C			# MEMORY
kusano 2b45e8
	sarl	$1,   %esi		# i = (m >> 1)
kusano 2b45e8
	je	.L12
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.MainHead:
kusano 2b45e8
#if !defined(TRMMKERNEL) || \
kusano 2b45e8
	(defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
	(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movl	%ebx, %ecx
kusano 2b45e8
#else
kusano 2b45e8
	movl	KK,   %eax
kusano 2b45e8
	leal	(, %eax, SIZE), %eax
kusano 2b45e8
	leal	(%edx, %eax, 2), %edx
kusano 2b45e8
	leal	(%ebx, %eax, 2), %ecx
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
#ifdef HAVE_SSE
kusano 2b45e8
	movl	BX, %eax
kusano 2b45e8
kusano 2b45e8
	prefetcht2  0 * SIZE(%eax)
kusano 2b45e8
	prefetcht2  4 * SIZE(%eax)
kusano 2b45e8
kusano 2b45e8
#if   L2_SIZE > 262144
kusano 2b45e8
kusano 2b45e8
	subl	$-8 * SIZE, BX
kusano 2b45e8
kusano 2b45e8
#elif L2_SIZE > 131072
kusano 2b45e8
kusano 2b45e8
	prefetcht2  8 * SIZE(%eax)
kusano 2b45e8
	prefetcht2 12 * SIZE(%eax)
kusano 2b45e8
kusano 2b45e8
kusano 2b45e8
	subl	$-16 * SIZE, BX
kusano 2b45e8
#else
kusano 2b45e8
	prefetcht2 16 * SIZE(%eax)
kusano 2b45e8
	prefetcht2 20 * SIZE(%eax)
kusano 2b45e8
	prefetcht2 24 * SIZE(%eax)
kusano 2b45e8
	prefetcht2 28 * SIZE(%eax)
kusano 2b45e8
kusano 2b45e8
	subl	$-32 * SIZE, BX
kusano 2b45e8
#endif
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	fldz
kusano 2b45e8
	fldz
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movl	K, %eax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movl	K, %eax
kusano 2b45e8
	subl	KK, %eax
kusano 2b45e8
	movl	%eax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movl	KK, %eax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addl	$2, %eax
kusano 2b45e8
#else
kusano 2b45e8
	addl	$2, %eax
kusano 2b45e8
#endif
kusano 2b45e8
	movl	%eax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	fldz
kusano 2b45e8
	fldz
kusano 2b45e8
kusano 2b45e8
	FLD	 4 * SIZE(%ecx)		# b5
kusano 2b45e8
	FLD	 4 * SIZE(%edx)		# a5
kusano 2b45e8
	FLD	 0 * SIZE(%ecx)		# b1
kusano 2b45e8
	FLD	 0 * SIZE(%edx)		# a1
kusano 2b45e8
kusano 2b45e8
#if   defined(HAVE_3DNOW)
kusano 2b45e8
	prefetchw	2 * SIZE(%edi)
kusano 2b45e8
 	prefetchw	2 * SIZE(%edi, %ebp, 1)
kusano 2b45e8
#elif defined(HAVE_SSE)
kusano 2b45e8
	prefetchnta	2 * SIZE(%edi)
kusano 2b45e8
 	prefetchnta	2 * SIZE(%edi, %ebp, 1)
kusano 2b45e8
#endif
kusano 2b45e8
	sarl	$2, %eax
kusano 2b45e8
 	je	.L16
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.MainLoop:
kusano 2b45e8
#if defined(HAVE_3DNOW)
kusano 2b45e8
	prefetch	(PREFETCH_OFFSET) * SIZE(%ecx)
kusano 2b45e8
	nop
kusano 2b45e8
#elif defined(HAVE_SSE)
kusano 2b45e8
	prefetchnta	(PREFETCH_OFFSET) * SIZE(%ecx)
kusano 2b45e8
#ifdef CORE_KATMAI
kusano 2b45e8
	prefetcht0	(PREFETCH_OFFSET) * SIZE(%edx)
kusano 2b45e8
#endif
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	fmul	%st, %st(1)
kusano 2b45e8
	FMUL	 1 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(1)
kusano 2b45e8
	faddp	%st, %st(4)
kusano 2b45e8
	FLD	 0 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(1)
kusano 2b45e8
	faddp	%st, %st(5)
kusano 2b45e8
	FLD	 1 * SIZE(%edx)
kusano 2b45e8
	fmul	%st, %st(1)
kusano 2b45e8
	FMUL	 1 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(1)
kusano 2b45e8
	faddp	%st, %st(6)
kusano 2b45e8
	FLD	 2 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(1)
kusano 2b45e8
	faddp	%st, %st(7)
kusano 2b45e8
	FLD	 2 * SIZE(%edx)
kusano 2b45e8
kusano 2b45e8
	fmul	%st, %st(1)
kusano 2b45e8
	FMUL	 3 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(1)
kusano 2b45e8
	faddp	%st, %st(4)
kusano 2b45e8
	FLD	 2 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(1)
kusano 2b45e8
	faddp	%st, %st(5)
kusano 2b45e8
	FLD	 3 * SIZE(%edx)
kusano 2b45e8
	fmul	%st, %st(1)
kusano 2b45e8
	FMUL	 3 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(1)
kusano 2b45e8
	faddp	%st, %st(6)
kusano 2b45e8
	FLD	 8 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(1)
kusano 2b45e8
	faddp	%st, %st(7)
kusano 2b45e8
	FLD	 8 * SIZE(%edx)
kusano 2b45e8
	fxch	%st(2)
kusano 2b45e8
kusano 2b45e8
#if !defined(HAVE_3DNOW) && defined(HAVE_SSE)  && defined(DOUBLE)
kusano 2b45e8
	prefetchnta	(PREFETCH_OFFSET + 4) * SIZE(%ecx)
kusano 2b45e8
#ifdef CORE_KATMAI
kusano 2b45e8
	prefetcht0	(PREFETCH_OFFSET + 4) * SIZE(%edx)
kusano 2b45e8
#endif
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	fmul	%st, %st(3)
kusano 2b45e8
	FMUL	 5 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(3)
kusano 2b45e8
	faddp	%st, %st(4)
kusano 2b45e8
	FLD	 4 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(3)
kusano 2b45e8
	faddp	%st, %st(5)
kusano 2b45e8
	FLD	 5 * SIZE(%edx)
kusano 2b45e8
	fmul	%st, %st(3)
kusano 2b45e8
	FMUL	 5 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(3)
kusano 2b45e8
	faddp	%st, %st(6)
kusano 2b45e8
	FLD	 6 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(3)
kusano 2b45e8
	faddp	%st, %st(7)
kusano 2b45e8
	FLD	 6 * SIZE(%edx)
kusano 2b45e8
kusano 2b45e8
	fmul	%st, %st(3)
kusano 2b45e8
	FMUL	 7 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(3)
kusano 2b45e8
	faddp	%st, %st(4)
kusano 2b45e8
	FLD	 6 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(3)
kusano 2b45e8
	faddp	%st, %st(5)
kusano 2b45e8
	FLD	 7 * SIZE(%edx)
kusano 2b45e8
	fmul	%st, %st(3)
kusano 2b45e8
	FMUL	 7 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(3)
kusano 2b45e8
	faddp	%st, %st(6)
kusano 2b45e8
	FLD	12 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(3)
kusano 2b45e8
	faddp	%st, %st(7)
kusano 2b45e8
	FLD	12 * SIZE(%edx)
kusano 2b45e8
	fxch	%st(2)
kusano 2b45e8
kusano 2b45e8
	subl	$-8 * SIZE, %ecx
kusano 2b45e8
	subl	$-8 * SIZE, %edx
kusano 2b45e8
	decl	%eax			# l --
kusano 2b45e8
	jne	.MainLoop
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L16:
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movl	K, %eax
kusano 2b45e8
#else
kusano 2b45e8
	movl	KKK, %eax
kusano 2b45e8
#endif
kusano 2b45e8
	and	$3,  %eax
kusano 2b45e8
	je	.L21
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.SubLoop:
kusano 2b45e8
	fmul	%st, %st(1)
kusano 2b45e8
	FMUL	 1 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(1)
kusano 2b45e8
	faddp	%st, %st(4)
kusano 2b45e8
	FLD	 0 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(1)
kusano 2b45e8
	faddp	%st, %st(5)
kusano 2b45e8
	FLD	 1 * SIZE(%edx)
kusano 2b45e8
	fmul	%st, %st(1)
kusano 2b45e8
	FMUL	 1 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(1)
kusano 2b45e8
	faddp	%st, %st(6)
kusano 2b45e8
	FLD	 2 * SIZE(%ecx)
kusano 2b45e8
	fxch	%st(1)
kusano 2b45e8
	faddp	%st, %st(7)
kusano 2b45e8
	FLD	 2 * SIZE(%edx)
kusano 2b45e8
kusano 2b45e8
	addl	$2 * SIZE,%ecx
kusano 2b45e8
	addl	$2 * SIZE,%edx
kusano 2b45e8
	decl	%eax
kusano 2b45e8
	jne	 .SubLoop
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L21:
kusano 2b45e8
	ffreep	%st(0)
kusano 2b45e8
	ffreep	%st(0)
kusano 2b45e8
	ffreep	%st(0)
kusano 2b45e8
	ffreep	%st(0)
kusano 2b45e8
kusano 2b45e8
	FLD	ALPHA	
kusano 2b45e8
	fmul	%st, %st(4)
kusano 2b45e8
	fmul	%st, %st(1)
kusano 2b45e8
	fmul	%st, %st(2)
kusano 2b45e8
	fmulp	%st, %st(3)
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	FADD	0 * SIZE(%edi)
kusano 2b45e8
	FST	0 * SIZE(%edi)
kusano 2b45e8
	FADD	0 * SIZE(%edi,%ebp)
kusano 2b45e8
	FST	0 * SIZE(%edi,%ebp)
kusano 2b45e8
	FADD	1 * SIZE(%edi)
kusano 2b45e8
	FST	1 * SIZE(%edi)
kusano 2b45e8
	FADD	1 * SIZE(%edi,%ebp)
kusano 2b45e8
	FST	1 * SIZE(%edi,%ebp)
kusano 2b45e8
#else
kusano 2b45e8
	FST	0 * SIZE(%edi)
kusano 2b45e8
	FST	0 * SIZE(%edi,%ebp)
kusano 2b45e8
	FST	1 * SIZE(%edi)
kusano 2b45e8
	FST	1 * SIZE(%edi,%ebp)
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
kusano 2b45e8
#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movl	K, %eax
kusano 2b45e8
	subl	KKK, %eax
kusano 2b45e8
	leal	(,%eax, SIZE), %eax
kusano 2b45e8
	leal	(%edx, %eax, 2), %edx
kusano 2b45e8
	leal	(%ecx, %eax, 2), %ecx
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	addl	$2, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	addl	$2 * SIZE, %edi
kusano 2b45e8
	rep
kusano 2b45e8
	decl	%esi			# i --
kusano 2b45e8
	rep
kusano 2b45e8
	jne	.MainHead
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L12:
kusano 2b45e8
	movl	 M, %eax		# m			# MEMORY
kusano 2b45e8
	andl	$1, %eax
kusano 2b45e8
	je	.L27
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
	movl	%ebx, %ecx
kusano 2b45e8
#else
kusano 2b45e8
	movl	KK,   %eax
kusano 2b45e8
	leal	(, %eax, SIZE), %eax
kusano 2b45e8
	leal	(%edx, %eax, 1), %edx
kusano 2b45e8
	leal	(%ebx, %eax, 2), %ecx
kusano 2b45e8
#endif	
kusano 2b45e8
	fldz
kusano 2b45e8
	fldz
kusano 2b45e8
kusano 2b45e8
	FLD	0 * SIZE(%edx)		# temp1 = *(aoffset + 0)
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movl	K, %eax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movl	K, %eax
kusano 2b45e8
	subl	KK, %eax
kusano 2b45e8
	movl	%eax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movl	KK, %eax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addl	$1, %eax
kusano 2b45e8
#else
kusano 2b45e8
	addl	$2, %eax
kusano 2b45e8
#endif
kusano 2b45e8
	movl	%eax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	sarl	$1,%eax			# k >> 1		# MEMORY
kusano 2b45e8
	je	 .L54
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L55:
kusano 2b45e8
	FLD	0 * SIZE(%ecx)		# temp2 = *(boffset + 0)
kusano 2b45e8
	rep
kusano 2b45e8
	fmul	%st(1), %st
kusano 2b45e8
	faddp	%st, %st(2)
kusano 2b45e8
kusano 2b45e8
	FMUL	1 * SIZE(%ecx)		# temp2 = *(boffset + 0)
kusano 2b45e8
	faddp	%st, %st(2)
kusano 2b45e8
	FLD	1 * SIZE(%edx)		# temp1 = *(aoffset + 0)
kusano 2b45e8
kusano 2b45e8
	FLD	2 * SIZE(%ecx)		# temp2 = *(boffset + 0)
kusano 2b45e8
	rep
kusano 2b45e8
	fmul	%st(1), %st
kusano 2b45e8
	faddp	%st, %st(2)
kusano 2b45e8
kusano 2b45e8
	FMUL	3 * SIZE(%ecx)		# temp2 = *(boffset + 0)
kusano 2b45e8
	faddp	%st, %st(2)
kusano 2b45e8
	FLD	2 * SIZE(%edx)		# temp1 = *(aoffset + 0)
kusano 2b45e8
kusano 2b45e8
	addl	$2 * SIZE, %edx
kusano 2b45e8
	addl	$4 * SIZE, %ecx
kusano 2b45e8
	decl	%eax
kusano 2b45e8
	jne	.L55
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L54:
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movl	K, %eax
kusano 2b45e8
#else
kusano 2b45e8
	movl	KKK, %eax
kusano 2b45e8
#endif
kusano 2b45e8
	andl	$1,%eax			# k & 1
kusano 2b45e8
	je	.L33
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
	FLD	0 * SIZE(%ecx)		# temp2 = *(boffset + 0)
kusano 2b45e8
	rep
kusano 2b45e8
	fmul	%st(1), %st
kusano 2b45e8
	faddp	%st, %st(2)
kusano 2b45e8
kusano 2b45e8
	FMUL	1 * SIZE(%ecx)		# temp2 = *(boffset + 0)
kusano 2b45e8
	faddp	%st, %st(2)
kusano 2b45e8
	FLD	1 * SIZE(%edx)		# temp1 = *(aoffset + 0)
kusano 2b45e8
kusano 2b45e8
	addl	$1 * SIZE, %edx
kusano 2b45e8
	addl	$2 * SIZE, %ecx
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L33:
kusano 2b45e8
	ffreep	%st(0)
kusano 2b45e8
	FLD	ALPHA
kusano 2b45e8
kusano 2b45e8
	fmul	%st, %st(2)
kusano 2b45e8
	fmulp	%st, %st(1)
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	FADD	(%edi)
kusano 2b45e8
	FST	(%edi)
kusano 2b45e8
	FADD	(%edi,%ebp)
kusano 2b45e8
	FST	(%edi,%ebp)
kusano 2b45e8
#else
kusano 2b45e8
	FST	(%edi)
kusano 2b45e8
	FST	(%edi,%ebp)
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movl	K, %eax
kusano 2b45e8
	subl	KKK, %eax
kusano 2b45e8
	leal	(,%eax, SIZE), %eax
kusano 2b45e8
	leal	(%edx, %eax, 1), %edx
kusano 2b45e8
	leal	(%ecx, %eax, 2), %ecx
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	addl	$1, KK
kusano 2b45e8
#endif
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L27:
kusano 2b45e8
#if defined(TRMMKERNEL) && !defined(LEFT)
kusano 2b45e8
	addl	$2, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	lea	(, %ebp, 2), %eax
kusano 2b45e8
	addl	%eax, C			# C + 2 * ldc		# MEMORY
kusano 2b45e8
	movl	%ecx, %ebx		# b			# MEMORY
kusano 2b45e8
	decl	J			# j--			# MEMORY
kusano 2b45e8
	jne	.L34
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L8:
kusano 2b45e8
	movl	N,  %eax		# n			# MEMORY
kusano 2b45e8
	andl	$1, %eax
kusano 2b45e8
	je	.End
kusano 2b45e8
	
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	movl	OFFSET, %eax
kusano 2b45e8
	movl	%eax, KK
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
	movl	C, %edi			# c			# MEMORY
kusano 2b45e8
	movl	A, %edx			# a			# MEMORY
kusano 2b45e8
kusano 2b45e8
	movl	M,  %esi		# m			# MEMORY
kusano 2b45e8
	sarl	$1, %esi		# m >> 1
kusano 2b45e8
	je	.L36
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
	
kusano 2b45e8
.L46:
kusano 2b45e8
#if !defined(TRMMKERNEL) || \
kusano 2b45e8
	(defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
	(defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movl	%ebx, %ecx
kusano 2b45e8
#else
kusano 2b45e8
	movl	KK,   %eax
kusano 2b45e8
	leal	(, %eax, SIZE), %eax
kusano 2b45e8
	leal	(%edx, %eax, 2), %edx
kusano 2b45e8
	leal	(%ebx, %eax, 1), %ecx
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movl	K, %eax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movl	K, %eax
kusano 2b45e8
	subl	KK, %eax
kusano 2b45e8
	movl	%eax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movl	KK, %eax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addl	$2, %eax
kusano 2b45e8
#else
kusano 2b45e8
	addl	$1, %eax
kusano 2b45e8
#endif
kusano 2b45e8
	movl	%eax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	fldz
kusano 2b45e8
	sarl	$1, %eax
kusano 2b45e8
	fldz
kusano 2b45e8
	FLD	0 * SIZE(%ecx)		# temp1 = *(boffset + 0)
kusano 2b45e8
kusano 2b45e8
	je	.L56
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L57:
kusano 2b45e8
	FLD	0 * SIZE(%edx)		# temp2 = *(aoffset + 0)
kusano 2b45e8
	fmul	%st(1), %st
kusano 2b45e8
	faddp	%st, %st(2)
kusano 2b45e8
kusano 2b45e8
	FMUL	1 * SIZE(%edx)		# temp2 = *(aoffset + 0)
kusano 2b45e8
	faddp	%st, %st(2)
kusano 2b45e8
	FLD	1 * SIZE(%ecx)		# temp1 = *(boffset + 0)
kusano 2b45e8
kusano 2b45e8
	FLD	2 * SIZE(%edx)		# temp2 = *(aoffset + 0)
kusano 2b45e8
	fmul	%st(1), %st
kusano 2b45e8
	faddp	%st, %st(2)
kusano 2b45e8
kusano 2b45e8
	FMUL	3 * SIZE(%edx)		# temp2 = *(aoffset + 0)
kusano 2b45e8
	faddp	%st, %st(2)
kusano 2b45e8
	FLD	2 * SIZE(%ecx)		# temp1 = *(boffset + 0)
kusano 2b45e8
kusano 2b45e8
	addl	$4 * SIZE,%edx
kusano 2b45e8
	addl	$2 * SIZE,%ecx
kusano 2b45e8
	dec	%eax
kusano 2b45e8
	jne	.L57
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L56:
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movl	K, %eax
kusano 2b45e8
#else
kusano 2b45e8
	movl	KKK, %eax
kusano 2b45e8
#endif
kusano 2b45e8
	andl	$1, %eax
kusano 2b45e8
	je	.L45
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
	FLD	0 * SIZE(%edx)		# temp2 = *(aoffset + 0)
kusano 2b45e8
	fmul	%st(1), %st
kusano 2b45e8
	faddp	%st, %st(2)
kusano 2b45e8
kusano 2b45e8
	FMUL	1 * SIZE(%edx)		# temp2 = *(aoffset + 0)
kusano 2b45e8
	faddp	%st, %st(2)
kusano 2b45e8
	FLD	3 * SIZE(%ecx)		# temp1 = *(boffset + 0)
kusano 2b45e8
kusano 2b45e8
	addl	$2 * SIZE,%edx
kusano 2b45e8
	addl	$1 * SIZE,%ecx
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L45:
kusano 2b45e8
	ffreep	%st(0)
kusano 2b45e8
	FLD	ALPHA
kusano 2b45e8
kusano 2b45e8
	fmul	%st, %st(1)
kusano 2b45e8
	fmulp	%st, %st(2)
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	FADD	0 * SIZE(%edi)
kusano 2b45e8
	FST	0 * SIZE(%edi)
kusano 2b45e8
	FADD	1 * SIZE(%edi)
kusano 2b45e8
	FST	1 * SIZE(%edi)
kusano 2b45e8
#else
kusano 2b45e8
	FST	0 * SIZE(%edi)
kusano 2b45e8
	FST	1 * SIZE(%edi)
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	addl	$2 * SIZE, %edi
kusano 2b45e8
kusano 2b45e8
#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
kusano 2b45e8
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
kusano 2b45e8
	movl	K, %eax
kusano 2b45e8
	subl	KKK, %eax
kusano 2b45e8
	leal	(,%eax, SIZE), %eax
kusano 2b45e8
	leal	(%edx, %eax, 2), %edx
kusano 2b45e8
	leal	(%ecx, %eax, 1), %ecx
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(TRMMKERNEL) && defined(LEFT)
kusano 2b45e8
	addl	$2, KK
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
	decl	%esi			# i --
kusano 2b45e8
	jne	.L46
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.L36:
kusano 2b45e8
	movl	M,  %eax		# m			# MEMORY
kusano 2b45e8
	andl	$1, %eax		# m & 1
kusano 2b45e8
	je	.End
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
	movl	%ebx, %ecx
kusano 2b45e8
#else
kusano 2b45e8
	movl	KK,   %eax
kusano 2b45e8
	leal	(, %eax, SIZE), %eax
kusano 2b45e8
	leal	(%edx, %eax, 1), %edx
kusano 2b45e8
	leal	(%ebx, %eax, 1), %ecx
kusano 2b45e8
#endif	
kusano 2b45e8
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	movl	K, %eax
kusano 2b45e8
#elif (defined(LEFT) && !defined(TRANSA)) || (!defined(LEFT) && defined(TRANSA))
kusano 2b45e8
	movl	K, %eax
kusano 2b45e8
	subl	KK, %eax
kusano 2b45e8
	movl	%eax, KKK	
kusano 2b45e8
#else
kusano 2b45e8
	movl	KK, %eax
kusano 2b45e8
#ifdef LEFT
kusano 2b45e8
	addl	$1, %eax
kusano 2b45e8
#else
kusano 2b45e8
	addl	$1, %eax
kusano 2b45e8
#endif
kusano 2b45e8
	movl	%eax, KKK
kusano 2b45e8
#endif
kusano 2b45e8
	fldz
kusano 2b45e8
	ALIGN_3
kusano 2b45e8
kusano 2b45e8
.L51:
kusano 2b45e8
	FLD	(%edx)
kusano 2b45e8
	FMUL	(%ecx)
kusano 2b45e8
	addl	$1 * SIZE,%edx
kusano 2b45e8
	addl	$1 * SIZE,%ecx
kusano 2b45e8
	faddp	%st,%st(1)
kusano 2b45e8
	decl	%eax
kusano 2b45e8
	jne	.L51
kusano 2b45e8
kusano 2b45e8
	FMUL	ALPHA
kusano 2b45e8
#ifndef TRMMKERNEL
kusano 2b45e8
	FADD	(%edi)
kusano 2b45e8
	FST	(%edi)
kusano 2b45e8
#else
kusano 2b45e8
	FST	(%edi)
kusano 2b45e8
#endif
kusano 2b45e8
	ALIGN_4
kusano 2b45e8
kusano 2b45e8
.End:
kusano 2b45e8
	popl	%ebx
kusano 2b45e8
	popl	%esi
kusano 2b45e8
	popl	%edi
kusano 2b45e8
	popl	%ebp
kusano 2b45e8
	addl	$ARGS, %esp
kusano 2b45e8
	ret
kusano 2b45e8
kusano 2b45e8
	EPILOGUE