Blame thirdparty/openblas/xianyi-OpenBLAS-e6e87a2/kernel/power/znrm2_hummer.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 N	r3
kusano 2b45e8
#define X	r4
kusano 2b45e8
#define INCX	r5	
kusano 2b45e8
kusano 2b45e8
#define INCX2	r6
kusano 2b45e8
#define X2	r7
kusano 2b45e8
kusano 2b45e8
#define XX	r8
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 ALPHA	f4
kusano 2b45e8
#define ALPHA_R	f5
kusano 2b45e8
kusano 2b45e8
#define A1	f6
kusano 2b45e8
#define A2	f7
kusano 2b45e8
#define A3	f8
kusano 2b45e8
#define A4	f9
kusano 2b45e8
#define A5	f10
kusano 2b45e8
#define A6	f11
kusano 2b45e8
#define A7	f12
kusano 2b45e8
#define A8	f13
kusano 2b45e8
kusano 2b45e8
#define F1	f14
kusano 2b45e8
#define F2	f15
kusano 2b45e8
#define F3	f16
kusano 2b45e8
#define F4	f17
kusano 2b45e8
#define F5	f18
kusano 2b45e8
#define F6	f19
kusano 2b45e8
#define F7	f20
kusano 2b45e8
#define F8	f21
kusano 2b45e8
kusano 2b45e8
#define T1	f22
kusano 2b45e8
#define T2	f23
kusano 2b45e8
#define T3	f24
kusano 2b45e8
#define T4	f25
kusano 2b45e8
#define T5	f26
kusano 2b45e8
#define T6	f27
kusano 2b45e8
#define T7	f28
kusano 2b45e8
#define T8	f29
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
	stfpdux	f28, SP, r10
kusano 2b45e8
	stfpdux	f29, SP, r10
kusano 2b45e8
kusano 2b45e8
	li	r10,   0
kusano 2b45e8
	lis	r11, 0x3f80
kusano 2b45e8
	stwu	r11,   -4(SP)
kusano 2b45e8
	stwu	r11,   -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
	lfpsx	C1, SP, r10		# Zero clear
kusano 2b45e8
kusano 2b45e8
	slwi	INCX,  INCX, BASE_SHIFT
kusano 2b45e8
	add	INCX2, INCX, INCX
kusano 2b45e8
kusano 2b45e8
	fpmr	C2, C1
kusano 2b45e8
	fpmr	C3, C1
kusano 2b45e8
	fpmr	C4, C1
kusano 2b45e8
kusano 2b45e8
	cmpwi	cr0, N, 0
kusano 2b45e8
	ble	LL(99)
kusano 2b45e8
	cmpwi	cr0, INCX, 0
kusano 2b45e8
	ble	LL(99)
kusano 2b45e8
kusano 2b45e8
	mr	XX, X
kusano 2b45e8
kusano 2b45e8
	andi.	r0, X, 2 * SIZE - 1
kusano 2b45e8
	bne	LL(100)
kusano 2b45e8
kusano 2b45e8
/* aligned */
kusano 2b45e8
kusano 2b45e8
	sub	X, X, INCX2
kusano 2b45e8
kusano 2b45e8
	srawi.	r0, N, 3
kusano 2b45e8
	mtspr	CTR,  r0
kusano 2b45e8
	beq-	LL(15)
kusano 2b45e8
kusano 2b45e8
	LFPDUX	A1,    X, INCX2
kusano 2b45e8
	LFPDUX	A2,    X, INCX2
kusano 2b45e8
	LFPDUX	A3,    X, INCX2
kusano 2b45e8
	LFPDUX	A4,    X, INCX2
kusano 2b45e8
kusano 2b45e8
	LFPDUX	A5,    X, INCX2
kusano 2b45e8
	fpabs	T1, A1
kusano 2b45e8
	LFPDUX	A6,    X, INCX2
kusano 2b45e8
	fpabs	T2, A2
kusano 2b45e8
	LFPDUX	A7,    X, INCX2
kusano 2b45e8
	fpabs	T3, A3
kusano 2b45e8
	LFPDUX	A8,    X, INCX2
kusano 2b45e8
	fpabs	T4, A4
kusano 2b45e8
	bdz	LL(13)
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(12):
kusano 2b45e8
	fpsub	F1, C1, T1
kusano 2b45e8
	LFPDUX	A1,    X, INCX2
kusano 2b45e8
	fpsub	F2, C2, T2
kusano 2b45e8
	LFPDUX	A2,    X, INCX2
kusano 2b45e8
	fpsub	F3, C3, T3
kusano 2b45e8
	LFPDUX	A3,    X, INCX2
kusano 2b45e8
	fpsub	F4, C4, T4
kusano 2b45e8
	LFPDUX	A4,    X, INCX2
kusano 2b45e8
kusano 2b45e8
	fpabs	T5, A5
kusano 2b45e8
	fpabs	T6, A6
kusano 2b45e8
	fpabs	T7, A7
kusano 2b45e8
	fpabs	T8, A8
kusano 2b45e8
kusano 2b45e8
	fpsel	C1, F1, C1, T1
kusano 2b45e8
	LFPDUX	A5,    X, INCX2
kusano 2b45e8
	fpsel	C2, F2, C2, T2
kusano 2b45e8
	LFPDUX	A6,    X, INCX2
kusano 2b45e8
	fpsel	C3, F3, C3, T3
kusano 2b45e8
	LFPDUX	A7,    X, INCX2
kusano 2b45e8
	fpsel	C4, F4, C4, T4
kusano 2b45e8
	LFPDUX	A8,    X, INCX2
kusano 2b45e8
kusano 2b45e8
	fpsub	F5, C1, T5
kusano 2b45e8
	fpsub	F6, C2, T6
kusano 2b45e8
	fpsub	F7, C3, T7
kusano 2b45e8
	fpsub	F8, C4, T8
kusano 2b45e8
kusano 2b45e8
	fpabs	T1, A1
kusano 2b45e8
	fpabs	T2, A2
kusano 2b45e8
	fpabs	T3, A3
kusano 2b45e8
	fpabs	T4, A4
kusano 2b45e8
kusano 2b45e8
	fpsel	C1, F5, C1, T5
kusano 2b45e8
	fpsel	C2, F6, C2, T6
kusano 2b45e8
	fpsel	C3, F7, C3, T7
kusano 2b45e8
	fpsel	C4, F8, C4, T8
kusano 2b45e8
	bdnz	LL(12)
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(13):
kusano 2b45e8
	fpabs	T5, A5
kusano 2b45e8
	fpabs	T6, A6
kusano 2b45e8
	fpabs	T7, A7
kusano 2b45e8
	fpabs	T8, A8
kusano 2b45e8
kusano 2b45e8
	fpsub	F1, C1, T1
kusano 2b45e8
	fpsub	F2, C2, T2
kusano 2b45e8
	fpsub	F3, C3, T3
kusano 2b45e8
	fpsub	F4, C4, T4
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
kusano 2b45e8
	fpsub	F5, C1, T5
kusano 2b45e8
	fpsub	F6, C2, T6
kusano 2b45e8
	fpsub	F7, C3, T7
kusano 2b45e8
	fpsub	F8, C4, T8
kusano 2b45e8
kusano 2b45e8
	fpsel	C1, F5, C1, T5
kusano 2b45e8
	fpsel	C2, F6, C2, T6
kusano 2b45e8
	fpsel	C3, F7, C3, T7
kusano 2b45e8
	fpsel	C4, F8, C4, T8
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(15):
kusano 2b45e8
	andi.	r0,  N, 7
kusano 2b45e8
	beq	LL(20)
kusano 2b45e8
kusano 2b45e8
	andi.	r0,  N, 4
kusano 2b45e8
	beq	LL(16)
kusano 2b45e8
kusano 2b45e8
	LFPDUX	A1,    X, INCX2
kusano 2b45e8
	LFPDUX	A2,    X, INCX2
kusano 2b45e8
	LFPDUX	A3,    X, INCX2
kusano 2b45e8
	LFPDUX	A4,    X, INCX2
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
	fpsub	F1, C1, A1
kusano 2b45e8
	fpsub	F2, C2, A2
kusano 2b45e8
	fpsub	F3, C3, A3
kusano 2b45e8
	fpsub	F4, C4, A4
kusano 2b45e8
kusano 2b45e8
	fpsel	C1, F1, C1, A1
kusano 2b45e8
	fpsel	C2, F2, C2, A2
kusano 2b45e8
	fpsel	C3, F3, C3, A3
kusano 2b45e8
	fpsel	C4, F4, C4, A4
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(16):
kusano 2b45e8
	andi.	r0,  N, 2
kusano 2b45e8
	beq	LL(17)
kusano 2b45e8
kusano 2b45e8
	LFPDUX	A1,    X, INCX2
kusano 2b45e8
	LFPDUX	A2,    X, INCX2
kusano 2b45e8
kusano 2b45e8
	fpabs	A1, A1
kusano 2b45e8
	fpabs	A2, A2
kusano 2b45e8
kusano 2b45e8
	fpsub	F1, C1, A1
kusano 2b45e8
	fpsub	F2, C2, A2
kusano 2b45e8
kusano 2b45e8
	fpsel	C1, F1, C1, A1
kusano 2b45e8
	fpsel	C2, F2, C2, A2
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(17):
kusano 2b45e8
	andi.	r0,  N, 1
kusano 2b45e8
	beq	LL(20)
kusano 2b45e8
kusano 2b45e8
	LFPDUX	A1,    X, INCX2
kusano 2b45e8
	fpabs	A1, A1
kusano 2b45e8
	fpsub	F1, C1, A1
kusano 2b45e8
	fpsel	C1, F1, C1, A1
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(20):
kusano 2b45e8
	fpsub	F1,  C1,  C2
kusano 2b45e8
	fpsub	F2,  C3,  C4
kusano 2b45e8
kusano 2b45e8
	fpsel	C1,  F1,  C1,  C2
kusano 2b45e8
	fpsel	C3,  F2,  C3,  C4
kusano 2b45e8
kusano 2b45e8
	fpsub	F1,  C1,  C3
kusano 2b45e8
	fpsel	C1,  F1,  C1,  C3
kusano 2b45e8
kusano 2b45e8
	fsmtp	C2, C1
kusano 2b45e8
kusano 2b45e8
	fsub	F1,  C1,  C2
kusano 2b45e8
	fsel	ALPHA,  F1,  C1,  C2
kusano 2b45e8
kusano 2b45e8
	li	r10, 0
kusano 2b45e8
kusano 2b45e8
	lfs	ALPHA_R,  8(SP)		# load 1.0
kusano 2b45e8
	fdiv	ALPHA_R, ALPHA_R, ALPHA
kusano 2b45e8
kusano 2b45e8
	lfpsx	C1, SP, r10		# Zero clear
kusano 2b45e8
	
kusano 2b45e8
	fpmr	C2, C1
kusano 2b45e8
	fpmr	C3, C1
kusano 2b45e8
	fpmr	C4, C1
kusano 2b45e8
	fsmfp	ALPHA_R, ALPHA_R
kusano 2b45e8
kusano 2b45e8
	andi.	r0, XX, 2 * SIZE - 1
kusano 2b45e8
	beq	LL(21)
kusano 2b45e8
kusano 2b45e8
	LFD	C1, 0 * SIZE(XX)
kusano 2b45e8
	add	XX, XX, INCX
kusano 2b45e8
kusano 2b45e8
	cmpwi	cr0, N, 0
kusano 2b45e8
	fmul	C1, ALPHA_R, C1
kusano 2b45e8
	fmul	C1, C1, C1
kusano 2b45e8
	ble	LL(98)
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(21):
kusano 2b45e8
	sub	XX, XX, INCX2
kusano 2b45e8
kusano 2b45e8
	srawi.	r0, N, 3
kusano 2b45e8
	mtspr	CTR,  r0
kusano 2b45e8
	beq-	LL(25)
kusano 2b45e8
kusano 2b45e8
	LFPDUX	A1,    XX, INCX2
kusano 2b45e8
	LFPDUX	A2,    XX, INCX2
kusano 2b45e8
	LFPDUX	A3,    XX, INCX2
kusano 2b45e8
	LFPDUX	A4,    XX, INCX2
kusano 2b45e8
kusano 2b45e8
	LFPDUX	A5,    XX, INCX2
kusano 2b45e8
	LFPDUX	A6,    XX, INCX2
kusano 2b45e8
	LFPDUX	A7,    XX, INCX2
kusano 2b45e8
	LFPDUX	A8,    XX, INCX2
kusano 2b45e8
kusano 2b45e8
	fpmul	T1, ALPHA_R, A1
kusano 2b45e8
	fpmul	T2, ALPHA_R, A2
kusano 2b45e8
	fpmul	T3, ALPHA_R, A3
kusano 2b45e8
	fpmul	T4, ALPHA_R, A4
kusano 2b45e8
kusano 2b45e8
	bdz	LL(23)
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(22):
kusano 2b45e8
	fpmadd	C1, T1, T1, C1
kusano 2b45e8
	LFPDUX	A1,    XX, INCX2
kusano 2b45e8
	fpmul	T1, ALPHA_R, A5
kusano 2b45e8
	LFPDUX	A2,    XX, INCX2
kusano 2b45e8
kusano 2b45e8
	fpmadd	C2, T2, T2, C2
kusano 2b45e8
	LFPDUX	A3,    XX, INCX2
kusano 2b45e8
	fpmul	T2, ALPHA_R, A6
kusano 2b45e8
	LFPDUX	A4,    XX, INCX2
kusano 2b45e8
kusano 2b45e8
	fpmadd	C3, T3, T3, C3
kusano 2b45e8
	fpmul	T3, ALPHA_R, A7
kusano 2b45e8
	fpmadd	C4, T4, T4, C4
kusano 2b45e8
	fpmul	T4, ALPHA_R, A8
kusano 2b45e8
kusano 2b45e8
	fpmadd	C1, T1, T1, C1
kusano 2b45e8
	LFPDUX	A5,    XX, INCX2
kusano 2b45e8
	fpmul	T1, ALPHA_R, A1
kusano 2b45e8
	LFPDUX	A6,    XX, INCX2
kusano 2b45e8
kusano 2b45e8
	fpmadd	C2, T2, T2, C2
kusano 2b45e8
	LFPDUX	A7,    XX, INCX2
kusano 2b45e8
	fpmul	T2, ALPHA_R, A2
kusano 2b45e8
	LFPDUX	A8,    XX, INCX2
kusano 2b45e8
kusano 2b45e8
	fpmadd	C3, T3, T3, C3
kusano 2b45e8
	fpmul	T3, ALPHA_R, A3
kusano 2b45e8
	fpmadd	C4, T4, T4, C4
kusano 2b45e8
	fpmul	T4, ALPHA_R, A4
kusano 2b45e8
	bdnz	LL(22)
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(23):
kusano 2b45e8
	fpmadd	C1, T1, T1, C1
kusano 2b45e8
	fpmul	T1, ALPHA_R, A5
kusano 2b45e8
	fpmadd	C2, T2, T2, C2
kusano 2b45e8
	fpmul	T2, ALPHA_R, A6
kusano 2b45e8
kusano 2b45e8
	fpmadd	C3, T3, T3, C3
kusano 2b45e8
	fpmul	T3, ALPHA_R, A7
kusano 2b45e8
	fpmadd	C4, T4, T4, C4
kusano 2b45e8
	fpmul	T4, ALPHA_R, A8
kusano 2b45e8
kusano 2b45e8
	fpmadd	C1, T1, T1, C1
kusano 2b45e8
	fpmadd	C2, T2, T2, C2
kusano 2b45e8
	fpmadd	C3, T3, T3, C3
kusano 2b45e8
	fpmadd	C4, T4, T4, C4
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(25):
kusano 2b45e8
	andi.	r0,  N, 7
kusano 2b45e8
	beq	LL(98)
kusano 2b45e8
kusano 2b45e8
	andi.	r0,  N, 4
kusano 2b45e8
	beq	LL(26)
kusano 2b45e8
kusano 2b45e8
	LFPDUX	A1,    XX, INCX2
kusano 2b45e8
	LFPDUX	A2,    XX, INCX2
kusano 2b45e8
	LFPDUX	A3,    XX, INCX2
kusano 2b45e8
	LFPDUX	A4,    XX, INCX2
kusano 2b45e8
kusano 2b45e8
	fpmul	A1, ALPHA_R, A1
kusano 2b45e8
	fpmul	A2, ALPHA_R, A2
kusano 2b45e8
	fpmul	A3, ALPHA_R, A3
kusano 2b45e8
	fpmul	A4, ALPHA_R, A4
kusano 2b45e8
kusano 2b45e8
	fpmadd	C1, A1, A1, C1
kusano 2b45e8
	fpmadd	C2, A2, A2, C2
kusano 2b45e8
	fpmadd	C3, A3, A3, C3
kusano 2b45e8
	fpmadd	C4, A4, A4, C4
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(26):
kusano 2b45e8
	andi.	r0,  N, 2
kusano 2b45e8
	beq	LL(27)
kusano 2b45e8
kusano 2b45e8
	LFPDUX	A1,    XX, INCX2
kusano 2b45e8
	LFPDUX	A2,    XX, INCX2
kusano 2b45e8
	fpmul	A1, ALPHA_R, A1
kusano 2b45e8
	fpmul	A2, ALPHA_R, A2
kusano 2b45e8
kusano 2b45e8
	fpmadd	C1, A1, A1, C1
kusano 2b45e8
	fpmadd	C2, A2, A2, C2
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(27):
kusano 2b45e8
	andi.	r0,  N, 1
kusano 2b45e8
	beq	LL(98)
kusano 2b45e8
kusano 2b45e8
	LFPDUX	A1,    XX, INCX2
kusano 2b45e8
	fpmul	A1, ALPHA_R, A1
kusano 2b45e8
	fpmadd	C1, A1, A1, C1
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(98):
kusano 2b45e8
	fpadd	C1,  C1,  C2
kusano 2b45e8
	lis	r3, 0x3f00
kusano 2b45e8
	fpadd	C3,  C3,  C4
kusano 2b45e8
	lis	r4, 0x4040
kusano 2b45e8
kusano 2b45e8
	stw	r3, 4(SP)
kusano 2b45e8
	stw	r4, 8(SP)
kusano 2b45e8
kusano 2b45e8
	fpadd	C1,  C1,  C3
kusano 2b45e8
	lfs	f10, 0(SP)
kusano 2b45e8
kusano 2b45e8
	fsmtp	C2, C1
kusano 2b45e8
	lfs	f11, 4(SP)
kusano 2b45e8
	fadd	C1, C2, C1
kusano 2b45e8
 	lfs	f12, 8(SP)
kusano 2b45e8
kusano 2b45e8
	fcmpu	cr0, f10, C1
kusano 2b45e8
	beq	cr0, LL(99)
kusano 2b45e8
kusano 2b45e8
#ifndef HUMMER_EMULATOR
kusano 2b45e8
	frsqrte	f9, C1
kusano 2b45e8
	li	r10, 16
kusano 2b45e8
kusano 2b45e8
	fmul	f2,  f1,  f9
kusano 2b45e8
	lfpdux	f29, SP, r10
kusano 2b45e8
	fmul	f3,  f9,  f11
kusano 2b45e8
	lfpdux	f28, SP, r10
kusano 2b45e8
	fnmsub	f7,  f2,  f9, f12
kusano 2b45e8
	lfpdux	f27, SP, r10
kusano 2b45e8
	fmul	f9,  f3,  f7
kusano 2b45e8
	lfpdux	f26, SP, r10
kusano 2b45e8
	fadd	f13, f11, f11
kusano 2b45e8
	lfpdux	f25, SP, r10
kusano 2b45e8
	fmul	f12, f1,  f9
kusano 2b45e8
	lfpdux	f24, SP, r10
kusano 2b45e8
	fmul	f11, f12, f11
kusano 2b45e8
	lfpdux	f23, SP, r10
kusano 2b45e8
	lfpdux	f22, SP, r10
kusano 2b45e8
	lfpdux	f21, SP, r10
kusano 2b45e8
	fnmsub	f1,  f12, f9, f13
kusano 2b45e8
kusano 2b45e8
	lfpdux	f20, SP, r10
kusano 2b45e8
	lfpdux	f19, SP, r10
kusano 2b45e8
	lfpdux	f18, SP, r10
kusano 2b45e8
	fmadd	f1,  f11, f1, f12
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
	fmul	C1, ALPHA, C1
kusano 2b45e8
	blr
kusano 2b45e8
#else
kusano 2b45e8
	fsqrt	C1, C1
kusano 2b45e8
kusano 2b45e8
	li	r10, 16
kusano 2b45e8
	lfpdux	f29, SP, r10
kusano 2b45e8
	lfpdux	f28, SP, r10
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
	lfpdux	f23, SP, r10
kusano 2b45e8
	lfpdux	f22, SP, r10
kusano 2b45e8
	lfpdux	f21, SP, r10
kusano 2b45e8
	lfpdux	f20, SP, r10
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
kusano 2b45e8
	fmul	C1, ALPHA, C1
kusano 2b45e8
	addi	SP, SP,  16
kusano 2b45e8
	blr
kusano 2b45e8
#endif
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(99):
kusano 2b45e8
	li	r10, 16
kusano 2b45e8
kusano 2b45e8
	lfpdux	f29, SP, r10
kusano 2b45e8
	lfpdux	f28, SP, r10
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
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(100):
kusano 2b45e8
	sub	X,  X,  INCX2
kusano 2b45e8
	addi	X2, X, SIZE
kusano 2b45e8
kusano 2b45e8
	srawi.	r0, N, 3
kusano 2b45e8
	mtspr	CTR,  r0
kusano 2b45e8
	beq-	LL(105)
kusano 2b45e8
kusano 2b45e8
	LFDUX	A1,   X,  INCX2
kusano 2b45e8
	LFDUX	A2,   X2, INCX2
kusano 2b45e8
	LFDUX	A3,   X,  INCX2
kusano 2b45e8
	LFDUX	A4,   X2, INCX2
kusano 2b45e8
	LFSDUX	A1,   X,  INCX2
kusano 2b45e8
	LFSDUX	A2,   X2, INCX2
kusano 2b45e8
	LFSDUX	A3,   X,  INCX2
kusano 2b45e8
	LFSDUX	A4,   X2, INCX2
kusano 2b45e8
kusano 2b45e8
	LFDUX	A5,   X,  INCX2
kusano 2b45e8
	LFDUX	A6,   X2, INCX2
kusano 2b45e8
	LFDUX	A7,   X,  INCX2
kusano 2b45e8
	LFDUX	A8,   X2, INCX2
kusano 2b45e8
	LFSDUX	A5,   X,  INCX2
kusano 2b45e8
	fpabs	T1, A1
kusano 2b45e8
	LFSDUX	A6,   X2, INCX2
kusano 2b45e8
	fpabs	T2, A2
kusano 2b45e8
	LFSDUX	A7,   X,  INCX2
kusano 2b45e8
	fpabs	T3, A3
kusano 2b45e8
	LFSDUX	A8,   X2, INCX2
kusano 2b45e8
	fpabs	T4, A4
kusano 2b45e8
	bdz	LL(103)
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(102):
kusano 2b45e8
	fpsub	F1, C1, T1
kusano 2b45e8
	LFDUX	A1,   X,  INCX2
kusano 2b45e8
	fpsub	F2, C2, T2
kusano 2b45e8
	LFDUX	A2,   X2, INCX2
kusano 2b45e8
	fpsub	F3, C3, T3
kusano 2b45e8
	LFDUX	A3,   X,  INCX2
kusano 2b45e8
	fpsub	F4, C4, T4
kusano 2b45e8
	LFDUX	A4,   X2, INCX2
kusano 2b45e8
kusano 2b45e8
	fpabs	T5, A5
kusano 2b45e8
	LFSDUX	A1,   X,  INCX2
kusano 2b45e8
	fpabs	T6, A6
kusano 2b45e8
	LFSDUX	A2,   X2, INCX2
kusano 2b45e8
	fpabs	T7, A7
kusano 2b45e8
	LFSDUX	A3,   X,  INCX2
kusano 2b45e8
	fpabs	T8, A8
kusano 2b45e8
	LFSDUX	A4,   X2, INCX2
kusano 2b45e8
kusano 2b45e8
	fpsel	C1, F1, C1, T1
kusano 2b45e8
	LFDUX	A5,   X,  INCX2
kusano 2b45e8
	fpsel	C2, F2, C2, T2
kusano 2b45e8
	LFDUX	A6,   X2, INCX2
kusano 2b45e8
	fpsel	C3, F3, C3, T3
kusano 2b45e8
	LFDUX	A7,   X,  INCX2
kusano 2b45e8
	fpsel	C4, F4, C4, T4
kusano 2b45e8
	LFDUX	A8,   X2, INCX2
kusano 2b45e8
kusano 2b45e8
	fpsub	F5, C1, T5
kusano 2b45e8
	LFSDUX	A5,   X,  INCX2
kusano 2b45e8
	fpsub	F6, C2, T6
kusano 2b45e8
	LFSDUX	A6,   X2, INCX2
kusano 2b45e8
	fpsub	F7, C3, T7
kusano 2b45e8
	LFSDUX	A7,   X,  INCX2
kusano 2b45e8
	fpsub	F8, C4, T8
kusano 2b45e8
	LFSDUX	A8,   X2, INCX2
kusano 2b45e8
kusano 2b45e8
	fpabs	T1, A1
kusano 2b45e8
	fpabs	T2, A2
kusano 2b45e8
	fpabs	T3, A3
kusano 2b45e8
	fpabs	T4, A4
kusano 2b45e8
kusano 2b45e8
	fpsel	C1, F5, C1, T5
kusano 2b45e8
	fpsel	C2, F6, C2, T6
kusano 2b45e8
	fpsel	C3, F7, C3, T7
kusano 2b45e8
	fpsel	C4, F8, C4, T8
kusano 2b45e8
	bdnz	LL(102)
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(103):
kusano 2b45e8
	fpabs	T5, A5
kusano 2b45e8
	fpabs	T6, A6
kusano 2b45e8
	fpabs	T7, A7
kusano 2b45e8
	fpabs	T8, A8
kusano 2b45e8
kusano 2b45e8
	fpsub	F1, C1, T1
kusano 2b45e8
	fpsub	F2, C2, T2
kusano 2b45e8
	fpsub	F3, C3, T3
kusano 2b45e8
	fpsub	F4, C4, T4
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
kusano 2b45e8
	fpsub	F5, C1, T5
kusano 2b45e8
	fpsub	F6, C2, T6
kusano 2b45e8
	fpsub	F7, C3, T7
kusano 2b45e8
	fpsub	F8, C4, T8
kusano 2b45e8
kusano 2b45e8
	fpsel	C1, F5, C1, T5
kusano 2b45e8
	fpsel	C2, F6, C2, T6
kusano 2b45e8
	fpsel	C3, F7, C3, T7
kusano 2b45e8
	fpsel	C4, F8, C4, T8
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(105):
kusano 2b45e8
	andi.	r0,  N, 7
kusano 2b45e8
	beq	LL(120)
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,   X2, INCX2
kusano 2b45e8
	LFDUX	A3,   X,  INCX2
kusano 2b45e8
	LFDUX	A4,   X2, INCX2
kusano 2b45e8
	LFSDUX	A1,   X,  INCX2
kusano 2b45e8
	LFSDUX	A2,   X2, INCX2
kusano 2b45e8
	LFSDUX	A3,   X,  INCX2
kusano 2b45e8
	LFSDUX	A4,   X2, INCX2
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
	fpsub	F1, C1, A1
kusano 2b45e8
	fpsub	F2, C2, A2
kusano 2b45e8
	fpsub	F3, C3, A3
kusano 2b45e8
	fpsub	F4, C4, A4
kusano 2b45e8
kusano 2b45e8
	fpsel	C1, F1, C1, A1
kusano 2b45e8
	fpsel	C2, F2, C2, A2
kusano 2b45e8
	fpsel	C3, F3, C3, A3
kusano 2b45e8
	fpsel	C4, F4, C4, A4
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,   X2, INCX2
kusano 2b45e8
	LFDUX	A3,   X,  INCX2
kusano 2b45e8
	LFDUX	A4,   X2, INCX2
kusano 2b45e8
kusano 2b45e8
	fabs	A1, A1
kusano 2b45e8
	fabs	A2, A2
kusano 2b45e8
	fabs	A3, A3
kusano 2b45e8
	fabs	A4, A4
kusano 2b45e8
kusano 2b45e8
	fsub	F1, C1, A1
kusano 2b45e8
	fsub	F2, C2, A2
kusano 2b45e8
	fsub	F3, C3, A3
kusano 2b45e8
	fsub	F4, C4, A4
kusano 2b45e8
kusano 2b45e8
	fsel	C1, F1, C1, A1
kusano 2b45e8
	fsel	C2, F2, C2, A2
kusano 2b45e8
	fsel	C3, F3, C3, A3
kusano 2b45e8
	fsel	C4, F4, C4, A4
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(107):
kusano 2b45e8
	andi.	r0,  N, 1
kusano 2b45e8
	beq	LL(120)
kusano 2b45e8
kusano 2b45e8
	LFDUX	A1,   X,  INCX2
kusano 2b45e8
	LFDUX	A2,   X2, INCX2
kusano 2b45e8
	fabs	A1, A1
kusano 2b45e8
	fabs	A2, A2
kusano 2b45e8
	fsub	F1, C1, A1
kusano 2b45e8
	fsub	F2, C2, A2
kusano 2b45e8
	fsel	C1, F1, C1, A1
kusano 2b45e8
	fsel	C2, F2, C2, A2
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(120):
kusano 2b45e8
	fpsub	F1,  C1,  C2
kusano 2b45e8
	fpsub	F2,  C3,  C4
kusano 2b45e8
kusano 2b45e8
	fpsel	C1,  F1,  C1,  C2
kusano 2b45e8
	fpsel	C3,  F2,  C3,  C4
kusano 2b45e8
kusano 2b45e8
	fpsub	F1,  C1,  C3
kusano 2b45e8
	fpsel	C1,  F1,  C1,  C3
kusano 2b45e8
kusano 2b45e8
	fsmtp	C2, C1
kusano 2b45e8
kusano 2b45e8
	fsub	F1,  C1,  C2
kusano 2b45e8
	fsel	ALPHA,  F1,  C1,  C2
kusano 2b45e8
kusano 2b45e8
	li	r10, 0
kusano 2b45e8
kusano 2b45e8
	lfs	ALPHA_R,  8(SP)		# load 1.0
kusano 2b45e8
	fdiv	ALPHA_R, ALPHA_R, ALPHA
kusano 2b45e8
kusano 2b45e8
	lfpsx	C1, SP, r10		# Zero clear
kusano 2b45e8
	
kusano 2b45e8
	fpmr	C2, C1
kusano 2b45e8
	fpmr	C3, C1
kusano 2b45e8
	fpmr	C4, C1
kusano 2b45e8
	fsmfp	ALPHA_R, ALPHA_R
kusano 2b45e8
kusano 2b45e8
	sub	XX, XX, INCX2
kusano 2b45e8
	addi	X2, XX, SIZE
kusano 2b45e8
kusano 2b45e8
	srawi.	r0, N, 3
kusano 2b45e8
	mtspr	CTR,  r0
kusano 2b45e8
	beq-	LL(125)
kusano 2b45e8
kusano 2b45e8
	LFDUX	A1,    XX, INCX2
kusano 2b45e8
	LFDUX	A2,    X2, INCX2
kusano 2b45e8
	LFDUX	A3,    XX, INCX2
kusano 2b45e8
	LFDUX	A4,    X2, INCX2
kusano 2b45e8
	LFSDUX	A1,    XX, INCX2
kusano 2b45e8
	LFSDUX	A2,    X2, INCX2
kusano 2b45e8
	LFSDUX	A3,    XX, INCX2
kusano 2b45e8
	LFSDUX	A4,    X2, INCX2
kusano 2b45e8
kusano 2b45e8
	LFDUX	A5,    XX, INCX2
kusano 2b45e8
	LFDUX	A6,    X2, INCX2
kusano 2b45e8
	LFDUX	A7,    XX, INCX2
kusano 2b45e8
	LFDUX	A8,    X2, INCX2
kusano 2b45e8
	LFSDUX	A5,    XX, INCX2
kusano 2b45e8
	fpmul	T1, ALPHA_R, A1
kusano 2b45e8
	LFSDUX	A6,    X2, INCX2
kusano 2b45e8
	fpmul	T2, ALPHA_R, A2
kusano 2b45e8
	LFSDUX	A7,    XX, INCX2
kusano 2b45e8
	fpmul	T3, ALPHA_R, A3
kusano 2b45e8
	LFSDUX	A8,    X2, INCX2
kusano 2b45e8
	fpmul	T4, ALPHA_R, A4
kusano 2b45e8
	bdz	LL(123)
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(122):
kusano 2b45e8
	fpmadd	C1, T1, T1, C1
kusano 2b45e8
	LFDUX	A1,    XX, INCX2
kusano 2b45e8
	fpmul	T1, ALPHA_R, A5
kusano 2b45e8
	LFDUX	A2,    X2, INCX2
kusano 2b45e8
kusano 2b45e8
	fpmadd	C2, T2, T2, C2
kusano 2b45e8
	LFDUX	A3,    XX, INCX2
kusano 2b45e8
	fpmul	T2, ALPHA_R, A6
kusano 2b45e8
	LFDUX	A4,    X2, INCX2
kusano 2b45e8
kusano 2b45e8
	fpmadd	C3, T3, T3, C3
kusano 2b45e8
	LFSDUX	A1,    XX, INCX2
kusano 2b45e8
	fpmul	T3, ALPHA_R, A7
kusano 2b45e8
	LFSDUX	A2,    X2, INCX2
kusano 2b45e8
kusano 2b45e8
	fpmadd	C4, T4, T4, C4
kusano 2b45e8
	LFSDUX	A3,    XX, INCX2
kusano 2b45e8
	fpmul	T4, ALPHA_R, A8
kusano 2b45e8
	LFSDUX	A4,    X2, INCX2
kusano 2b45e8
kusano 2b45e8
	fpmadd	C1, T1, T1, C1
kusano 2b45e8
	LFDUX	A5,    XX, INCX2
kusano 2b45e8
	fpmul	T1, ALPHA_R, A1
kusano 2b45e8
	LFDUX	A6,    X2, INCX2
kusano 2b45e8
kusano 2b45e8
	fpmadd	C2, T2, T2, C2
kusano 2b45e8
	LFDUX	A7,    XX, INCX2
kusano 2b45e8
	fpmul	T2, ALPHA_R, A2
kusano 2b45e8
	LFDUX	A8,    X2, INCX2
kusano 2b45e8
kusano 2b45e8
	fpmadd	C3, T3, T3, C3
kusano 2b45e8
	LFSDUX	A5,    XX, INCX2
kusano 2b45e8
	fpmul	T3, ALPHA_R, A3
kusano 2b45e8
	LFSDUX	A6,    X2, INCX2
kusano 2b45e8
	fpmadd	C4, T4, T4, C4
kusano 2b45e8
	LFSDUX	A7,    XX, INCX2
kusano 2b45e8
	fpmul	T4, ALPHA_R, A4
kusano 2b45e8
	LFSDUX	A8,    X2, INCX2
kusano 2b45e8
	bdnz	LL(122)
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(123):
kusano 2b45e8
	fpmadd	C1, T1, T1, C1
kusano 2b45e8
	fpmul	T1, ALPHA_R, A5
kusano 2b45e8
	fpmadd	C2, T2, T2, C2
kusano 2b45e8
	fpmul	T2, ALPHA_R, A6
kusano 2b45e8
	fpmadd	C3, T3, T3, C3
kusano 2b45e8
	fpmul	T3, ALPHA_R, A7
kusano 2b45e8
	fpmadd	C4, T4, T4, C4
kusano 2b45e8
	fpmul	T4, ALPHA_R, A8
kusano 2b45e8
kusano 2b45e8
	fpmadd	C1, T1, T1, C1
kusano 2b45e8
	fpmadd	C2, T2, T2, C2
kusano 2b45e8
	fpmadd	C3, T3, T3, C3
kusano 2b45e8
	fpmadd	C4, T4, T4, C4
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(125):
kusano 2b45e8
	andi.	r0,  N, 7
kusano 2b45e8
	beq	LL(998)
kusano 2b45e8
kusano 2b45e8
	andi.	r0,  N, 4
kusano 2b45e8
	beq	LL(126)
kusano 2b45e8
kusano 2b45e8
	LFDUX	A1,    XX, INCX2
kusano 2b45e8
	LFDUX	A2,    X2, INCX2
kusano 2b45e8
	LFDUX	A3,    XX, INCX2
kusano 2b45e8
	LFDUX	A4,    X2, INCX2
kusano 2b45e8
	LFSDUX	A1,    XX, INCX2
kusano 2b45e8
	LFSDUX	A2,    X2, INCX2
kusano 2b45e8
	LFSDUX	A3,    XX, INCX2
kusano 2b45e8
	LFSDUX	A4,    X2, INCX2
kusano 2b45e8
kusano 2b45e8
	fpmul	A1, ALPHA_R, A1
kusano 2b45e8
	fpmul	A2, ALPHA_R, A2
kusano 2b45e8
	fpmul	A3, ALPHA_R, A3
kusano 2b45e8
	fpmul	A4, ALPHA_R, A4
kusano 2b45e8
kusano 2b45e8
	fpmadd	C1, A1, A1, C1
kusano 2b45e8
	fpmadd	C2, A2, A2, C2
kusano 2b45e8
	fpmadd	C3, A3, A3, C3
kusano 2b45e8
	fpmadd	C4, A4, A4, C4
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(126):
kusano 2b45e8
	andi.	r0,  N, 2
kusano 2b45e8
	beq	LL(127)
kusano 2b45e8
kusano 2b45e8
	LFDUX	A1,    XX, INCX2
kusano 2b45e8
	LFDUX	A2,    X2, INCX2
kusano 2b45e8
	LFDUX	A3,    XX, INCX2
kusano 2b45e8
	LFDUX	A4,    X2, INCX2
kusano 2b45e8
kusano 2b45e8
	fmul	A1, ALPHA_R, A1
kusano 2b45e8
	fmul	A2, ALPHA_R, A2
kusano 2b45e8
	fmul	A3, ALPHA_R, A3
kusano 2b45e8
	fmul	A4, ALPHA_R, A4
kusano 2b45e8
kusano 2b45e8
	fmadd	C1, A1, A1, C1
kusano 2b45e8
	fmadd	C2, A2, A2, C2
kusano 2b45e8
	fmadd	C3, A3, A3, C3
kusano 2b45e8
	fmadd	C4, A4, A4, C4
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(127):
kusano 2b45e8
	andi.	r0,  N, 1
kusano 2b45e8
	beq	LL(998)
kusano 2b45e8
kusano 2b45e8
	LFDUX	A1,    XX, INCX2
kusano 2b45e8
	LFDUX	A2,    X2, INCX2
kusano 2b45e8
kusano 2b45e8
	fmul	A1, ALPHA_R, A1
kusano 2b45e8
	fmul	A2, ALPHA_R, A2
kusano 2b45e8
	fmadd	C1, A1, A1, C1
kusano 2b45e8
	fmadd	C2, A2, A2, C2
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(998):
kusano 2b45e8
	fpadd	C1,  C1,  C2
kusano 2b45e8
	lis	r3, 0x3f00
kusano 2b45e8
 	fpadd	C3,  C3,  C4
kusano 2b45e8
	lis	r4, 0x4040
kusano 2b45e8
kusano 2b45e8
	stw	r3, 4(SP)
kusano 2b45e8
	stw	r4, 8(SP)
kusano 2b45e8
kusano 2b45e8
	fpadd	C1,  C1,  C3
kusano 2b45e8
	lfs	f10, 0(SP)
kusano 2b45e8
	fsmtp	C2, C1
kusano 2b45e8
	lfs	f11, 4(SP)
kusano 2b45e8
	fadd	C1, C2, C1
kusano 2b45e8
 	lfs	f12, 8(SP)
kusano 2b45e8
kusano 2b45e8
	fcmpu	cr0, f10, C1
kusano 2b45e8
	beq	cr0, LL(99)
kusano 2b45e8
kusano 2b45e8
#ifndef HUMMER_EMULATOR
kusano 2b45e8
	frsqrte	f9, C1
kusano 2b45e8
	li	r10, 16
kusano 2b45e8
kusano 2b45e8
	fmul	f2,  f1,  f9
kusano 2b45e8
	lfpdux	f29, SP, r10
kusano 2b45e8
	fmul	f3,  f9,  f11
kusano 2b45e8
	lfpdux	f28, SP, r10
kusano 2b45e8
	fnmsub	f7,  f2,  f9, f12
kusano 2b45e8
	lfpdux	f27, SP, r10
kusano 2b45e8
	fmul	f9,  f3,  f7
kusano 2b45e8
	lfpdux	f26, SP, r10
kusano 2b45e8
	fadd	f13, f11, f11
kusano 2b45e8
	lfpdux	f25, SP, r10
kusano 2b45e8
	fmul	f12, f1,  f9
kusano 2b45e8
	lfpdux	f24, SP, r10
kusano 2b45e8
	fmul	f11, f12, f11
kusano 2b45e8
	lfpdux	f23, SP, r10
kusano 2b45e8
	lfpdux	f22, SP, r10
kusano 2b45e8
	fnmsub	f1,  f12, f9, f13
kusano 2b45e8
	lfpdux	f21, SP, r10
kusano 2b45e8
kusano 2b45e8
	lfpdux	f20, SP, r10
kusano 2b45e8
	lfpdux	f19, SP, r10
kusano 2b45e8
	lfpdux	f18, SP, r10
kusano 2b45e8
	fmadd	f1,  f11, f1, f12
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
	fmul	C1, ALPHA, C1
kusano 2b45e8
	blr
kusano 2b45e8
#else
kusano 2b45e8
	fsqrt	C1, C1
kusano 2b45e8
	li	r10, 16
kusano 2b45e8
kusano 2b45e8
	lfpdux	f29, SP, r10
kusano 2b45e8
	lfpdux	f28, SP, r10
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
	lfpdux	f23, SP, r10
kusano 2b45e8
	lfpdux	f22, SP, r10
kusano 2b45e8
	lfpdux	f21, SP, r10
kusano 2b45e8
kusano 2b45e8
	lfpdux	f20, SP, r10
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
	fmul	C1, ALPHA, C1
kusano 2b45e8
	addi	SP, SP,  16
kusano 2b45e8
	blr
kusano 2b45e8
#endif
kusano 2b45e8
	.align 4
kusano 2b45e8
kusano 2b45e8
LL(999):
kusano 2b45e8
	li	r10, 16
kusano 2b45e8
kusano 2b45e8
	lfpdux	f29, SP, r10
kusano 2b45e8
	lfpdux	f28, SP, r10
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
	EPILOGUE