|
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 N r3
|
|
kusano |
2b45e8 |
#define X r4
|
|
kusano |
2b45e8 |
#define INCX r5
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define INCX2 r6
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define C1 f1
|
|
kusano |
2b45e8 |
#define C2 f0
|
|
kusano |
2b45e8 |
#define C3 f2
|
|
kusano |
2b45e8 |
#define C4 f3
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define A1 f4
|
|
kusano |
2b45e8 |
#define A2 f5
|
|
kusano |
2b45e8 |
#define A3 f6
|
|
kusano |
2b45e8 |
#define A4 f7
|
|
kusano |
2b45e8 |
#define A5 f8
|
|
kusano |
2b45e8 |
#define A6 f9
|
|
kusano |
2b45e8 |
#define A7 f10
|
|
kusano |
2b45e8 |
#define A8 f11
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define F1 f12
|
|
kusano |
2b45e8 |
#define F2 f13
|
|
kusano |
2b45e8 |
#define F3 f14
|
|
kusano |
2b45e8 |
#define F4 f15
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define T1 f16
|
|
kusano |
2b45e8 |
#define T2 f17
|
|
kusano |
2b45e8 |
#define T3 f18
|
|
kusano |
2b45e8 |
#define T4 f19
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define B1 f20
|
|
kusano |
2b45e8 |
#define B2 f21
|
|
kusano |
2b45e8 |
#define B3 f22
|
|
kusano |
2b45e8 |
#define B4 f23
|
|
kusano |
2b45e8 |
#define B5 f24
|
|
kusano |
2b45e8 |
#define B6 f25
|
|
kusano |
2b45e8 |
#define B7 f26
|
|
kusano |
2b45e8 |
#define B8 f27
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
PROLOGUE
|
|
kusano |
2b45e8 |
PROFCODE
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
li r10, -16
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
stfpdux f14, SP, r10
|
|
kusano |
2b45e8 |
stfpdux f15, SP, r10
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
stfpdux f16, SP, r10
|
|
kusano |
2b45e8 |
stfpdux f17, SP, r10
|
|
kusano |
2b45e8 |
stfpdux f18, SP, r10
|
|
kusano |
2b45e8 |
stfpdux f19, SP, r10
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
stfpdux f20, SP, r10
|
|
kusano |
2b45e8 |
stfpdux f21, SP, r10
|
|
kusano |
2b45e8 |
stfpdux f22, SP, r10
|
|
kusano |
2b45e8 |
stfpdux f23, SP, r10
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
stfpdux f24, SP, r10
|
|
kusano |
2b45e8 |
stfpdux f25, SP, r10
|
|
kusano |
2b45e8 |
stfpdux f26, SP, r10
|
|
kusano |
2b45e8 |
stfpdux f27, SP, r10
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
li r10, 0
|
|
kusano |
2b45e8 |
stwu r10, -4(SP)
|
|
kusano |
2b45e8 |
stwu r10, -4(SP)
|
|
kusano |
2b45e8 |
stwu r10, -4(SP)
|
|
kusano |
2b45e8 |
stwu r10, -4(SP)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#ifdef F_INTERFACE
|
|
kusano |
2b45e8 |
LDINT N, 0(N)
|
|
kusano |
2b45e8 |
LDINT INCX, 0(INCX)
|
|
kusano |
2b45e8 |
#endif
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
lfpdx C1, SP, r10 # Zero clear
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
slwi INCX, INCX, BASE_SHIFT
|
|
kusano |
2b45e8 |
add INCX2, INCX, INCX
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
cmpwi cr0, N, 0
|
|
kusano |
2b45e8 |
ble LL(999)
|
|
kusano |
2b45e8 |
cmpwi cr0, INCX, 0
|
|
kusano |
2b45e8 |
ble LL(999)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LFD A1, 0 * SIZE(X)
|
|
kusano |
2b45e8 |
LFD A2, 1 * SIZE(X)
|
|
kusano |
2b45e8 |
add X, X, INCX2
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fabs A1, A1
|
|
kusano |
2b45e8 |
fabs A2, A2
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
addi N, N, -1
|
|
kusano |
2b45e8 |
cmpwi cr0, N, 0
|
|
kusano |
2b45e8 |
fadd C1, A1, A2
|
|
kusano |
2b45e8 |
ble LL(999)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
subi INCX2, INCX2, SIZE
|
|
kusano |
2b45e8 |
fsmfp C1, C1
|
|
kusano |
2b45e8 |
li INCX, SIZE
|
|
kusano |
2b45e8 |
fpmr C2, C1
|
|
kusano |
2b45e8 |
sub X, X, INCX2
|
|
kusano |
2b45e8 |
fpmr C3, C1
|
|
kusano |
2b45e8 |
srawi. r0, N, 3
|
|
kusano |
2b45e8 |
fpmr C4, C1
|
|
kusano |
2b45e8 |
mtspr CTR, r0
|
|
kusano |
2b45e8 |
beq- LL(105)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LFDUX A1, X, INCX2
|
|
kusano |
2b45e8 |
LFDUX A2, X, INCX
|
|
kusano |
2b45e8 |
LFDUX A3, X, INCX2
|
|
kusano |
2b45e8 |
LFDUX A4, X, INCX
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LFSDUX A1, X, INCX2
|
|
kusano |
2b45e8 |
LFSDUX A2, X, INCX
|
|
kusano |
2b45e8 |
LFSDUX A3, X, INCX2
|
|
kusano |
2b45e8 |
LFSDUX A4, X, INCX
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LFDUX A5, X, INCX2
|
|
kusano |
2b45e8 |
LFDUX A6, X, INCX
|
|
kusano |
2b45e8 |
LFDUX A7, X, INCX2
|
|
kusano |
2b45e8 |
LFDUX A8, X, INCX
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LFSDUX A5, X, INCX2
|
|
kusano |
2b45e8 |
LFSDUX A6, X, INCX
|
|
kusano |
2b45e8 |
LFSDUX A7, X, INCX2
|
|
kusano |
2b45e8 |
LFSDUX A8, X, INCX
|
|
kusano |
2b45e8 |
bdz LL(103)
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(102):
|
|
kusano |
2b45e8 |
fpabs B1, A1
|
|
kusano |
2b45e8 |
LFDUX A1, X, INCX2
|
|
kusano |
2b45e8 |
fpabs B2, A2
|
|
kusano |
2b45e8 |
LFDUX A2, X, INCX
|
|
kusano |
2b45e8 |
fpabs B3, A3
|
|
kusano |
2b45e8 |
LFDUX A3, X, INCX2
|
|
kusano |
2b45e8 |
fpabs B4, A4
|
|
kusano |
2b45e8 |
LFDUX A4, X, INCX
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpabs B5, A5
|
|
kusano |
2b45e8 |
LFSDUX A1, X, INCX2
|
|
kusano |
2b45e8 |
fpabs B6, A6
|
|
kusano |
2b45e8 |
LFSDUX A2, X, INCX
|
|
kusano |
2b45e8 |
fpabs B7, A7
|
|
kusano |
2b45e8 |
LFSDUX A3, X, INCX2
|
|
kusano |
2b45e8 |
fpabs B8, A8
|
|
kusano |
2b45e8 |
LFSDUX A4, X, INCX
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpadd T1, B1, B2
|
|
kusano |
2b45e8 |
LFDUX A5, X, INCX2
|
|
kusano |
2b45e8 |
fpadd T2, B3, B4
|
|
kusano |
2b45e8 |
LFDUX A6, X, INCX
|
|
kusano |
2b45e8 |
fpadd T3, B5, B6
|
|
kusano |
2b45e8 |
LFDUX A7, X, INCX2
|
|
kusano |
2b45e8 |
fpadd T4, B7, B8
|
|
kusano |
2b45e8 |
LFDUX A8, X, INCX
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpsub F1, T1, C1
|
|
kusano |
2b45e8 |
LFSDUX A5, X, INCX2
|
|
kusano |
2b45e8 |
fpsub F2, T2, C2
|
|
kusano |
2b45e8 |
LFSDUX A6, X, INCX
|
|
kusano |
2b45e8 |
fpsub F3, T3, C3
|
|
kusano |
2b45e8 |
LFSDUX A7, X, INCX2
|
|
kusano |
2b45e8 |
fpsub F4, T4, C4
|
|
kusano |
2b45e8 |
LFSDUX A8, X, INCX
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpsel C1, F1, C1, T1
|
|
kusano |
2b45e8 |
fpsel C2, F2, C2, T2
|
|
kusano |
2b45e8 |
fpsel C3, F3, C3, T3
|
|
kusano |
2b45e8 |
fpsel C4, F4, C4, T4
|
|
kusano |
2b45e8 |
bdnz LL(102)
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(103):
|
|
kusano |
2b45e8 |
fpabs B1, A1
|
|
kusano |
2b45e8 |
fpabs B2, A2
|
|
kusano |
2b45e8 |
fpabs B3, A3
|
|
kusano |
2b45e8 |
fpabs B4, A4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpabs B5, A5
|
|
kusano |
2b45e8 |
fpabs B6, A6
|
|
kusano |
2b45e8 |
fpabs B7, A7
|
|
kusano |
2b45e8 |
fpabs B8, A8
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpadd T1, B1, B2
|
|
kusano |
2b45e8 |
fpadd T2, B3, B4
|
|
kusano |
2b45e8 |
fpadd T3, B5, B6
|
|
kusano |
2b45e8 |
fpadd T4, B7, B8
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpsub F1, T1, C1
|
|
kusano |
2b45e8 |
fpsub F2, T2, C2
|
|
kusano |
2b45e8 |
fpsub F3, T3, C3
|
|
kusano |
2b45e8 |
fpsub F4, T4, C4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpsel C1, F1, C1, T1
|
|
kusano |
2b45e8 |
fpsel C2, F2, C2, T2
|
|
kusano |
2b45e8 |
fpsel C3, F3, C3, T3
|
|
kusano |
2b45e8 |
fpsel C4, F4, C4, T4
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(105):
|
|
kusano |
2b45e8 |
andi. r0, N, 7
|
|
kusano |
2b45e8 |
beq LL(998)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
andi. r0, N, 4
|
|
kusano |
2b45e8 |
beq LL(106)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LFDUX A1, X, INCX2
|
|
kusano |
2b45e8 |
LFDUX A2, X, INCX
|
|
kusano |
2b45e8 |
LFDUX A3, X, INCX2
|
|
kusano |
2b45e8 |
LFDUX A4, X, INCX
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LFSDUX A1, X, INCX2
|
|
kusano |
2b45e8 |
LFSDUX A2, X, INCX
|
|
kusano |
2b45e8 |
LFSDUX A3, X, INCX2
|
|
kusano |
2b45e8 |
LFSDUX A4, X, INCX
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpabs A1, A1
|
|
kusano |
2b45e8 |
fpabs A2, A2
|
|
kusano |
2b45e8 |
fpabs A3, A3
|
|
kusano |
2b45e8 |
fpabs A4, A4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpadd A1, A1, A2
|
|
kusano |
2b45e8 |
fpadd A3, A3, A4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpsub F1, A1, C1
|
|
kusano |
2b45e8 |
fpsub F2, A3, C2
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpsel C1, F1, C1, A1
|
|
kusano |
2b45e8 |
fpsel C2, F2, C2, A3
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(106):
|
|
kusano |
2b45e8 |
andi. r0, N, 2
|
|
kusano |
2b45e8 |
beq LL(107)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LFDUX A1, X, INCX2
|
|
kusano |
2b45e8 |
LFDUX A2, X, INCX
|
|
kusano |
2b45e8 |
LFSDUX A1, X, INCX2
|
|
kusano |
2b45e8 |
LFSDUX A2, X, INCX
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpabs A1, A1
|
|
kusano |
2b45e8 |
fpabs A2, A2
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpadd A1, A1, A2
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpsub F1, A1, C1
|
|
kusano |
2b45e8 |
fpsel C1, F1, C1, A1
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(107):
|
|
kusano |
2b45e8 |
andi. r0, N, 1
|
|
kusano |
2b45e8 |
beq LL(998)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LFDUX A1, X, INCX2
|
|
kusano |
2b45e8 |
LFDUX A2, X, INCX
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fabs A1, A1
|
|
kusano |
2b45e8 |
fabs A2, A2
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fadd A1, A1, A2
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fsub F1, A1, C1
|
|
kusano |
2b45e8 |
fsel C1, F1, C1, A1
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(998):
|
|
kusano |
2b45e8 |
fpsub F1, C2, C1
|
|
kusano |
2b45e8 |
fpsub F2, C4, C3
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpsel C1, F1, C1, C2
|
|
kusano |
2b45e8 |
fpsel C3, F2, C3, C4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fpsub F1, C3, C1
|
|
kusano |
2b45e8 |
fpsel C1, F1, C1, C3
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fsmtp C2, C1
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fsub F1, C2, C1
|
|
kusano |
2b45e8 |
fsel C1, F1, C1, C2
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(999):
|
|
kusano |
2b45e8 |
li r10, 16
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
lfpdux f27, SP, r10
|
|
kusano |
2b45e8 |
lfpdux f26, SP, r10
|
|
kusano |
2b45e8 |
lfpdux f25, SP, r10
|
|
kusano |
2b45e8 |
lfpdux f24, SP, r10
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
lfpdux f23, SP, r10
|
|
kusano |
2b45e8 |
lfpdux f22, SP, r10
|
|
kusano |
2b45e8 |
lfpdux f21, SP, r10
|
|
kusano |
2b45e8 |
lfpdux f20, SP, r10
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
lfpdux f19, SP, r10
|
|
kusano |
2b45e8 |
lfpdux f18, SP, r10
|
|
kusano |
2b45e8 |
lfpdux f17, SP, r10
|
|
kusano |
2b45e8 |
lfpdux f16, SP, r10
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
lfpdux f15, SP, r10
|
|
kusano |
2b45e8 |
lfpdux f14, SP, r10
|
|
kusano |
2b45e8 |
addi SP, SP, 16
|
|
kusano |
2b45e8 |
blr
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
EPILOGUE
|