|
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 M r3
|
|
kusano |
2b45e8 |
#define N r4
|
|
kusano |
2b45e8 |
#define A r5
|
|
kusano |
2b45e8 |
#define LDA r6
|
|
kusano |
2b45e8 |
#define B r7
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define AO1 r8
|
|
kusano |
2b45e8 |
#define AO2 r9
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define J r10
|
|
kusano |
2b45e8 |
#define B1 r11
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define B2 r28
|
|
kusano |
2b45e8 |
#define M4 r29
|
|
kusano |
2b45e8 |
#define INC r30
|
|
kusano |
2b45e8 |
#define INC2 r31
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
#define c01 f0
|
|
kusano |
2b45e8 |
#define c02 f1
|
|
kusano |
2b45e8 |
#define c03 f2
|
|
kusano |
2b45e8 |
#define c04 f3
|
|
kusano |
2b45e8 |
#define c05 f4
|
|
kusano |
2b45e8 |
#define c06 f5
|
|
kusano |
2b45e8 |
#define c07 f6
|
|
kusano |
2b45e8 |
#define c08 f7
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
PROLOGUE
|
|
kusano |
2b45e8 |
PROFCODE
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
stwu r31, -4(SP)
|
|
kusano |
2b45e8 |
stwu r30, -4(SP)
|
|
kusano |
2b45e8 |
stwu r29, -4(SP)
|
|
kusano |
2b45e8 |
stwu r28, -4(SP)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
slwi LDA, LDA, ZBASE_SHIFT
|
|
kusano |
2b45e8 |
slwi M4, M, 1 + ZBASE_SHIFT
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
li r9, -2
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
and B2, N, r9
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
mullw B2, B2, M
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
slwi B2, B2, ZBASE_SHIFT
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
add B2, B2, B
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
cmpwi cr0, M, 0
|
|
kusano |
2b45e8 |
ble- LL(99)
|
|
kusano |
2b45e8 |
cmpwi cr0, N, 0
|
|
kusano |
2b45e8 |
ble- LL(99)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
subi B2, B2, 2 * SIZE
|
|
kusano |
2b45e8 |
subi M4, M4, 6 * SIZE
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
li INC, 1 * SIZE
|
|
kusano |
2b45e8 |
li INC2, 2 * SIZE
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
andi. r0, A, 2 * SIZE - 1
|
|
kusano |
2b45e8 |
bne LL(100)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
subi A, A, 2 * SIZE
|
|
kusano |
2b45e8 |
srawi. J, M, 1
|
|
kusano |
2b45e8 |
ble LL(20)
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(10):
|
|
kusano |
2b45e8 |
mr AO1, A
|
|
kusano |
2b45e8 |
add AO2, A, LDA
|
|
kusano |
2b45e8 |
add A, AO2, LDA
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
sub B1, B, M4
|
|
kusano |
2b45e8 |
addi B, B, 8 * SIZE
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
srawi. r0, N, 1
|
|
kusano |
2b45e8 |
mtspr CTR, r0
|
|
kusano |
2b45e8 |
ble LL(15)
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(12):
|
|
kusano |
2b45e8 |
LFPDUX c01, AO1, INC2
|
|
kusano |
2b45e8 |
LFPDUX c02, AO1, INC2
|
|
kusano |
2b45e8 |
LFPDUX c03, AO2, INC2
|
|
kusano |
2b45e8 |
LFPDUX c04, AO2, INC2
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
STFPDUX c01, B1, M4
|
|
kusano |
2b45e8 |
STFPDUX c02, B1, INC2
|
|
kusano |
2b45e8 |
STFPDUX c03, B1, INC2
|
|
kusano |
2b45e8 |
STFPDUX c04, B1, INC2
|
|
kusano |
2b45e8 |
bdnz LL(12)
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(15):
|
|
kusano |
2b45e8 |
andi. r0, N, 1
|
|
kusano |
2b45e8 |
ble LL(19)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LFPDUX c01, AO1, INC2
|
|
kusano |
2b45e8 |
LFPDUX c02, AO2, INC2
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
STFPDUX c01, B2, INC2
|
|
kusano |
2b45e8 |
STFPDUX c02, B2, INC2
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(19):
|
|
kusano |
2b45e8 |
addic. J, J, -1
|
|
kusano |
2b45e8 |
bgt LL(10)
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(20):
|
|
kusano |
2b45e8 |
andi. J, M, 1
|
|
kusano |
2b45e8 |
addi M4, M4, 4 * SIZE
|
|
kusano |
2b45e8 |
ble LL(99)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
mr AO1, A
|
|
kusano |
2b45e8 |
sub B1, B, M4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
srawi. r0, N, 1
|
|
kusano |
2b45e8 |
mtspr CTR, r0
|
|
kusano |
2b45e8 |
ble LL(23)
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(22):
|
|
kusano |
2b45e8 |
LFPDUX c01, AO1, INC2
|
|
kusano |
2b45e8 |
LFPDUX c02, AO1, INC2
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
STFPDUX c01, B1, M4
|
|
kusano |
2b45e8 |
STFPDUX c02, B1, INC2
|
|
kusano |
2b45e8 |
bdnz LL(22)
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(23):
|
|
kusano |
2b45e8 |
andi. r0, N, 1
|
|
kusano |
2b45e8 |
ble LL(99)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LFPDUX c01, AO1, INC2
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
STFPDUX c01, B2, INC2
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(99):
|
|
kusano |
2b45e8 |
addi SP, SP, -4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
lwzu r28, 4(SP)
|
|
kusano |
2b45e8 |
lwzu r29, 4(SP)
|
|
kusano |
2b45e8 |
lwzu r30, 4(SP)
|
|
kusano |
2b45e8 |
lwzu r31, 4(SP)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
addi SP, SP, 4
|
|
kusano |
2b45e8 |
blr
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(100):
|
|
kusano |
2b45e8 |
subi A, A, SIZE
|
|
kusano |
2b45e8 |
srawi. J, M, 1
|
|
kusano |
2b45e8 |
ble LL(120)
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(110):
|
|
kusano |
2b45e8 |
mr AO1, A
|
|
kusano |
2b45e8 |
add AO2, A, LDA
|
|
kusano |
2b45e8 |
add A, AO2, LDA
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
sub B1, B, M4
|
|
kusano |
2b45e8 |
addi B, B, 8 * SIZE
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
srawi. r0, N, 1
|
|
kusano |
2b45e8 |
mtspr CTR, r0
|
|
kusano |
2b45e8 |
ble LL(115)
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(112):
|
|
kusano |
2b45e8 |
LFDUX c01, AO1, INC
|
|
kusano |
2b45e8 |
LFDUX c02, AO1, INC
|
|
kusano |
2b45e8 |
LFDUX c03, AO1, INC
|
|
kusano |
2b45e8 |
LFDUX c04, AO1, INC
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LFDUX c05, AO2, INC
|
|
kusano |
2b45e8 |
fsmfp c01, c02
|
|
kusano |
2b45e8 |
LFDUX c06, AO2, INC
|
|
kusano |
2b45e8 |
fsmfp c03, c04
|
|
kusano |
2b45e8 |
LFDUX c07, AO2, INC
|
|
kusano |
2b45e8 |
fsmfp c05, c06
|
|
kusano |
2b45e8 |
LFDUX c08, AO2, INC
|
|
kusano |
2b45e8 |
fsmfp c07, c08
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
STFPDUX c01, B1, M4
|
|
kusano |
2b45e8 |
STFPDUX c03, B1, INC2
|
|
kusano |
2b45e8 |
STFPDUX c05, B1, INC2
|
|
kusano |
2b45e8 |
STFPDUX c07, B1, INC2
|
|
kusano |
2b45e8 |
bdnz LL(112)
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(115):
|
|
kusano |
2b45e8 |
andi. r0, N, 1
|
|
kusano |
2b45e8 |
ble LL(119)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LFDUX c01, AO1, INC
|
|
kusano |
2b45e8 |
LFDUX c02, AO1, INC
|
|
kusano |
2b45e8 |
LFDUX c03, AO2, INC
|
|
kusano |
2b45e8 |
LFDUX c04, AO2, INC
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fsmfp c01, c02
|
|
kusano |
2b45e8 |
fsmfp c03, c04
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
STFPDUX c01, B2, INC2
|
|
kusano |
2b45e8 |
STFPDUX c03, B2, INC2
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(119):
|
|
kusano |
2b45e8 |
addic. J, J, -1
|
|
kusano |
2b45e8 |
bgt LL(110)
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(120):
|
|
kusano |
2b45e8 |
andi. J, M, 1
|
|
kusano |
2b45e8 |
addi M4, M4, 4 * SIZE
|
|
kusano |
2b45e8 |
ble LL(999)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
mr AO1, A
|
|
kusano |
2b45e8 |
sub B1, B, M4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
srawi. r0, N, 1
|
|
kusano |
2b45e8 |
mtspr CTR, r0
|
|
kusano |
2b45e8 |
ble LL(123)
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(122):
|
|
kusano |
2b45e8 |
LFDUX c01, AO1, INC
|
|
kusano |
2b45e8 |
LFDUX c02, AO1, INC
|
|
kusano |
2b45e8 |
LFDUX c03, AO1, INC
|
|
kusano |
2b45e8 |
LFDUX c04, AO1, INC
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fsmfp c01, c02
|
|
kusano |
2b45e8 |
fsmfp c03, c04
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
STFPDUX c01, B1, M4
|
|
kusano |
2b45e8 |
STFPDUX c03, B1, INC2
|
|
kusano |
2b45e8 |
bdnz LL(122)
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(123):
|
|
kusano |
2b45e8 |
andi. r0, N, 1
|
|
kusano |
2b45e8 |
ble LL(999)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LFDUX c01, AO1, INC
|
|
kusano |
2b45e8 |
LFDUX c02, AO1, INC
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
fsmfp c01, c02
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
STFPDUX c01, B2, INC2
|
|
kusano |
2b45e8 |
.align 4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
LL(999):
|
|
kusano |
2b45e8 |
addi SP, SP, -4
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
lwzu r28, 4(SP)
|
|
kusano |
2b45e8 |
lwzu r29, 4(SP)
|
|
kusano |
2b45e8 |
lwzu r30, 4(SP)
|
|
kusano |
2b45e8 |
lwzu r31, 4(SP)
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
addi SP, SP, 4
|
|
kusano |
2b45e8 |
blr
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
|
|
kusano |
2b45e8 |
EPILOGUE
|