|
kusano |
2b45e8 |
/*********************************************************************/
|
|
kusano |
2b45e8 |
/* Copyright 2009, 2010 The University of Texas at Austin. */
|
|
kusano |
2b45e8 |
/* All rights reserved. */
|
|
kusano |
2b45e8 |
/* */
|
|
kusano |
2b45e8 |
/* Redistribution and use in source and binary forms, with or */
|
|
kusano |
2b45e8 |
/* without modification, are permitted provided that the following */
|
|
kusano |
2b45e8 |
/* conditions are met: */
|
|
kusano |
2b45e8 |
/* */
|
|
kusano |
2b45e8 |
/* 1. Redistributions of source code must retain the above */
|
|
kusano |
2b45e8 |
/* copyright notice, this list of conditions and the following */
|
|
kusano |
2b45e8 |
/* disclaimer. */
|
|
kusano |
2b45e8 |
/* */
|
|
kusano |
2b45e8 |
/* 2. Redistributions in binary form must reproduce the above */
|
|
kusano |
2b45e8 |
/* copyright notice, this list of conditions and the following */
|
|
kusano |
2b45e8 |
/* disclaimer in the documentation and/or other materials */
|
|
kusano |
2b45e8 |
/* provided with the distribution. */
|
|
kusano |
2b45e8 |
/* */
|
|
kusano |
2b45e8 |
/* THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF TEXAS AT */
|
|
kusano |
2b45e8 |
/* AUSTIN ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, */
|
|
kusano |
2b45e8 |
/* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
|
|
kusano |
2b45e8 |
/* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
|
|
kusano |
2b45e8 |
/* DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF TEXAS AT */
|
|
kusano |
2b45e8 |
/* AUSTIN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, */
|
|
kusano |
2b45e8 |
/* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
|
|
kusano |
2b45e8 |
/* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE */
|
|
kusano |
2b45e8 |
/* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR */
|
|
kusano |
2b45e8 |
/* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
|
|
kusano |
2b45e8 |
/* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
|
|
kusano |
2b45e8 |
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT */
|
|
kusano |
2b45e8 |
/* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
|
|
kusano |
2b45e8 |
/* POSSIBILITY OF SUCH DAMAGE. */
|
|
kusano |
2b45e8 |
/* */
|
|
kusano |
2b45e8 |
/* The views and conclusions contained in the software and */
|
|
kusano |
2b45e8 |
/* documentation are those of the authors and should not be */
|
|
kusano |
2b45e8 |
/* interpreted as representing official policies, either expressed */
|
|
kusano |
2b45e8 |
/* or implied, of The University of Texas at Austin. */
|
|
kusano |
2b45e8 |
/*********************************************************************/
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define ASSEMBLER
|
|
kusano |
2b45e8 |
#include "common.h"
|
|
kusano |
2b45e8 |
#include "version.h"
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define N $16
|
|
kusano |
2b45e8 |
#define X $17
|
|
kusano |
2b45e8 |
#define INCX $18
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifndef USE_MIN
|
|
kusano |
2b45e8 |
#define CMPLT(a, b) cmptlt a, b
|
|
kusano |
2b45e8 |
#else
|
|
kusano |
2b45e8 |
#define CMPLT(a, b) cmptlt b, a
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define STACKSIZE 8 * 8
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
PROLOGUE
|
|
kusano |
2b45e8 |
PROFCODE
|
|
kusano |
2b45e8 |
.frame $sp, STACKSIZE, $26, 0
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifdef F_INTERFACE
|
|
kusano |
2b45e8 |
ldl N, 0(N) # n
|
|
kusano |
2b45e8 |
ldl INCX, 0(INCX) # incx
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
lda $sp, -STACKSIZE($sp)
|
|
kusano |
2b45e8 |
nop
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
cmplt $31, N, $2
|
|
kusano |
2b45e8 |
cmplt $31, INCX, $3
|
|
kusano |
2b45e8 |
SXADDQ INCX, $31, INCX
|
|
kusano |
2b45e8 |
and $2, $3, $0
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
sra N, 3, $1
|
|
kusano |
2b45e8 |
fclr $f0
|
|
kusano |
2b45e8 |
unop
|
|
kusano |
2b45e8 |
beq $0, $End # if (n <= 0) or (incx <= 0) return
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LD $f0, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
unop
|
|
kusano |
2b45e8 |
unop
|
|
kusano |
2b45e8 |
ble $1, $L15
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fmov $f0, $f1
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
fmov $f0, $f10
|
|
kusano |
2b45e8 |
lda $1, -1($1)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LD $f21, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
fmov $f0, $f11
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
fmov $f0, $f12
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LD $f22, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
fmov $f0, $f13
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
fmov $f0, $f14
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LD $f23, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
fmov $f0, $f15
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
fmov $f0, $f20
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LD $f24, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
LD $f25, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
LD $f26, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
LD $f27, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
CMPLT($f0, $f20), $f16
|
|
kusano |
2b45e8 |
CMPLT($f1, $f21), $f17
|
|
kusano |
2b45e8 |
CMPLT($f10, $f22), $f18
|
|
kusano |
2b45e8 |
CMPLT($f11, $f23), $f19
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
ble $1, $L13
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
$L12:
|
|
kusano |
2b45e8 |
fcmovne $f16, $f20, $f0
|
|
kusano |
2b45e8 |
LD $f20, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
CMPLT($f12, $f24), $f16
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fcmovne $f17, $f21, $f1
|
|
kusano |
2b45e8 |
LD $f21, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
CMPLT($f13, $f25), $f17
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fcmovne $f18, $f22, $f10
|
|
kusano |
2b45e8 |
LD $f22, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
CMPLT($f14, $f26), $f18
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fcmovne $f19, $f23, $f11
|
|
kusano |
2b45e8 |
LD $f23, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
CMPLT($f15, $f27), $f19
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fcmovne $f16, $f24, $f12
|
|
kusano |
2b45e8 |
LD $f24, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
CMPLT($f0, $f20), $f16
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fcmovne $f17, $f25, $f13
|
|
kusano |
2b45e8 |
LD $f25, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
CMPLT($f1, $f21), $f17
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fcmovne $f18, $f26, $f14
|
|
kusano |
2b45e8 |
LD $f26, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
CMPLT($f10, $f22), $f18
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fcmovne $f19, $f27, $f15
|
|
kusano |
2b45e8 |
LD $f27, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
CMPLT($f11, $f23), $f19
|
|
kusano |
2b45e8 |
lda $1, -1($1) # i --
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
unop
|
|
kusano |
2b45e8 |
unop
|
|
kusano |
2b45e8 |
bgt $1,$L12
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
$L13:
|
|
kusano |
2b45e8 |
fcmovne $f16, $f20, $f0
|
|
kusano |
2b45e8 |
CMPLT($f12, $f24), $f16
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fcmovne $f17, $f21, $f1
|
|
kusano |
2b45e8 |
CMPLT($f13, $f25), $f17
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fcmovne $f18, $f22, $f10
|
|
kusano |
2b45e8 |
CMPLT($f14, $f26), $f18
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fcmovne $f19, $f23, $f11
|
|
kusano |
2b45e8 |
CMPLT($f15, $f27), $f19
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fcmovne $f16, $f24, $f12
|
|
kusano |
2b45e8 |
CMPLT($f0, $f1), $f16
|
|
kusano |
2b45e8 |
fcmovne $f17, $f25, $f13
|
|
kusano |
2b45e8 |
CMPLT($f10, $f11), $f17
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fcmovne $f18, $f26, $f14
|
|
kusano |
2b45e8 |
CMPLT($f12, $f13), $f18
|
|
kusano |
2b45e8 |
fcmovne $f19, $f27, $f15
|
|
kusano |
2b45e8 |
CMPLT($f14, $f15), $f19
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fcmovne $f16, $f1, $f0
|
|
kusano |
2b45e8 |
fcmovne $f17, $f11, $f10
|
|
kusano |
2b45e8 |
fcmovne $f18, $f13, $f12
|
|
kusano |
2b45e8 |
fcmovne $f19, $f15, $f14
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
CMPLT($f0, $f10), $f16
|
|
kusano |
2b45e8 |
CMPLT($f12, $f14), $f17
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fcmovne $f16, $f10, $f0
|
|
kusano |
2b45e8 |
fcmovne $f17, $f14, $f12
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
CMPLT($f0, $f12), $f16
|
|
kusano |
2b45e8 |
fcmovne $f16, $f12, $f0
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
$L15:
|
|
kusano |
2b45e8 |
and N, 7, $1
|
|
kusano |
2b45e8 |
unop
|
|
kusano |
2b45e8 |
unop
|
|
kusano |
2b45e8 |
ble $1, $End
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
$L16:
|
|
kusano |
2b45e8 |
LD $f20, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
addq X, INCX, X
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
CMPLT($f0, $f20), $f16
|
|
kusano |
2b45e8 |
fcmovne $f16, $f20, $f0
|
|
kusano |
2b45e8 |
lda $1, -1($1) # i --
|
|
kusano |
2b45e8 |
bgt $1, $L16
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
$End:
|
|
kusano |
2b45e8 |
lda $sp, STACKSIZE($sp)
|
|
kusano |
2b45e8 |
ret
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
EPILOGUE
|