|
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 |
#if defined(PENTIUM4) || defined(GENERIC)
|
|
kusano |
2b45e8 |
#define RPREFETCHSIZE 16
|
|
kusano |
2b45e8 |
#define WPREFETCHSIZE (RPREFETCHSIZE * 4)
|
|
kusano |
2b45e8 |
#define PREFETCH prefetcht0
|
|
kusano |
2b45e8 |
#define PREFETCHW prefetcht0
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#if defined(CORE2) || defined(PENRYN) || defined(DUNNINGTON) || defined(NEHALEM)
|
|
kusano |
2b45e8 |
#define RPREFETCHSIZE 12
|
|
kusano |
2b45e8 |
#define WPREFETCHSIZE (RPREFETCHSIZE * 4)
|
|
kusano |
2b45e8 |
#define PREFETCH prefetcht0
|
|
kusano |
2b45e8 |
#define PREFETCHW prefetcht2
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifdef ATOM
|
|
kusano |
2b45e8 |
#define RPREFETCHSIZE 16
|
|
kusano |
2b45e8 |
#define WPREFETCHSIZE (RPREFETCHSIZE * 4)
|
|
kusano |
2b45e8 |
#define PREFETCH prefetcht0
|
|
kusano |
2b45e8 |
#define PREFETCHW prefetcht0
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifdef NANO
|
|
kusano |
2b45e8 |
#define RPREFETCHSIZE 8
|
|
kusano |
2b45e8 |
#define WPREFETCHSIZE (RPREFETCHSIZE * 4)
|
|
kusano |
2b45e8 |
#define PREFETCH prefetcht0
|
|
kusano |
2b45e8 |
#define PREFETCHW prefetcht0
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifdef BARCELONA
|
|
kusano |
2b45e8 |
#define RPREFETCHSIZE 8
|
|
kusano |
2b45e8 |
#define WPREFETCHSIZE (RPREFETCHSIZE * 4)
|
|
kusano |
2b45e8 |
#define PREFETCH prefetch
|
|
kusano |
2b45e8 |
#define PREFETCHW prefetchw
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifdef GENERIC
|
|
kusano |
2b45e8 |
#define RPREFETCHSIZE 16
|
|
kusano |
2b45e8 |
#define WPREFETCHSIZE (RPREFETCHSIZE * 4)
|
|
kusano |
2b45e8 |
#define PREFETCH prefetcht0
|
|
kusano |
2b45e8 |
#define PREFETCHW prefetcht0
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifndef WINDOWS_ABI
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define M ARG1 /* rdi */
|
|
kusano |
2b45e8 |
#define N ARG2 /* rsi */
|
|
kusano |
2b45e8 |
#define A ARG3 /* rdx */
|
|
kusano |
2b45e8 |
#define LDA ARG4 /* rcx */
|
|
kusano |
2b45e8 |
#define B ARG5 /* r8 */
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define I %r10
|
|
kusano |
2b45e8 |
#define J %rbp
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define AO1 %r9
|
|
kusano |
2b45e8 |
#define AO2 %r15
|
|
kusano |
2b45e8 |
#define AO3 %r11
|
|
kusano |
2b45e8 |
#define AO4 %r14
|
|
kusano |
2b45e8 |
#define BO1 %r13
|
|
kusano |
2b45e8 |
#define BO2 %r12
|
|
kusano |
2b45e8 |
#define M8 %rbx
|
|
kusano |
2b45e8 |
#define BO %rax
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define STACKSIZE 256
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define M ARG1 /* rcx */
|
|
kusano |
2b45e8 |
#define N ARG2 /* rdx */
|
|
kusano |
2b45e8 |
#define A ARG3 /* r8 */
|
|
kusano |
2b45e8 |
#define LDA ARG4 /* r9 */
|
|
kusano |
2b45e8 |
#define OLD_B 40 + 64 + STACKSIZE(%rsp)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define B %rdi
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define I %r10
|
|
kusano |
2b45e8 |
#define J %r11
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define AO1 %r12
|
|
kusano |
2b45e8 |
#define AO2 %r13
|
|
kusano |
2b45e8 |
#define AO3 %r14
|
|
kusano |
2b45e8 |
#define AO4 %r15
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define BO1 %rsi
|
|
kusano |
2b45e8 |
#define BO2 %rbx
|
|
kusano |
2b45e8 |
#define M8 %rbp
|
|
kusano |
2b45e8 |
#define BO %rax
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
PROLOGUE
|
|
kusano |
2b45e8 |
PROFCODE
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifdef WINDOWS_ABI
|
|
kusano |
2b45e8 |
pushq %rdi
|
|
kusano |
2b45e8 |
pushq %rsi
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
pushq %r15
|
|
kusano |
2b45e8 |
pushq %r14
|
|
kusano |
2b45e8 |
pushq %r13
|
|
kusano |
2b45e8 |
pushq %r12
|
|
kusano |
2b45e8 |
pushq %rbp
|
|
kusano |
2b45e8 |
pushq %rbx
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifdef WINDOWS_ABI
|
|
kusano |
2b45e8 |
subq $STACKSIZE, %rsp
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movups %xmm6, 0(%rsp)
|
|
kusano |
2b45e8 |
movups %xmm7, 16(%rsp)
|
|
kusano |
2b45e8 |
movups %xmm8, 32(%rsp)
|
|
kusano |
2b45e8 |
movups %xmm9, 48(%rsp)
|
|
kusano |
2b45e8 |
movups %xmm10, 64(%rsp)
|
|
kusano |
2b45e8 |
movups %xmm11, 80(%rsp)
|
|
kusano |
2b45e8 |
movups %xmm12, 96(%rsp)
|
|
kusano |
2b45e8 |
movups %xmm13, 112(%rsp)
|
|
kusano |
2b45e8 |
movups %xmm14, 128(%rsp)
|
|
kusano |
2b45e8 |
movups %xmm15, 144(%rsp)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movq OLD_B, B
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movq N, %rax
|
|
kusano |
2b45e8 |
movq N, %rbx
|
|
kusano |
2b45e8 |
andq $-4, %rax
|
|
kusano |
2b45e8 |
andq $-2, %rbx
|
|
kusano |
2b45e8 |
imulq M, %rax
|
|
kusano |
2b45e8 |
imulq M, %rbx
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
leaq (B, %rax, SIZE), BO1
|
|
kusano |
2b45e8 |
leaq (B, %rbx, SIZE), BO2
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
leaq (, LDA, SIZE), LDA
|
|
kusano |
2b45e8 |
leaq (, M, SIZE), M8
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movq M, J
|
|
kusano |
2b45e8 |
sarq $2, J
|
|
kusano |
2b45e8 |
jle .L20
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L11:
|
|
kusano |
2b45e8 |
movq A, AO1
|
|
kusano |
2b45e8 |
leaq (A, LDA ), AO2
|
|
kusano |
2b45e8 |
leaq (A, LDA, 2), AO3
|
|
kusano |
2b45e8 |
leaq (AO2, LDA, 2), AO4
|
|
kusano |
2b45e8 |
leaq (A, LDA, 4), A
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movq B, BO
|
|
kusano |
2b45e8 |
addq $16 * SIZE, B
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movq N, I
|
|
kusano |
2b45e8 |
sarq $2, I
|
|
kusano |
2b45e8 |
jle .L13
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L12:
|
|
kusano |
2b45e8 |
#ifndef DOUBLE
|
|
kusano |
2b45e8 |
movlps 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movhps 2 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movlps 0 * SIZE(AO2), %xmm1
|
|
kusano |
2b45e8 |
movhps 2 * SIZE(AO2), %xmm1
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movlps 0 * SIZE(AO3), %xmm2
|
|
kusano |
2b45e8 |
movhps 2 * SIZE(AO3), %xmm2
|
|
kusano |
2b45e8 |
movlps 0 * SIZE(AO4), %xmm3
|
|
kusano |
2b45e8 |
movhps 2 * SIZE(AO4), %xmm3
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#if defined(PENTIUM4) || defined(GENERIC)
|
|
kusano |
2b45e8 |
PREFETCH RPREFETCHSIZE * SIZE(AO1)
|
|
kusano |
2b45e8 |
PREFETCH RPREFETCHSIZE * SIZE(AO2)
|
|
kusano |
2b45e8 |
PREFETCH RPREFETCHSIZE * SIZE(AO3)
|
|
kusano |
2b45e8 |
PREFETCH RPREFETCHSIZE * SIZE(AO4)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
PREFETCHW WPREFETCHSIZE * SIZE(BO)
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movaps %xmm0, 0 * SIZE(BO)
|
|
kusano |
2b45e8 |
movaps %xmm1, 4 * SIZE(BO)
|
|
kusano |
2b45e8 |
movaps %xmm2, 8 * SIZE(BO)
|
|
kusano |
2b45e8 |
movaps %xmm3, 12 * SIZE(BO)
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
PREFETCH RPREFETCHSIZE * SIZE(AO1)
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movhpd 1 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movsd 2 * SIZE(AO1), %xmm1
|
|
kusano |
2b45e8 |
movhpd 3 * SIZE(AO1), %xmm1
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
PREFETCH RPREFETCHSIZE * SIZE(AO2)
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO2), %xmm2
|
|
kusano |
2b45e8 |
movhpd 1 * SIZE(AO2), %xmm2
|
|
kusano |
2b45e8 |
movsd 2 * SIZE(AO2), %xmm3
|
|
kusano |
2b45e8 |
movhpd 3 * SIZE(AO2), %xmm3
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
PREFETCH RPREFETCHSIZE * SIZE(AO3)
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO3), %xmm4
|
|
kusano |
2b45e8 |
movhpd 1 * SIZE(AO3), %xmm4
|
|
kusano |
2b45e8 |
movsd 2 * SIZE(AO3), %xmm5
|
|
kusano |
2b45e8 |
movhpd 3 * SIZE(AO3), %xmm5
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
PREFETCH RPREFETCHSIZE * SIZE(AO4)
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO4), %xmm6
|
|
kusano |
2b45e8 |
movhpd 1 * SIZE(AO4), %xmm6
|
|
kusano |
2b45e8 |
movsd 2 * SIZE(AO4), %xmm7
|
|
kusano |
2b45e8 |
movhpd 3 * SIZE(AO4), %xmm7
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
PREFETCHW WPREFETCHSIZE * SIZE(BO)
|
|
kusano |
2b45e8 |
movapd %xmm0, 0 * SIZE(BO)
|
|
kusano |
2b45e8 |
movapd %xmm1, 2 * SIZE(BO)
|
|
kusano |
2b45e8 |
movapd %xmm2, 4 * SIZE(BO)
|
|
kusano |
2b45e8 |
movapd %xmm3, 6 * SIZE(BO)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#if defined(CORE2) || defined(PENRYN) || defined(DUNNINGTON)
|
|
kusano |
2b45e8 |
PREFETCHW (WPREFETCHSIZE + 8) * SIZE(B)
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
movapd %xmm4, 8 * SIZE(BO)
|
|
kusano |
2b45e8 |
movapd %xmm5, 10 * SIZE(BO)
|
|
kusano |
2b45e8 |
movapd %xmm6, 12 * SIZE(BO)
|
|
kusano |
2b45e8 |
movapd %xmm7, 14 * SIZE(BO)
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
leaq (BO, M8, 4), BO
|
|
kusano |
2b45e8 |
addq $4 * SIZE, AO1
|
|
kusano |
2b45e8 |
addq $4 * SIZE, AO2
|
|
kusano |
2b45e8 |
addq $4 * SIZE, AO3
|
|
kusano |
2b45e8 |
addq $4 * SIZE, AO4
|
|
kusano |
2b45e8 |
decq I
|
|
kusano |
2b45e8 |
jg .L12
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L13:
|
|
kusano |
2b45e8 |
testq $2, N
|
|
kusano |
2b45e8 |
jle .L14
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifndef DOUBLE
|
|
kusano |
2b45e8 |
movlps 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movhps 0 * SIZE(AO2), %xmm0
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movlps 0 * SIZE(AO3), %xmm1
|
|
kusano |
2b45e8 |
movhps 0 * SIZE(AO4), %xmm1
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movaps %xmm0, 0 * SIZE(BO1)
|
|
kusano |
2b45e8 |
movaps %xmm1, 4 * SIZE(BO1)
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movhpd 1 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO2), %xmm1
|
|
kusano |
2b45e8 |
movhpd 1 * SIZE(AO2), %xmm1
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO3), %xmm2
|
|
kusano |
2b45e8 |
movhpd 1 * SIZE(AO3), %xmm2
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO4), %xmm3
|
|
kusano |
2b45e8 |
movhpd 1 * SIZE(AO4), %xmm3
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movapd %xmm0, 0 * SIZE(BO1)
|
|
kusano |
2b45e8 |
movapd %xmm1, 2 * SIZE(BO1)
|
|
kusano |
2b45e8 |
movapd %xmm2, 4 * SIZE(BO1)
|
|
kusano |
2b45e8 |
movapd %xmm3, 6 * SIZE(BO1)
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
addq $2 * SIZE, AO1
|
|
kusano |
2b45e8 |
addq $2 * SIZE, AO2
|
|
kusano |
2b45e8 |
addq $2 * SIZE, AO3
|
|
kusano |
2b45e8 |
addq $2 * SIZE, AO4
|
|
kusano |
2b45e8 |
addq $8 * SIZE, BO1
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L14:
|
|
kusano |
2b45e8 |
testq $1, N
|
|
kusano |
2b45e8 |
jle .L19
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifndef DOUBLE
|
|
kusano |
2b45e8 |
movss 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movss 0 * SIZE(AO2), %xmm1
|
|
kusano |
2b45e8 |
movss 0 * SIZE(AO3), %xmm2
|
|
kusano |
2b45e8 |
movss 0 * SIZE(AO4), %xmm3
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movss %xmm0, 0 * SIZE(BO2)
|
|
kusano |
2b45e8 |
movss %xmm1, 1 * SIZE(BO2)
|
|
kusano |
2b45e8 |
movss %xmm2, 2 * SIZE(BO2)
|
|
kusano |
2b45e8 |
movss %xmm3, 3 * SIZE(BO2)
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movhpd 0 * SIZE(AO2), %xmm0
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO3), %xmm1
|
|
kusano |
2b45e8 |
movhpd 0 * SIZE(AO4), %xmm1
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movapd %xmm0, 0 * SIZE(BO2)
|
|
kusano |
2b45e8 |
movapd %xmm1, 2 * SIZE(BO2)
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
addq $4 * SIZE, BO2
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L19:
|
|
kusano |
2b45e8 |
decq J
|
|
kusano |
2b45e8 |
jg .L11
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L20:
|
|
kusano |
2b45e8 |
testq $2, M
|
|
kusano |
2b45e8 |
jle .L30
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L21:
|
|
kusano |
2b45e8 |
movq A, AO1
|
|
kusano |
2b45e8 |
leaq (A, LDA ), AO2
|
|
kusano |
2b45e8 |
leaq (A, LDA, 2), A
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movq B, BO
|
|
kusano |
2b45e8 |
addq $8 * SIZE, B
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movq N, I
|
|
kusano |
2b45e8 |
sarq $2, I
|
|
kusano |
2b45e8 |
jle .L23
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L22:
|
|
kusano |
2b45e8 |
#ifndef DOUBLE
|
|
kusano |
2b45e8 |
movlps 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movhps 2 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movlps 0 * SIZE(AO2), %xmm1
|
|
kusano |
2b45e8 |
movhps 2 * SIZE(AO2), %xmm1
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#if defined(PENTIUM4) || defined(GENERIC)
|
|
kusano |
2b45e8 |
PREFETCH RPREFETCHSIZE * SIZE(AO1)
|
|
kusano |
2b45e8 |
PREFETCH RPREFETCHSIZE * SIZE(AO2)
|
|
kusano |
2b45e8 |
PREFETCHW WPREFETCHSIZE * SIZE(BO)
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movaps %xmm0, 0 * SIZE(BO)
|
|
kusano |
2b45e8 |
movaps %xmm1, 4 * SIZE(BO)
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movhpd 1 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movsd 2 * SIZE(AO1), %xmm1
|
|
kusano |
2b45e8 |
movhpd 3 * SIZE(AO1), %xmm1
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO2), %xmm2
|
|
kusano |
2b45e8 |
movhpd 1 * SIZE(AO2), %xmm2
|
|
kusano |
2b45e8 |
movsd 2 * SIZE(AO2), %xmm3
|
|
kusano |
2b45e8 |
movhpd 3 * SIZE(AO2), %xmm3
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#if defined(PENTIUM4) || defined(GENERIC)
|
|
kusano |
2b45e8 |
PREFETCH RPREFETCHSIZE * SIZE(AO1)
|
|
kusano |
2b45e8 |
PREFETCH RPREFETCHSIZE * SIZE(AO2)
|
|
kusano |
2b45e8 |
PREFETCHW WPREFETCHSIZE * SIZE(BO)
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movapd %xmm0, 0 * SIZE(BO)
|
|
kusano |
2b45e8 |
movapd %xmm1, 2 * SIZE(BO)
|
|
kusano |
2b45e8 |
movapd %xmm2, 4 * SIZE(BO)
|
|
kusano |
2b45e8 |
movapd %xmm3, 6 * SIZE(BO)
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
addq $4 * SIZE, AO1
|
|
kusano |
2b45e8 |
addq $4 * SIZE, AO2
|
|
kusano |
2b45e8 |
leaq (BO, M8, 4), BO
|
|
kusano |
2b45e8 |
decq I
|
|
kusano |
2b45e8 |
jg .L22
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L23:
|
|
kusano |
2b45e8 |
testq $2, N
|
|
kusano |
2b45e8 |
jle .L24
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifndef DOUBLE
|
|
kusano |
2b45e8 |
movlps 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movhps 0 * SIZE(AO2), %xmm0
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movaps %xmm0, 0 * SIZE(BO1)
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movhpd 1 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO2), %xmm1
|
|
kusano |
2b45e8 |
movhpd 1 * SIZE(AO2), %xmm1
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movapd %xmm0, 0 * SIZE(BO1)
|
|
kusano |
2b45e8 |
movapd %xmm1, 2 * SIZE(BO1)
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
addq $2 * SIZE, AO1
|
|
kusano |
2b45e8 |
addq $2 * SIZE, AO2
|
|
kusano |
2b45e8 |
addq $4 * SIZE, BO1
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L24:
|
|
kusano |
2b45e8 |
testq $1, N
|
|
kusano |
2b45e8 |
jle .L30
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifndef DOUBLE
|
|
kusano |
2b45e8 |
movss 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movss 0 * SIZE(AO2), %xmm1
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movss %xmm0, 0 * SIZE(BO2)
|
|
kusano |
2b45e8 |
movss %xmm1, 1 * SIZE(BO2)
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movhpd 0 * SIZE(AO2), %xmm0
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movapd %xmm0, 0 * SIZE(BO2)
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
addq $2 * SIZE, BO2
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L30:
|
|
kusano |
2b45e8 |
testq $1, M
|
|
kusano |
2b45e8 |
jle .L999
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L31:
|
|
kusano |
2b45e8 |
movq A, AO1
|
|
kusano |
2b45e8 |
movq B, BO
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movq N, I
|
|
kusano |
2b45e8 |
sarq $2, I
|
|
kusano |
2b45e8 |
jle .L33
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L32:
|
|
kusano |
2b45e8 |
#ifndef DOUBLE
|
|
kusano |
2b45e8 |
movlps 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movhps 2 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movaps %xmm0, 0 * SIZE(BO)
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movhpd 1 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movsd 2 * SIZE(AO1), %xmm1
|
|
kusano |
2b45e8 |
movhpd 3 * SIZE(AO1), %xmm1
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movapd %xmm0, 0 * SIZE(BO)
|
|
kusano |
2b45e8 |
movapd %xmm1, 2 * SIZE(BO)
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
addq $4 * SIZE, AO1
|
|
kusano |
2b45e8 |
leaq (BO, M8, 4), BO
|
|
kusano |
2b45e8 |
decq I
|
|
kusano |
2b45e8 |
jg .L32
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L33:
|
|
kusano |
2b45e8 |
testq $2, N
|
|
kusano |
2b45e8 |
jle .L34
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifndef DOUBLE
|
|
kusano |
2b45e8 |
movlps 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movlps %xmm0, 0 * SIZE(BO1)
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movhpd 1 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
movapd %xmm0, 0 * SIZE(BO1)
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
addq $2 * SIZE, AO1
|
|
kusano |
2b45e8 |
addq $2 * SIZE, BO1
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L34:
|
|
kusano |
2b45e8 |
testq $1, N
|
|
kusano |
2b45e8 |
jle .L999
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifndef DOUBLE
|
|
kusano |
2b45e8 |
movss 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movss %xmm0, 0 * SIZE(BO2)
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
movsd 0 * SIZE(AO1), %xmm0
|
|
kusano |
2b45e8 |
movsd %xmm0, 0 * SIZE(BO2)
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
addq $1 * SIZE, BO2
|
|
kusano |
2b45e8 |
ALIGN_4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
.L999:
|
|
kusano |
2b45e8 |
#ifdef WINDOWS_ABI
|
|
kusano |
2b45e8 |
movups 0(%rsp), %xmm6
|
|
kusano |
2b45e8 |
movups 16(%rsp), %xmm7
|
|
kusano |
2b45e8 |
movups 32(%rsp), %xmm8
|
|
kusano |
2b45e8 |
movups 48(%rsp), %xmm9
|
|
kusano |
2b45e8 |
movups 64(%rsp), %xmm10
|
|
kusano |
2b45e8 |
movups 80(%rsp), %xmm11
|
|
kusano |
2b45e8 |
movups 96(%rsp), %xmm12
|
|
kusano |
2b45e8 |
movups 112(%rsp), %xmm13
|
|
kusano |
2b45e8 |
movups 128(%rsp), %xmm14
|
|
kusano |
2b45e8 |
movups 144(%rsp), %xmm15
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
addq $STACKSIZE, %rsp
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
popq %rbx
|
|
kusano |
2b45e8 |
popq %rbp
|
|
kusano |
2b45e8 |
popq %r12
|
|
kusano |
2b45e8 |
popq %r13
|
|
kusano |
2b45e8 |
popq %r14
|
|
kusano |
2b45e8 |
popq %r15
|
|
kusano |
2b45e8 |
#ifdef WINDOWS_ABI
|
|
kusano |
2b45e8 |
popq %rsi
|
|
kusano |
2b45e8 |
popq %rdi
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
ret
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
EPILOGUE
|