1*25c28e83SPiotr Jasiukajtis/* 2*25c28e83SPiotr Jasiukajtis * CDDL HEADER START 3*25c28e83SPiotr Jasiukajtis * 4*25c28e83SPiotr Jasiukajtis * The contents of this file are subject to the terms of the 5*25c28e83SPiotr Jasiukajtis * Common Development and Distribution License (the "License"). 6*25c28e83SPiotr Jasiukajtis * You may not use this file except in compliance with the License. 7*25c28e83SPiotr Jasiukajtis * 8*25c28e83SPiotr Jasiukajtis * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*25c28e83SPiotr Jasiukajtis * or http://www.opensolaris.org/os/licensing. 10*25c28e83SPiotr Jasiukajtis * See the License for the specific language governing permissions 11*25c28e83SPiotr Jasiukajtis * and limitations under the License. 12*25c28e83SPiotr Jasiukajtis * 13*25c28e83SPiotr Jasiukajtis * When distributing Covered Code, include this CDDL HEADER in each 14*25c28e83SPiotr Jasiukajtis * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*25c28e83SPiotr Jasiukajtis * If applicable, add the following below this CDDL HEADER, with the 16*25c28e83SPiotr Jasiukajtis * fields enclosed by brackets "[]" replaced with your own identifying 17*25c28e83SPiotr Jasiukajtis * information: Portions Copyright [yyyy] [name of copyright owner] 18*25c28e83SPiotr Jasiukajtis * 19*25c28e83SPiotr Jasiukajtis * CDDL HEADER END 20*25c28e83SPiotr Jasiukajtis */ 21*25c28e83SPiotr Jasiukajtis/* 22*25c28e83SPiotr Jasiukajtis * Copyright 2011 Nexenta Systems, Inc. All rights reserved. 23*25c28e83SPiotr Jasiukajtis */ 24*25c28e83SPiotr Jasiukajtis/* 25*25c28e83SPiotr Jasiukajtis * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 26*25c28e83SPiotr Jasiukajtis * Use is subject to license terms. 27*25c28e83SPiotr Jasiukajtis */ 28*25c28e83SPiotr Jasiukajtis 29*25c28e83SPiotr Jasiukajtis .file "__vsincos.S" 30*25c28e83SPiotr Jasiukajtis 31*25c28e83SPiotr Jasiukajtis#include "libm.h" 32*25c28e83SPiotr Jasiukajtis 33*25c28e83SPiotr Jasiukajtis RO_DATA 34*25c28e83SPiotr Jasiukajtis .align 64 35*25c28e83SPiotr Jasiukajtisconstants: 36*25c28e83SPiotr Jasiukajtis .word 0x42c80000,0x00000000 ! 3 * 2^44 37*25c28e83SPiotr Jasiukajtis .word 0x43380000,0x00000000 ! 3 * 2^51 38*25c28e83SPiotr Jasiukajtis .word 0x3fe45f30,0x6dc9c883 ! invpio2 39*25c28e83SPiotr Jasiukajtis .word 0x3ff921fb,0x54442c00 ! pio2_1 40*25c28e83SPiotr Jasiukajtis .word 0x3d318469,0x898cc400 ! pio2_2 41*25c28e83SPiotr Jasiukajtis .word 0x3a71701b,0x839a2520 ! pio2_3 42*25c28e83SPiotr Jasiukajtis .word 0xbfc55555,0x55555533 ! pp1 43*25c28e83SPiotr Jasiukajtis .word 0x3f811111,0x10e7d53b ! pp2 44*25c28e83SPiotr Jasiukajtis .word 0xbf2a0167,0xe6b3cf9b ! pp3 45*25c28e83SPiotr Jasiukajtis .word 0xbfdfffff,0xffffff65 ! qq1 46*25c28e83SPiotr Jasiukajtis .word 0x3fa55555,0x54f88ed0 ! qq2 47*25c28e83SPiotr Jasiukajtis .word 0xbf56c12c,0xdd185f60 ! qq3 48*25c28e83SPiotr Jasiukajtis 49*25c28e83SPiotr Jasiukajtis! local storage indices 50*25c28e83SPiotr Jasiukajtis 51*25c28e83SPiotr Jasiukajtis#define xsave STACK_BIAS-0x8 52*25c28e83SPiotr Jasiukajtis#define ssave STACK_BIAS-0x10 53*25c28e83SPiotr Jasiukajtis#define csave STACK_BIAS-0x18 54*25c28e83SPiotr Jasiukajtis#define nsave STACK_BIAS-0x1c 55*25c28e83SPiotr Jasiukajtis#define sxsave STACK_BIAS-0x20 56*25c28e83SPiotr Jasiukajtis#define sssave STACK_BIAS-0x24 57*25c28e83SPiotr Jasiukajtis#define biguns STACK_BIAS-0x28 58*25c28e83SPiotr Jasiukajtis#define junk STACK_BIAS-0x30 59*25c28e83SPiotr Jasiukajtis#define nk2 STACK_BIAS-0x38 60*25c28e83SPiotr Jasiukajtis#define nk1 STACK_BIAS-0x3c 61*25c28e83SPiotr Jasiukajtis#define nk0 STACK_BIAS-0x40 62*25c28e83SPiotr Jasiukajtis! sizeof temp storage - must be a multiple of 16 for V9 63*25c28e83SPiotr Jasiukajtis#define tmps 0x40 64*25c28e83SPiotr Jasiukajtis 65*25c28e83SPiotr Jasiukajtis! register use 66*25c28e83SPiotr Jasiukajtis 67*25c28e83SPiotr Jasiukajtis! i0 n 68*25c28e83SPiotr Jasiukajtis! i1 x 69*25c28e83SPiotr Jasiukajtis! i2 stridex 70*25c28e83SPiotr Jasiukajtis! i3 s 71*25c28e83SPiotr Jasiukajtis! i4 strides 72*25c28e83SPiotr Jasiukajtis! i5 0x80000000,n0 73*25c28e83SPiotr Jasiukajtis 74*25c28e83SPiotr Jasiukajtis! l0 hx0,k0 75*25c28e83SPiotr Jasiukajtis! l1 hx1,k1 76*25c28e83SPiotr Jasiukajtis! l2 hx2,k2 77*25c28e83SPiotr Jasiukajtis! l3 c 78*25c28e83SPiotr Jasiukajtis! l4 pc0 79*25c28e83SPiotr Jasiukajtis! l5 pc1 80*25c28e83SPiotr Jasiukajtis! l6 pc2 81*25c28e83SPiotr Jasiukajtis! l7 stridec 82*25c28e83SPiotr Jasiukajtis 83*25c28e83SPiotr Jasiukajtis! the following are 64-bit registers in both V8+ and V9 84*25c28e83SPiotr Jasiukajtis 85*25c28e83SPiotr Jasiukajtis! g1 __vlibm_TBL_sincos2 86*25c28e83SPiotr Jasiukajtis! g5 scratch,n1 87*25c28e83SPiotr Jasiukajtis 88*25c28e83SPiotr Jasiukajtis! o0 ps0 89*25c28e83SPiotr Jasiukajtis! o1 ps1 90*25c28e83SPiotr Jasiukajtis! o2 ps2 91*25c28e83SPiotr Jasiukajtis! o3 0x3fe921fb 92*25c28e83SPiotr Jasiukajtis! o4 0x3e400000 93*25c28e83SPiotr Jasiukajtis! o5 0x4099251e 94*25c28e83SPiotr Jasiukajtis! o7 scratch,n2 95*25c28e83SPiotr Jasiukajtis 96*25c28e83SPiotr Jasiukajtis! f0 x0,z0 97*25c28e83SPiotr Jasiukajtis! f2 abs(x0) 98*25c28e83SPiotr Jasiukajtis! f4 99*25c28e83SPiotr Jasiukajtis! f6 100*25c28e83SPiotr Jasiukajtis! f8 101*25c28e83SPiotr Jasiukajtis! f10 x1,z1 102*25c28e83SPiotr Jasiukajtis! f12 abs(x1) 103*25c28e83SPiotr Jasiukajtis! f14 104*25c28e83SPiotr Jasiukajtis! f16 105*25c28e83SPiotr Jasiukajtis! f18 106*25c28e83SPiotr Jasiukajtis! f20 x2,z2 107*25c28e83SPiotr Jasiukajtis! f22 abs(x2) 108*25c28e83SPiotr Jasiukajtis! f24 109*25c28e83SPiotr Jasiukajtis! f26 110*25c28e83SPiotr Jasiukajtis! f28 111*25c28e83SPiotr Jasiukajtis! f30 112*25c28e83SPiotr Jasiukajtis! f32 113*25c28e83SPiotr Jasiukajtis! f34 114*25c28e83SPiotr Jasiukajtis! f36 115*25c28e83SPiotr Jasiukajtis! f38 116*25c28e83SPiotr Jasiukajtis 117*25c28e83SPiotr Jasiukajtis#define c3two44 %f40 118*25c28e83SPiotr Jasiukajtis#define c3two51 %f42 119*25c28e83SPiotr Jasiukajtis#define invpio2 %f44 120*25c28e83SPiotr Jasiukajtis#define pio2_1 %f46 121*25c28e83SPiotr Jasiukajtis#define pio2_2 %f48 122*25c28e83SPiotr Jasiukajtis#define pio2_3 %f50 123*25c28e83SPiotr Jasiukajtis#define pp1 %f52 124*25c28e83SPiotr Jasiukajtis#define pp2 %f54 125*25c28e83SPiotr Jasiukajtis#define pp3 %f56 126*25c28e83SPiotr Jasiukajtis#define qq1 %f58 127*25c28e83SPiotr Jasiukajtis#define qq2 %f60 128*25c28e83SPiotr Jasiukajtis#define qq3 %f62 129*25c28e83SPiotr Jasiukajtis 130*25c28e83SPiotr Jasiukajtis ENTRY(__vsincos) 131*25c28e83SPiotr Jasiukajtis save %sp,-SA(MINFRAME)-tmps,%sp 132*25c28e83SPiotr Jasiukajtis PIC_SETUP(l7) 133*25c28e83SPiotr Jasiukajtis PIC_SET(l7,constants,o0) 134*25c28e83SPiotr Jasiukajtis PIC_SET(l7,__vlibm_TBL_sincos2,o1) 135*25c28e83SPiotr Jasiukajtis mov %o1,%g1 136*25c28e83SPiotr Jasiukajtis wr %g0,0x82,%asi ! set %asi for non-faulting loads 137*25c28e83SPiotr Jasiukajtis#ifdef __sparcv9 138*25c28e83SPiotr Jasiukajtis stx %i1,[%fp+xsave] ! save arguments 139*25c28e83SPiotr Jasiukajtis stx %i3,[%fp+ssave] 140*25c28e83SPiotr Jasiukajtis stx %i5,[%fp+csave] 141*25c28e83SPiotr Jasiukajtis ldx [%fp+STACK_BIAS+0xb0],%l7 142*25c28e83SPiotr Jasiukajtis#else 143*25c28e83SPiotr Jasiukajtis st %i1,[%fp+xsave] ! save arguments 144*25c28e83SPiotr Jasiukajtis st %i3,[%fp+ssave] 145*25c28e83SPiotr Jasiukajtis st %i5,[%fp+csave] 146*25c28e83SPiotr Jasiukajtis ld [%fp+0x5c],%l7 147*25c28e83SPiotr Jasiukajtis#endif 148*25c28e83SPiotr Jasiukajtis st %i0,[%fp+nsave] 149*25c28e83SPiotr Jasiukajtis st %i2,[%fp+sxsave] 150*25c28e83SPiotr Jasiukajtis st %i4,[%fp+sssave] 151*25c28e83SPiotr Jasiukajtis mov %i5,%l3 152*25c28e83SPiotr Jasiukajtis st %g0,[%fp+biguns] ! biguns = 0 153*25c28e83SPiotr Jasiukajtis ldd [%o0+0x00],c3two44 ! load/set up constants 154*25c28e83SPiotr Jasiukajtis ldd [%o0+0x08],c3two51 155*25c28e83SPiotr Jasiukajtis ldd [%o0+0x10],invpio2 156*25c28e83SPiotr Jasiukajtis ldd [%o0+0x18],pio2_1 157*25c28e83SPiotr Jasiukajtis ldd [%o0+0x20],pio2_2 158*25c28e83SPiotr Jasiukajtis ldd [%o0+0x28],pio2_3 159*25c28e83SPiotr Jasiukajtis ldd [%o0+0x30],pp1 160*25c28e83SPiotr Jasiukajtis ldd [%o0+0x38],pp2 161*25c28e83SPiotr Jasiukajtis ldd [%o0+0x40],pp3 162*25c28e83SPiotr Jasiukajtis ldd [%o0+0x48],qq1 163*25c28e83SPiotr Jasiukajtis ldd [%o0+0x50],qq2 164*25c28e83SPiotr Jasiukajtis ldd [%o0+0x58],qq3 165*25c28e83SPiotr Jasiukajtis sethi %hi(0x80000000),%i5 166*25c28e83SPiotr Jasiukajtis sethi %hi(0x3e400000),%o4 167*25c28e83SPiotr Jasiukajtis sethi %hi(0x3fe921fb),%o3 168*25c28e83SPiotr Jasiukajtis or %o3,%lo(0x3fe921fb),%o3 169*25c28e83SPiotr Jasiukajtis sethi %hi(0x4099251e),%o5 170*25c28e83SPiotr Jasiukajtis or %o5,%lo(0x4099251e),%o5 171*25c28e83SPiotr Jasiukajtis sll %i2,3,%i2 ! scale strides 172*25c28e83SPiotr Jasiukajtis sll %i4,3,%i4 173*25c28e83SPiotr Jasiukajtis sll %l7,3,%l7 174*25c28e83SPiotr Jasiukajtis add %fp,junk,%o0 ! loop prologue 175*25c28e83SPiotr Jasiukajtis add %fp,junk,%o1 176*25c28e83SPiotr Jasiukajtis add %fp,junk,%o2 177*25c28e83SPiotr Jasiukajtis ld [%i1],%l0 ! *x 178*25c28e83SPiotr Jasiukajtis ld [%i1],%f0 179*25c28e83SPiotr Jasiukajtis ld [%i1+4],%f3 180*25c28e83SPiotr Jasiukajtis andn %l0,%i5,%l0 ! mask off sign 181*25c28e83SPiotr Jasiukajtis ba .loop0 182*25c28e83SPiotr Jasiukajtis add %i1,%i2,%i1 ! x += stridex 183*25c28e83SPiotr Jasiukajtis 184*25c28e83SPiotr Jasiukajtis! 16-byte aligned 185*25c28e83SPiotr Jasiukajtis .align 16 186*25c28e83SPiotr Jasiukajtis.loop0: 187*25c28e83SPiotr Jasiukajtis lda [%i1]%asi,%l1 ! preload next argument 188*25c28e83SPiotr Jasiukajtis sub %l0,%o4,%g5 189*25c28e83SPiotr Jasiukajtis sub %o5,%l0,%o7 190*25c28e83SPiotr Jasiukajtis fabss %f0,%f2 191*25c28e83SPiotr Jasiukajtis 192*25c28e83SPiotr Jasiukajtis lda [%i1]%asi,%f10 193*25c28e83SPiotr Jasiukajtis orcc %o7,%g5,%g0 194*25c28e83SPiotr Jasiukajtis mov %i3,%o0 ! ps0 = s 195*25c28e83SPiotr Jasiukajtis bl,pn %icc,.range0 ! hx < 0x3e400000 or hx > 0x4099251e 196*25c28e83SPiotr Jasiukajtis 197*25c28e83SPiotr Jasiukajtis! delay slot 198*25c28e83SPiotr Jasiukajtis lda [%i1+4]%asi,%f13 199*25c28e83SPiotr Jasiukajtis addcc %i0,-1,%i0 200*25c28e83SPiotr Jasiukajtis add %i3,%i4,%i3 ! s += strides 201*25c28e83SPiotr Jasiukajtis 202*25c28e83SPiotr Jasiukajtis mov %l3,%l4 ! pc0 = c 203*25c28e83SPiotr Jasiukajtis add %l3,%l7,%l3 ! c += stridec 204*25c28e83SPiotr Jasiukajtis ble,pn %icc,.last1 205*25c28e83SPiotr Jasiukajtis 206*25c28e83SPiotr Jasiukajtis! delay slot 207*25c28e83SPiotr Jasiukajtis andn %l1,%i5,%l1 208*25c28e83SPiotr Jasiukajtis add %i1,%i2,%i1 ! x += stridex 209*25c28e83SPiotr Jasiukajtis faddd %f2,c3two44,%f4 210*25c28e83SPiotr Jasiukajtis st %f17,[%o1+4] 211*25c28e83SPiotr Jasiukajtis 212*25c28e83SPiotr Jasiukajtis.loop1: 213*25c28e83SPiotr Jasiukajtis lda [%i1]%asi,%l2 ! preload next argument 214*25c28e83SPiotr Jasiukajtis sub %l1,%o4,%g5 215*25c28e83SPiotr Jasiukajtis sub %o5,%l1,%o7 216*25c28e83SPiotr Jasiukajtis fabss %f10,%f12 217*25c28e83SPiotr Jasiukajtis 218*25c28e83SPiotr Jasiukajtis lda [%i1]%asi,%f20 219*25c28e83SPiotr Jasiukajtis orcc %o7,%g5,%g0 220*25c28e83SPiotr Jasiukajtis mov %i3,%o1 ! ps1 = s 221*25c28e83SPiotr Jasiukajtis bl,pn %icc,.range1 ! hx < 0x3e400000 or hx > 0x4099251e 222*25c28e83SPiotr Jasiukajtis 223*25c28e83SPiotr Jasiukajtis! delay slot 224*25c28e83SPiotr Jasiukajtis lda [%i1+4]%asi,%f23 225*25c28e83SPiotr Jasiukajtis addcc %i0,-1,%i0 226*25c28e83SPiotr Jasiukajtis add %i3,%i4,%i3 ! s += strides 227*25c28e83SPiotr Jasiukajtis 228*25c28e83SPiotr Jasiukajtis mov %l3,%l5 ! pc1 = c 229*25c28e83SPiotr Jasiukajtis add %l3,%l7,%l3 ! c += stridec 230*25c28e83SPiotr Jasiukajtis ble,pn %icc,.last2 231*25c28e83SPiotr Jasiukajtis 232*25c28e83SPiotr Jasiukajtis! delay slot 233*25c28e83SPiotr Jasiukajtis andn %l2,%i5,%l2 234*25c28e83SPiotr Jasiukajtis add %i1,%i2,%i1 ! x += stridex 235*25c28e83SPiotr Jasiukajtis faddd %f12,c3two44,%f14 236*25c28e83SPiotr Jasiukajtis st %f27,[%o2+4] 237*25c28e83SPiotr Jasiukajtis 238*25c28e83SPiotr Jasiukajtis.loop2: 239*25c28e83SPiotr Jasiukajtis sub %l2,%o4,%g5 240*25c28e83SPiotr Jasiukajtis sub %o5,%l2,%o7 241*25c28e83SPiotr Jasiukajtis fabss %f20,%f22 242*25c28e83SPiotr Jasiukajtis st %f5,[%fp+nk0] 243*25c28e83SPiotr Jasiukajtis 244*25c28e83SPiotr Jasiukajtis orcc %o7,%g5,%g0 245*25c28e83SPiotr Jasiukajtis mov %i3,%o2 ! ps2 = s 246*25c28e83SPiotr Jasiukajtis bl,pn %icc,.range2 ! hx < 0x3e400000 or hx > 0x4099251e 247*25c28e83SPiotr Jasiukajtis! delay slot 248*25c28e83SPiotr Jasiukajtis st %f15,[%fp+nk1] 249*25c28e83SPiotr Jasiukajtis 250*25c28e83SPiotr Jasiukajtis mov %l3,%l6 ! pc2 = c 251*25c28e83SPiotr Jasiukajtis 252*25c28e83SPiotr Jasiukajtis.cont: 253*25c28e83SPiotr Jasiukajtis add %i3,%i4,%i3 ! s += strides 254*25c28e83SPiotr Jasiukajtis add %l3,%l7,%l3 ! c += stridec 255*25c28e83SPiotr Jasiukajtis faddd %f22,c3two44,%f24 256*25c28e83SPiotr Jasiukajtis st %f25,[%fp+nk2] 257*25c28e83SPiotr Jasiukajtis 258*25c28e83SPiotr Jasiukajtis sub %o3,%l0,%l0 259*25c28e83SPiotr Jasiukajtis sub %o3,%l1,%l1 260*25c28e83SPiotr Jasiukajtis fmovs %f3,%f1 261*25c28e83SPiotr Jasiukajtis 262*25c28e83SPiotr Jasiukajtis sub %o3,%l2,%l2 263*25c28e83SPiotr Jasiukajtis fmovs %f13,%f11 264*25c28e83SPiotr Jasiukajtis 265*25c28e83SPiotr Jasiukajtis or %l0,%l1,%l0 266*25c28e83SPiotr Jasiukajtis orcc %l0,%l2,%g0 267*25c28e83SPiotr Jasiukajtis fmovs %f23,%f21 268*25c28e83SPiotr Jasiukajtis 269*25c28e83SPiotr Jasiukajtis fmuld %f0,invpio2,%f6 ! x * invpio2, for medium range 270*25c28e83SPiotr Jasiukajtis 271*25c28e83SPiotr Jasiukajtis fmuld %f10,invpio2,%f16 272*25c28e83SPiotr Jasiukajtis ld [%fp+nk0],%l0 273*25c28e83SPiotr Jasiukajtis 274*25c28e83SPiotr Jasiukajtis fmuld %f20,invpio2,%f26 275*25c28e83SPiotr Jasiukajtis ld [%fp+nk1],%l1 276*25c28e83SPiotr Jasiukajtis 277*25c28e83SPiotr Jasiukajtis bl,pn %icc,.medium 278*25c28e83SPiotr Jasiukajtis! delay slot 279*25c28e83SPiotr Jasiukajtis ld [%fp+nk2],%l2 280*25c28e83SPiotr Jasiukajtis 281*25c28e83SPiotr Jasiukajtis sll %l0,5,%l0 ! k 282*25c28e83SPiotr Jasiukajtis fcmpd %fcc0,%f0,pio2_3 ! x < pio2_3 iff x < 0 283*25c28e83SPiotr Jasiukajtis 284*25c28e83SPiotr Jasiukajtis sll %l1,5,%l1 285*25c28e83SPiotr Jasiukajtis ldd [%l0+%g1],%f4 286*25c28e83SPiotr Jasiukajtis fcmpd %fcc1,%f10,pio2_3 287*25c28e83SPiotr Jasiukajtis 288*25c28e83SPiotr Jasiukajtis sll %l2,5,%l2 289*25c28e83SPiotr Jasiukajtis ldd [%l1+%g1],%f14 290*25c28e83SPiotr Jasiukajtis fcmpd %fcc2,%f20,pio2_3 291*25c28e83SPiotr Jasiukajtis 292*25c28e83SPiotr Jasiukajtis ldd [%l2+%g1],%f24 293*25c28e83SPiotr Jasiukajtis 294*25c28e83SPiotr Jasiukajtis fsubd %f2,%f4,%f2 ! x -= __vlibm_TBL_sincos2[k] 295*25c28e83SPiotr Jasiukajtis 296*25c28e83SPiotr Jasiukajtis fsubd %f12,%f14,%f12 297*25c28e83SPiotr Jasiukajtis 298*25c28e83SPiotr Jasiukajtis fsubd %f22,%f24,%f22 299*25c28e83SPiotr Jasiukajtis 300*25c28e83SPiotr Jasiukajtis fmuld %f2,%f2,%f0 ! z = x * x 301*25c28e83SPiotr Jasiukajtis 302*25c28e83SPiotr Jasiukajtis fmuld %f12,%f12,%f10 303*25c28e83SPiotr Jasiukajtis 304*25c28e83SPiotr Jasiukajtis fmuld %f22,%f22,%f20 305*25c28e83SPiotr Jasiukajtis 306*25c28e83SPiotr Jasiukajtis fmuld %f0,pp3,%f6 307*25c28e83SPiotr Jasiukajtis 308*25c28e83SPiotr Jasiukajtis fmuld %f10,pp3,%f16 309*25c28e83SPiotr Jasiukajtis 310*25c28e83SPiotr Jasiukajtis fmuld %f20,pp3,%f26 311*25c28e83SPiotr Jasiukajtis 312*25c28e83SPiotr Jasiukajtis faddd %f6,pp2,%f6 313*25c28e83SPiotr Jasiukajtis fmuld %f0,qq3,%f4 314*25c28e83SPiotr Jasiukajtis 315*25c28e83SPiotr Jasiukajtis faddd %f16,pp2,%f16 316*25c28e83SPiotr Jasiukajtis fmuld %f10,qq3,%f14 317*25c28e83SPiotr Jasiukajtis 318*25c28e83SPiotr Jasiukajtis faddd %f26,pp2,%f26 319*25c28e83SPiotr Jasiukajtis fmuld %f20,qq3,%f24 320*25c28e83SPiotr Jasiukajtis 321*25c28e83SPiotr Jasiukajtis fmuld %f0,%f6,%f6 322*25c28e83SPiotr Jasiukajtis faddd %f4,qq2,%f4 323*25c28e83SPiotr Jasiukajtis 324*25c28e83SPiotr Jasiukajtis fmuld %f10,%f16,%f16 325*25c28e83SPiotr Jasiukajtis faddd %f14,qq2,%f14 326*25c28e83SPiotr Jasiukajtis 327*25c28e83SPiotr Jasiukajtis fmuld %f20,%f26,%f26 328*25c28e83SPiotr Jasiukajtis faddd %f24,qq2,%f24 329*25c28e83SPiotr Jasiukajtis 330*25c28e83SPiotr Jasiukajtis faddd %f6,pp1,%f6 331*25c28e83SPiotr Jasiukajtis fmuld %f0,%f4,%f4 332*25c28e83SPiotr Jasiukajtis add %l0,%g1,%l0 333*25c28e83SPiotr Jasiukajtis 334*25c28e83SPiotr Jasiukajtis faddd %f16,pp1,%f16 335*25c28e83SPiotr Jasiukajtis fmuld %f10,%f14,%f14 336*25c28e83SPiotr Jasiukajtis add %l1,%g1,%l1 337*25c28e83SPiotr Jasiukajtis 338*25c28e83SPiotr Jasiukajtis faddd %f26,pp1,%f26 339*25c28e83SPiotr Jasiukajtis fmuld %f20,%f24,%f24 340*25c28e83SPiotr Jasiukajtis add %l2,%g1,%l2 341*25c28e83SPiotr Jasiukajtis 342*25c28e83SPiotr Jasiukajtis fmuld %f0,%f6,%f6 343*25c28e83SPiotr Jasiukajtis faddd %f4,qq1,%f4 344*25c28e83SPiotr Jasiukajtis 345*25c28e83SPiotr Jasiukajtis fmuld %f10,%f16,%f16 346*25c28e83SPiotr Jasiukajtis faddd %f14,qq1,%f14 347*25c28e83SPiotr Jasiukajtis 348*25c28e83SPiotr Jasiukajtis fmuld %f20,%f26,%f26 349*25c28e83SPiotr Jasiukajtis faddd %f24,qq1,%f24 350*25c28e83SPiotr Jasiukajtis 351*25c28e83SPiotr Jasiukajtis fmuld %f2,%f6,%f6 352*25c28e83SPiotr Jasiukajtis ldd [%l0+8],%f8 353*25c28e83SPiotr Jasiukajtis 354*25c28e83SPiotr Jasiukajtis fmuld %f12,%f16,%f16 355*25c28e83SPiotr Jasiukajtis ldd [%l1+8],%f18 356*25c28e83SPiotr Jasiukajtis 357*25c28e83SPiotr Jasiukajtis fmuld %f22,%f26,%f26 358*25c28e83SPiotr Jasiukajtis ldd [%l2+8],%f28 359*25c28e83SPiotr Jasiukajtis 360*25c28e83SPiotr Jasiukajtis faddd %f6,%f2,%f6 361*25c28e83SPiotr Jasiukajtis fmuld %f0,%f4,%f4 362*25c28e83SPiotr Jasiukajtis ldd [%l0+16],%f30 363*25c28e83SPiotr Jasiukajtis 364*25c28e83SPiotr Jasiukajtis faddd %f16,%f12,%f16 365*25c28e83SPiotr Jasiukajtis fmuld %f10,%f14,%f14 366*25c28e83SPiotr Jasiukajtis ldd [%l1+16],%f32 367*25c28e83SPiotr Jasiukajtis 368*25c28e83SPiotr Jasiukajtis faddd %f26,%f22,%f26 369*25c28e83SPiotr Jasiukajtis fmuld %f20,%f24,%f24 370*25c28e83SPiotr Jasiukajtis ldd [%l2+16],%f34 371*25c28e83SPiotr Jasiukajtis 372*25c28e83SPiotr Jasiukajtis fmuld %f8,%f6,%f0 ! s * spoly 373*25c28e83SPiotr Jasiukajtis 374*25c28e83SPiotr Jasiukajtis fmuld %f18,%f16,%f10 375*25c28e83SPiotr Jasiukajtis 376*25c28e83SPiotr Jasiukajtis fmuld %f28,%f26,%f20 377*25c28e83SPiotr Jasiukajtis 378*25c28e83SPiotr Jasiukajtis fmuld %f30,%f4,%f2 ! c * cpoly 379*25c28e83SPiotr Jasiukajtis 380*25c28e83SPiotr Jasiukajtis fmuld %f32,%f14,%f12 381*25c28e83SPiotr Jasiukajtis 382*25c28e83SPiotr Jasiukajtis fmuld %f34,%f24,%f22 383*25c28e83SPiotr Jasiukajtis 384*25c28e83SPiotr Jasiukajtis fmuld %f30,%f6,%f6 ! c * spoly 385*25c28e83SPiotr Jasiukajtis fsubd %f2,%f0,%f2 386*25c28e83SPiotr Jasiukajtis 387*25c28e83SPiotr Jasiukajtis fmuld %f32,%f16,%f16 388*25c28e83SPiotr Jasiukajtis fsubd %f12,%f10,%f12 389*25c28e83SPiotr Jasiukajtis 390*25c28e83SPiotr Jasiukajtis fmuld %f34,%f26,%f26 391*25c28e83SPiotr Jasiukajtis fsubd %f22,%f20,%f22 392*25c28e83SPiotr Jasiukajtis 393*25c28e83SPiotr Jasiukajtis fmuld %f8,%f4,%f4 ! s * cpoly 394*25c28e83SPiotr Jasiukajtis faddd %f2,%f30,%f2 395*25c28e83SPiotr Jasiukajtis st %f2,[%l4] 396*25c28e83SPiotr Jasiukajtis 397*25c28e83SPiotr Jasiukajtis fmuld %f18,%f14,%f14 398*25c28e83SPiotr Jasiukajtis faddd %f12,%f32,%f12 399*25c28e83SPiotr Jasiukajtis st %f3,[%l4+4] 400*25c28e83SPiotr Jasiukajtis 401*25c28e83SPiotr Jasiukajtis fmuld %f28,%f24,%f24 402*25c28e83SPiotr Jasiukajtis faddd %f22,%f34,%f22 403*25c28e83SPiotr Jasiukajtis st %f12,[%l5] 404*25c28e83SPiotr Jasiukajtis 405*25c28e83SPiotr Jasiukajtis faddd %f6,%f4,%f6 406*25c28e83SPiotr Jasiukajtis st %f13,[%l5+4] 407*25c28e83SPiotr Jasiukajtis 408*25c28e83SPiotr Jasiukajtis faddd %f16,%f14,%f16 409*25c28e83SPiotr Jasiukajtis st %f22,[%l6] 410*25c28e83SPiotr Jasiukajtis 411*25c28e83SPiotr Jasiukajtis faddd %f26,%f24,%f26 412*25c28e83SPiotr Jasiukajtis st %f23,[%l6+4] 413*25c28e83SPiotr Jasiukajtis 414*25c28e83SPiotr Jasiukajtis faddd %f6,%f8,%f6 415*25c28e83SPiotr Jasiukajtis 416*25c28e83SPiotr Jasiukajtis faddd %f16,%f18,%f16 417*25c28e83SPiotr Jasiukajtis 418*25c28e83SPiotr Jasiukajtis faddd %f26,%f28,%f26 419*25c28e83SPiotr Jasiukajtis 420*25c28e83SPiotr Jasiukajtis fnegd %f6,%f4 421*25c28e83SPiotr Jasiukajtis lda [%i1]%asi,%l0 ! preload next argument 422*25c28e83SPiotr Jasiukajtis 423*25c28e83SPiotr Jasiukajtis fnegd %f16,%f14 424*25c28e83SPiotr Jasiukajtis lda [%i1]%asi,%f0 425*25c28e83SPiotr Jasiukajtis 426*25c28e83SPiotr Jasiukajtis fnegd %f26,%f24 427*25c28e83SPiotr Jasiukajtis lda [%i1+4]%asi,%f3 428*25c28e83SPiotr Jasiukajtis andn %l0,%i5,%l0 429*25c28e83SPiotr Jasiukajtis add %i1,%i2,%i1 430*25c28e83SPiotr Jasiukajtis 431*25c28e83SPiotr Jasiukajtis fmovdl %fcc0,%f4,%f6 ! (hx < -0)? -s : s 432*25c28e83SPiotr Jasiukajtis st %f6,[%o0] 433*25c28e83SPiotr Jasiukajtis 434*25c28e83SPiotr Jasiukajtis fmovdl %fcc1,%f14,%f16 435*25c28e83SPiotr Jasiukajtis st %f16,[%o1] 436*25c28e83SPiotr Jasiukajtis 437*25c28e83SPiotr Jasiukajtis fmovdl %fcc2,%f24,%f26 438*25c28e83SPiotr Jasiukajtis st %f26,[%o2] 439*25c28e83SPiotr Jasiukajtis addcc %i0,-1,%i0 440*25c28e83SPiotr Jasiukajtis 441*25c28e83SPiotr Jasiukajtis bg,pt %icc,.loop0 442*25c28e83SPiotr Jasiukajtis! delay slot 443*25c28e83SPiotr Jasiukajtis st %f7,[%o0+4] 444*25c28e83SPiotr Jasiukajtis 445*25c28e83SPiotr Jasiukajtis ba,pt %icc,.end 446*25c28e83SPiotr Jasiukajtis! delay slot 447*25c28e83SPiotr Jasiukajtis nop 448*25c28e83SPiotr Jasiukajtis 449*25c28e83SPiotr Jasiukajtis 450*25c28e83SPiotr Jasiukajtis .align 16 451*25c28e83SPiotr Jasiukajtis.medium: 452*25c28e83SPiotr Jasiukajtis faddd %f6,c3two51,%f4 453*25c28e83SPiotr Jasiukajtis st %f5,[%fp+nk0] 454*25c28e83SPiotr Jasiukajtis 455*25c28e83SPiotr Jasiukajtis faddd %f16,c3two51,%f14 456*25c28e83SPiotr Jasiukajtis st %f15,[%fp+nk1] 457*25c28e83SPiotr Jasiukajtis 458*25c28e83SPiotr Jasiukajtis faddd %f26,c3two51,%f24 459*25c28e83SPiotr Jasiukajtis st %f25,[%fp+nk2] 460*25c28e83SPiotr Jasiukajtis 461*25c28e83SPiotr Jasiukajtis fsubd %f4,c3two51,%f6 462*25c28e83SPiotr Jasiukajtis 463*25c28e83SPiotr Jasiukajtis fsubd %f14,c3two51,%f16 464*25c28e83SPiotr Jasiukajtis 465*25c28e83SPiotr Jasiukajtis fsubd %f24,c3two51,%f26 466*25c28e83SPiotr Jasiukajtis 467*25c28e83SPiotr Jasiukajtis fmuld %f6,pio2_1,%f2 468*25c28e83SPiotr Jasiukajtis ld [%fp+nk0],%i5 ! n 469*25c28e83SPiotr Jasiukajtis 470*25c28e83SPiotr Jasiukajtis fmuld %f16,pio2_1,%f12 471*25c28e83SPiotr Jasiukajtis ld [%fp+nk1],%g5 472*25c28e83SPiotr Jasiukajtis 473*25c28e83SPiotr Jasiukajtis fmuld %f26,pio2_1,%f22 474*25c28e83SPiotr Jasiukajtis ld [%fp+nk2],%o7 475*25c28e83SPiotr Jasiukajtis 476*25c28e83SPiotr Jasiukajtis fsubd %f0,%f2,%f0 477*25c28e83SPiotr Jasiukajtis fmuld %f6,pio2_2,%f4 478*25c28e83SPiotr Jasiukajtis mov %o0,%o4 ! if (n & 1) swap ps, pc 479*25c28e83SPiotr Jasiukajtis andcc %i5,1,%g0 480*25c28e83SPiotr Jasiukajtis 481*25c28e83SPiotr Jasiukajtis fsubd %f10,%f12,%f10 482*25c28e83SPiotr Jasiukajtis fmuld %f16,pio2_2,%f14 483*25c28e83SPiotr Jasiukajtis movnz %icc,%l4,%o0 484*25c28e83SPiotr Jasiukajtis and %i5,3,%i5 485*25c28e83SPiotr Jasiukajtis 486*25c28e83SPiotr Jasiukajtis fsubd %f20,%f22,%f20 487*25c28e83SPiotr Jasiukajtis fmuld %f26,pio2_2,%f24 488*25c28e83SPiotr Jasiukajtis movnz %icc,%o4,%l4 489*25c28e83SPiotr Jasiukajtis 490*25c28e83SPiotr Jasiukajtis fsubd %f0,%f4,%f30 491*25c28e83SPiotr Jasiukajtis mov %o1,%o4 492*25c28e83SPiotr Jasiukajtis andcc %g5,1,%g0 493*25c28e83SPiotr Jasiukajtis 494*25c28e83SPiotr Jasiukajtis fsubd %f10,%f14,%f32 495*25c28e83SPiotr Jasiukajtis movnz %icc,%l5,%o1 496*25c28e83SPiotr Jasiukajtis and %g5,3,%g5 497*25c28e83SPiotr Jasiukajtis 498*25c28e83SPiotr Jasiukajtis fsubd %f20,%f24,%f34 499*25c28e83SPiotr Jasiukajtis movnz %icc,%o4,%l5 500*25c28e83SPiotr Jasiukajtis 501*25c28e83SPiotr Jasiukajtis fsubd %f0,%f30,%f0 502*25c28e83SPiotr Jasiukajtis fcmple32 %f30,pio2_3,%l0 ! x <= pio2_3 iff x < 0 503*25c28e83SPiotr Jasiukajtis mov %o2,%o4 504*25c28e83SPiotr Jasiukajtis andcc %o7,1,%g0 505*25c28e83SPiotr Jasiukajtis 506*25c28e83SPiotr Jasiukajtis fsubd %f10,%f32,%f10 507*25c28e83SPiotr Jasiukajtis fcmple32 %f32,pio2_3,%l1 508*25c28e83SPiotr Jasiukajtis movnz %icc,%l6,%o2 509*25c28e83SPiotr Jasiukajtis and %o7,3,%o7 510*25c28e83SPiotr Jasiukajtis 511*25c28e83SPiotr Jasiukajtis fsubd %f20,%f34,%f20 512*25c28e83SPiotr Jasiukajtis fcmple32 %f34,pio2_3,%l2 513*25c28e83SPiotr Jasiukajtis movnz %icc,%o4,%l6 514*25c28e83SPiotr Jasiukajtis 515*25c28e83SPiotr Jasiukajtis fsubd %f0,%f4,%f0 516*25c28e83SPiotr Jasiukajtis fmuld %f6,pio2_3,%f6 517*25c28e83SPiotr Jasiukajtis add %i5,1,%o4 ! n = (n >> 1) | (((n + 1) ^ l) & 2) 518*25c28e83SPiotr Jasiukajtis srl %i5,1,%i5 519*25c28e83SPiotr Jasiukajtis 520*25c28e83SPiotr Jasiukajtis fsubd %f10,%f14,%f10 521*25c28e83SPiotr Jasiukajtis fmuld %f16,pio2_3,%f16 522*25c28e83SPiotr Jasiukajtis xor %o4,%l0,%o4 523*25c28e83SPiotr Jasiukajtis 524*25c28e83SPiotr Jasiukajtis fsubd %f20,%f24,%f20 525*25c28e83SPiotr Jasiukajtis fmuld %f26,pio2_3,%f26 526*25c28e83SPiotr Jasiukajtis and %o4,2,%o4 527*25c28e83SPiotr Jasiukajtis 528*25c28e83SPiotr Jasiukajtis fsubd %f6,%f0,%f6 529*25c28e83SPiotr Jasiukajtis or %i5,%o4,%i5 530*25c28e83SPiotr Jasiukajtis 531*25c28e83SPiotr Jasiukajtis fsubd %f16,%f10,%f16 532*25c28e83SPiotr Jasiukajtis add %g5,1,%o4 533*25c28e83SPiotr Jasiukajtis srl %g5,1,%g5 534*25c28e83SPiotr Jasiukajtis 535*25c28e83SPiotr Jasiukajtis fsubd %f26,%f20,%f26 536*25c28e83SPiotr Jasiukajtis xor %o4,%l1,%o4 537*25c28e83SPiotr Jasiukajtis 538*25c28e83SPiotr Jasiukajtis fsubd %f30,%f6,%f0 ! reduced x 539*25c28e83SPiotr Jasiukajtis and %o4,2,%o4 540*25c28e83SPiotr Jasiukajtis 541*25c28e83SPiotr Jasiukajtis fsubd %f32,%f16,%f10 542*25c28e83SPiotr Jasiukajtis or %g5,%o4,%g5 543*25c28e83SPiotr Jasiukajtis 544*25c28e83SPiotr Jasiukajtis fsubd %f34,%f26,%f20 545*25c28e83SPiotr Jasiukajtis add %o7,1,%o4 546*25c28e83SPiotr Jasiukajtis srl %o7,1,%o7 547*25c28e83SPiotr Jasiukajtis 548*25c28e83SPiotr Jasiukajtis fzero %f38 549*25c28e83SPiotr Jasiukajtis xor %o4,%l2,%o4 550*25c28e83SPiotr Jasiukajtis 551*25c28e83SPiotr Jasiukajtis fabsd %f0,%f2 552*25c28e83SPiotr Jasiukajtis and %o4,2,%o4 553*25c28e83SPiotr Jasiukajtis 554*25c28e83SPiotr Jasiukajtis fabsd %f10,%f12 555*25c28e83SPiotr Jasiukajtis or %o7,%o4,%o7 556*25c28e83SPiotr Jasiukajtis 557*25c28e83SPiotr Jasiukajtis fabsd %f20,%f22 558*25c28e83SPiotr Jasiukajtis sethi %hi(0x3e400000),%o4 559*25c28e83SPiotr Jasiukajtis 560*25c28e83SPiotr Jasiukajtis fnegd %f38,%f38 561*25c28e83SPiotr Jasiukajtis 562*25c28e83SPiotr Jasiukajtis faddd %f2,c3two44,%f4 563*25c28e83SPiotr Jasiukajtis st %f5,[%fp+nk0] 564*25c28e83SPiotr Jasiukajtis 565*25c28e83SPiotr Jasiukajtis faddd %f12,c3two44,%f14 566*25c28e83SPiotr Jasiukajtis st %f15,[%fp+nk1] 567*25c28e83SPiotr Jasiukajtis 568*25c28e83SPiotr Jasiukajtis faddd %f22,c3two44,%f24 569*25c28e83SPiotr Jasiukajtis st %f25,[%fp+nk2] 570*25c28e83SPiotr Jasiukajtis 571*25c28e83SPiotr Jasiukajtis fsubd %f30,%f0,%f4 572*25c28e83SPiotr Jasiukajtis 573*25c28e83SPiotr Jasiukajtis fsubd %f32,%f10,%f14 574*25c28e83SPiotr Jasiukajtis 575*25c28e83SPiotr Jasiukajtis fsubd %f34,%f20,%f24 576*25c28e83SPiotr Jasiukajtis 577*25c28e83SPiotr Jasiukajtis fsubd %f4,%f6,%f6 ! w 578*25c28e83SPiotr Jasiukajtis ld [%fp+nk0],%l0 579*25c28e83SPiotr Jasiukajtis 580*25c28e83SPiotr Jasiukajtis fsubd %f14,%f16,%f16 581*25c28e83SPiotr Jasiukajtis ld [%fp+nk1],%l1 582*25c28e83SPiotr Jasiukajtis 583*25c28e83SPiotr Jasiukajtis fsubd %f24,%f26,%f26 584*25c28e83SPiotr Jasiukajtis ld [%fp+nk2],%l2 585*25c28e83SPiotr Jasiukajtis sll %l0,5,%l0 ! k 586*25c28e83SPiotr Jasiukajtis 587*25c28e83SPiotr Jasiukajtis fand %f0,%f38,%f30 ! sign bit of x 588*25c28e83SPiotr Jasiukajtis ldd [%l0+%g1],%f4 589*25c28e83SPiotr Jasiukajtis sll %l1,5,%l1 590*25c28e83SPiotr Jasiukajtis 591*25c28e83SPiotr Jasiukajtis fand %f10,%f38,%f32 592*25c28e83SPiotr Jasiukajtis ldd [%l1+%g1],%f14 593*25c28e83SPiotr Jasiukajtis sll %l2,5,%l2 594*25c28e83SPiotr Jasiukajtis 595*25c28e83SPiotr Jasiukajtis fand %f20,%f38,%f34 596*25c28e83SPiotr Jasiukajtis ldd [%l2+%g1],%f24 597*25c28e83SPiotr Jasiukajtis 598*25c28e83SPiotr Jasiukajtis fsubd %f2,%f4,%f2 ! x -= __vlibm_TBL_sincos2[k] 599*25c28e83SPiotr Jasiukajtis 600*25c28e83SPiotr Jasiukajtis fsubd %f12,%f14,%f12 601*25c28e83SPiotr Jasiukajtis 602*25c28e83SPiotr Jasiukajtis fsubd %f22,%f24,%f22 603*25c28e83SPiotr Jasiukajtis 604*25c28e83SPiotr Jasiukajtis fmuld %f2,%f2,%f0 ! z = x * x 605*25c28e83SPiotr Jasiukajtis fxor %f6,%f30,%f30 606*25c28e83SPiotr Jasiukajtis 607*25c28e83SPiotr Jasiukajtis fmuld %f12,%f12,%f10 608*25c28e83SPiotr Jasiukajtis fxor %f16,%f32,%f32 609*25c28e83SPiotr Jasiukajtis 610*25c28e83SPiotr Jasiukajtis fmuld %f22,%f22,%f20 611*25c28e83SPiotr Jasiukajtis fxor %f26,%f34,%f34 612*25c28e83SPiotr Jasiukajtis 613*25c28e83SPiotr Jasiukajtis fmuld %f0,pp3,%f6 614*25c28e83SPiotr Jasiukajtis 615*25c28e83SPiotr Jasiukajtis fmuld %f10,pp3,%f16 616*25c28e83SPiotr Jasiukajtis 617*25c28e83SPiotr Jasiukajtis fmuld %f20,pp3,%f26 618*25c28e83SPiotr Jasiukajtis 619*25c28e83SPiotr Jasiukajtis faddd %f6,pp2,%f6 620*25c28e83SPiotr Jasiukajtis fmuld %f0,qq3,%f4 621*25c28e83SPiotr Jasiukajtis 622*25c28e83SPiotr Jasiukajtis faddd %f16,pp2,%f16 623*25c28e83SPiotr Jasiukajtis fmuld %f10,qq3,%f14 624*25c28e83SPiotr Jasiukajtis 625*25c28e83SPiotr Jasiukajtis faddd %f26,pp2,%f26 626*25c28e83SPiotr Jasiukajtis fmuld %f20,qq3,%f24 627*25c28e83SPiotr Jasiukajtis 628*25c28e83SPiotr Jasiukajtis fmuld %f0,%f6,%f6 629*25c28e83SPiotr Jasiukajtis faddd %f4,qq2,%f4 630*25c28e83SPiotr Jasiukajtis 631*25c28e83SPiotr Jasiukajtis fmuld %f10,%f16,%f16 632*25c28e83SPiotr Jasiukajtis faddd %f14,qq2,%f14 633*25c28e83SPiotr Jasiukajtis 634*25c28e83SPiotr Jasiukajtis fmuld %f20,%f26,%f26 635*25c28e83SPiotr Jasiukajtis faddd %f24,qq2,%f24 636*25c28e83SPiotr Jasiukajtis 637*25c28e83SPiotr Jasiukajtis faddd %f6,pp1,%f6 638*25c28e83SPiotr Jasiukajtis fmuld %f0,%f4,%f4 639*25c28e83SPiotr Jasiukajtis add %l0,%g1,%l0 640*25c28e83SPiotr Jasiukajtis 641*25c28e83SPiotr Jasiukajtis faddd %f16,pp1,%f16 642*25c28e83SPiotr Jasiukajtis fmuld %f10,%f14,%f14 643*25c28e83SPiotr Jasiukajtis add %l1,%g1,%l1 644*25c28e83SPiotr Jasiukajtis 645*25c28e83SPiotr Jasiukajtis faddd %f26,pp1,%f26 646*25c28e83SPiotr Jasiukajtis fmuld %f20,%f24,%f24 647*25c28e83SPiotr Jasiukajtis add %l2,%g1,%l2 648*25c28e83SPiotr Jasiukajtis 649*25c28e83SPiotr Jasiukajtis fmuld %f0,%f6,%f6 650*25c28e83SPiotr Jasiukajtis faddd %f4,qq1,%f4 651*25c28e83SPiotr Jasiukajtis 652*25c28e83SPiotr Jasiukajtis fmuld %f10,%f16,%f16 653*25c28e83SPiotr Jasiukajtis faddd %f14,qq1,%f14 654*25c28e83SPiotr Jasiukajtis 655*25c28e83SPiotr Jasiukajtis fmuld %f20,%f26,%f26 656*25c28e83SPiotr Jasiukajtis faddd %f24,qq1,%f24 657*25c28e83SPiotr Jasiukajtis 658*25c28e83SPiotr Jasiukajtis fmuld %f2,%f6,%f6 659*25c28e83SPiotr Jasiukajtis ldd [%l0+16],%f8 660*25c28e83SPiotr Jasiukajtis 661*25c28e83SPiotr Jasiukajtis fmuld %f12,%f16,%f16 662*25c28e83SPiotr Jasiukajtis ldd [%l1+16],%f18 663*25c28e83SPiotr Jasiukajtis 664*25c28e83SPiotr Jasiukajtis fmuld %f22,%f26,%f26 665*25c28e83SPiotr Jasiukajtis ldd [%l2+16],%f28 666*25c28e83SPiotr Jasiukajtis 667*25c28e83SPiotr Jasiukajtis faddd %f6,%f30,%f6 668*25c28e83SPiotr Jasiukajtis fmuld %f0,%f4,%f4 669*25c28e83SPiotr Jasiukajtis ldd [%l0+8],%f30 670*25c28e83SPiotr Jasiukajtis 671*25c28e83SPiotr Jasiukajtis faddd %f16,%f32,%f16 672*25c28e83SPiotr Jasiukajtis fmuld %f10,%f14,%f14 673*25c28e83SPiotr Jasiukajtis ldd [%l1+8],%f32 674*25c28e83SPiotr Jasiukajtis 675*25c28e83SPiotr Jasiukajtis faddd %f26,%f34,%f26 676*25c28e83SPiotr Jasiukajtis fmuld %f20,%f24,%f24 677*25c28e83SPiotr Jasiukajtis ldd [%l2+8],%f34 678*25c28e83SPiotr Jasiukajtis 679*25c28e83SPiotr Jasiukajtis fmuld %f8,%f4,%f0 ! c * cpoly 680*25c28e83SPiotr Jasiukajtis faddd %f6,%f2,%f6 681*25c28e83SPiotr Jasiukajtis 682*25c28e83SPiotr Jasiukajtis fmuld %f18,%f14,%f10 683*25c28e83SPiotr Jasiukajtis faddd %f16,%f12,%f16 684*25c28e83SPiotr Jasiukajtis 685*25c28e83SPiotr Jasiukajtis fmuld %f28,%f24,%f20 686*25c28e83SPiotr Jasiukajtis faddd %f26,%f22,%f26 687*25c28e83SPiotr Jasiukajtis 688*25c28e83SPiotr Jasiukajtis fmuld %f30,%f6,%f2 ! s * spoly 689*25c28e83SPiotr Jasiukajtis 690*25c28e83SPiotr Jasiukajtis fmuld %f32,%f16,%f12 691*25c28e83SPiotr Jasiukajtis 692*25c28e83SPiotr Jasiukajtis fmuld %f34,%f26,%f22 693*25c28e83SPiotr Jasiukajtis 694*25c28e83SPiotr Jasiukajtis fmuld %f8,%f6,%f6 ! c * spoly 695*25c28e83SPiotr Jasiukajtis fsubd %f0,%f2,%f2 696*25c28e83SPiotr Jasiukajtis 697*25c28e83SPiotr Jasiukajtis fmuld %f18,%f16,%f16 698*25c28e83SPiotr Jasiukajtis fsubd %f10,%f12,%f12 699*25c28e83SPiotr Jasiukajtis 700*25c28e83SPiotr Jasiukajtis fmuld %f28,%f26,%f26 701*25c28e83SPiotr Jasiukajtis fsubd %f20,%f22,%f22 702*25c28e83SPiotr Jasiukajtis 703*25c28e83SPiotr Jasiukajtis fmuld %f30,%f4,%f4 ! s * cpoly 704*25c28e83SPiotr Jasiukajtis faddd %f8,%f2,%f8 705*25c28e83SPiotr Jasiukajtis 706*25c28e83SPiotr Jasiukajtis fmuld %f32,%f14,%f14 707*25c28e83SPiotr Jasiukajtis faddd %f18,%f12,%f18 708*25c28e83SPiotr Jasiukajtis 709*25c28e83SPiotr Jasiukajtis fmuld %f34,%f24,%f24 710*25c28e83SPiotr Jasiukajtis faddd %f28,%f22,%f28 711*25c28e83SPiotr Jasiukajtis 712*25c28e83SPiotr Jasiukajtis faddd %f4,%f6,%f6 713*25c28e83SPiotr Jasiukajtis 714*25c28e83SPiotr Jasiukajtis faddd %f14,%f16,%f16 715*25c28e83SPiotr Jasiukajtis 716*25c28e83SPiotr Jasiukajtis faddd %f24,%f26,%f26 717*25c28e83SPiotr Jasiukajtis 718*25c28e83SPiotr Jasiukajtis faddd %f30,%f6,%f6 ! now %f6 = sin |x|, %f8 = cos |x| 719*25c28e83SPiotr Jasiukajtis 720*25c28e83SPiotr Jasiukajtis faddd %f32,%f16,%f16 721*25c28e83SPiotr Jasiukajtis 722*25c28e83SPiotr Jasiukajtis faddd %f34,%f26,%f26 723*25c28e83SPiotr Jasiukajtis 724*25c28e83SPiotr Jasiukajtis fnegd %f8,%f4 ! if (n & 1) c = -c 725*25c28e83SPiotr Jasiukajtis lda [%i1]%asi,%l0 ! preload next argument 726*25c28e83SPiotr Jasiukajtis mov %i5,%l1 727*25c28e83SPiotr Jasiukajtis 728*25c28e83SPiotr Jasiukajtis fnegd %f18,%f14 729*25c28e83SPiotr Jasiukajtis lda [%i1]%asi,%f0 730*25c28e83SPiotr Jasiukajtis sethi %hi(0x80000000),%i5 731*25c28e83SPiotr Jasiukajtis 732*25c28e83SPiotr Jasiukajtis fnegd %f28,%f24 733*25c28e83SPiotr Jasiukajtis lda [%i1+4]%asi,%f3 734*25c28e83SPiotr Jasiukajtis 735*25c28e83SPiotr Jasiukajtis andcc %l1,1,%g0 736*25c28e83SPiotr Jasiukajtis fmovdnz %icc,%f4,%f8 737*25c28e83SPiotr Jasiukajtis st %f8,[%l4] 738*25c28e83SPiotr Jasiukajtis 739*25c28e83SPiotr Jasiukajtis andcc %g5,1,%g0 740*25c28e83SPiotr Jasiukajtis fmovdnz %icc,%f14,%f18 741*25c28e83SPiotr Jasiukajtis st %f9,[%l4+4] 742*25c28e83SPiotr Jasiukajtis 743*25c28e83SPiotr Jasiukajtis andcc %o7,1,%g0 744*25c28e83SPiotr Jasiukajtis fmovdnz %icc,%f24,%f28 745*25c28e83SPiotr Jasiukajtis st %f18,[%l5] 746*25c28e83SPiotr Jasiukajtis 747*25c28e83SPiotr Jasiukajtis fnegd %f6,%f4 ! if (n & 2) s = -s 748*25c28e83SPiotr Jasiukajtis st %f19,[%l5+4] 749*25c28e83SPiotr Jasiukajtis andn %l0,%i5,%l0 750*25c28e83SPiotr Jasiukajtis 751*25c28e83SPiotr Jasiukajtis fnegd %f16,%f14 752*25c28e83SPiotr Jasiukajtis st %f28,[%l6] 753*25c28e83SPiotr Jasiukajtis add %i1,%i2,%i1 754*25c28e83SPiotr Jasiukajtis 755*25c28e83SPiotr Jasiukajtis fnegd %f26,%f24 756*25c28e83SPiotr Jasiukajtis st %f29,[%l6+4] 757*25c28e83SPiotr Jasiukajtis 758*25c28e83SPiotr Jasiukajtis andcc %l1,2,%g0 759*25c28e83SPiotr Jasiukajtis fmovdnz %icc,%f4,%f6 760*25c28e83SPiotr Jasiukajtis st %f6,[%o0] 761*25c28e83SPiotr Jasiukajtis 762*25c28e83SPiotr Jasiukajtis andcc %g5,2,%g0 763*25c28e83SPiotr Jasiukajtis fmovdnz %icc,%f14,%f16 764*25c28e83SPiotr Jasiukajtis st %f16,[%o1] 765*25c28e83SPiotr Jasiukajtis 766*25c28e83SPiotr Jasiukajtis andcc %o7,2,%g0 767*25c28e83SPiotr Jasiukajtis fmovdnz %icc,%f24,%f26 768*25c28e83SPiotr Jasiukajtis st %f26,[%o2] 769*25c28e83SPiotr Jasiukajtis 770*25c28e83SPiotr Jasiukajtis addcc %i0,-1,%i0 771*25c28e83SPiotr Jasiukajtis bg,pt %icc,.loop0 772*25c28e83SPiotr Jasiukajtis! delay slot 773*25c28e83SPiotr Jasiukajtis st %f7,[%o0+4] 774*25c28e83SPiotr Jasiukajtis 775*25c28e83SPiotr Jasiukajtis ba,pt %icc,.end 776*25c28e83SPiotr Jasiukajtis! delay slot 777*25c28e83SPiotr Jasiukajtis nop 778*25c28e83SPiotr Jasiukajtis 779*25c28e83SPiotr Jasiukajtis 780*25c28e83SPiotr Jasiukajtis .align 16 781*25c28e83SPiotr Jasiukajtis.end: 782*25c28e83SPiotr Jasiukajtis st %f17,[%o1+4] 783*25c28e83SPiotr Jasiukajtis st %f27,[%o2+4] 784*25c28e83SPiotr Jasiukajtis ld [%fp+biguns],%i5 785*25c28e83SPiotr Jasiukajtis tst %i5 ! check for huge arguments remaining 786*25c28e83SPiotr Jasiukajtis be,pt %icc,.exit 787*25c28e83SPiotr Jasiukajtis! delay slot 788*25c28e83SPiotr Jasiukajtis nop 789*25c28e83SPiotr Jasiukajtis#ifdef __sparcv9 790*25c28e83SPiotr Jasiukajtis stx %o5,[%sp+STACK_BIAS+0xb8] 791*25c28e83SPiotr Jasiukajtis ldx [%fp+xsave],%o1 792*25c28e83SPiotr Jasiukajtis ldx [%fp+ssave],%o3 793*25c28e83SPiotr Jasiukajtis ldx [%fp+csave],%o5 794*25c28e83SPiotr Jasiukajtis ldx [%fp+STACK_BIAS+0xb0],%i5 795*25c28e83SPiotr Jasiukajtis stx %i5,[%sp+STACK_BIAS+0xb0] 796*25c28e83SPiotr Jasiukajtis#else 797*25c28e83SPiotr Jasiukajtis st %o5,[%sp+0x60] 798*25c28e83SPiotr Jasiukajtis ld [%fp+xsave],%o1 799*25c28e83SPiotr Jasiukajtis ld [%fp+ssave],%o3 800*25c28e83SPiotr Jasiukajtis ld [%fp+csave],%o5 801*25c28e83SPiotr Jasiukajtis ld [%fp+0x5c],%i5 802*25c28e83SPiotr Jasiukajtis st %i5,[%sp+0x5c] 803*25c28e83SPiotr Jasiukajtis#endif 804*25c28e83SPiotr Jasiukajtis ld [%fp+nsave],%o0 805*25c28e83SPiotr Jasiukajtis ld [%fp+sxsave],%o2 806*25c28e83SPiotr Jasiukajtis ld [%fp+sssave],%o4 807*25c28e83SPiotr Jasiukajtis sra %o2,0,%o2 ! sign-extend for V9 808*25c28e83SPiotr Jasiukajtis call __vlibm_vsincos_big 809*25c28e83SPiotr Jasiukajtis sra %o4,0,%o4 ! delay slot 810*25c28e83SPiotr Jasiukajtis 811*25c28e83SPiotr Jasiukajtis.exit: 812*25c28e83SPiotr Jasiukajtis ret 813*25c28e83SPiotr Jasiukajtis restore 814*25c28e83SPiotr Jasiukajtis 815*25c28e83SPiotr Jasiukajtis 816*25c28e83SPiotr Jasiukajtis .align 16 817*25c28e83SPiotr Jasiukajtis.last1: 818*25c28e83SPiotr Jasiukajtis faddd %f2,c3two44,%f4 819*25c28e83SPiotr Jasiukajtis st %f17,[%o1+4] 820*25c28e83SPiotr Jasiukajtis.last1_from_range1: 821*25c28e83SPiotr Jasiukajtis mov 0,%l1 822*25c28e83SPiotr Jasiukajtis fzeros %f10 823*25c28e83SPiotr Jasiukajtis fzero %f12 824*25c28e83SPiotr Jasiukajtis add %fp,junk,%o1 825*25c28e83SPiotr Jasiukajtis add %fp,junk,%l5 826*25c28e83SPiotr Jasiukajtis.last2: 827*25c28e83SPiotr Jasiukajtis faddd %f12,c3two44,%f14 828*25c28e83SPiotr Jasiukajtis st %f27,[%o2+4] 829*25c28e83SPiotr Jasiukajtis st %f5,[%fp+nk0] 830*25c28e83SPiotr Jasiukajtis st %f15,[%fp+nk1] 831*25c28e83SPiotr Jasiukajtis.last2_from_range2: 832*25c28e83SPiotr Jasiukajtis mov 0,%l2 833*25c28e83SPiotr Jasiukajtis fzeros %f20 834*25c28e83SPiotr Jasiukajtis fzero %f22 835*25c28e83SPiotr Jasiukajtis add %fp,junk,%o2 836*25c28e83SPiotr Jasiukajtis ba,pt %icc,.cont 837*25c28e83SPiotr Jasiukajtis! delay slot 838*25c28e83SPiotr Jasiukajtis add %fp,junk,%l6 839*25c28e83SPiotr Jasiukajtis 840*25c28e83SPiotr Jasiukajtis 841*25c28e83SPiotr Jasiukajtis .align 16 842*25c28e83SPiotr Jasiukajtis.range0: 843*25c28e83SPiotr Jasiukajtis cmp %l0,%o4 844*25c28e83SPiotr Jasiukajtis bl,pt %icc,1f ! hx < 0x3e400000 845*25c28e83SPiotr Jasiukajtis! delay slot, harmless if branch taken 846*25c28e83SPiotr Jasiukajtis sethi %hi(0x7ff00000),%o7 847*25c28e83SPiotr Jasiukajtis cmp %l0,%o7 848*25c28e83SPiotr Jasiukajtis bl,a,pt %icc,2f ! branch if finite 849*25c28e83SPiotr Jasiukajtis! delay slot, squashed if branch not taken 850*25c28e83SPiotr Jasiukajtis st %o4,[%fp+biguns] ! set biguns 851*25c28e83SPiotr Jasiukajtis fzero %f0 852*25c28e83SPiotr Jasiukajtis fmuld %f2,%f0,%f2 853*25c28e83SPiotr Jasiukajtis st %f2,[%o0] 854*25c28e83SPiotr Jasiukajtis st %f3,[%o0+4] 855*25c28e83SPiotr Jasiukajtis st %f2,[%l3] 856*25c28e83SPiotr Jasiukajtis ba,pt %icc,2f 857*25c28e83SPiotr Jasiukajtis! delay slot 858*25c28e83SPiotr Jasiukajtis st %f3,[%l3+4] 859*25c28e83SPiotr Jasiukajtis1: 860*25c28e83SPiotr Jasiukajtis fdtoi %f2,%f4 ! raise inexact if not zero 861*25c28e83SPiotr Jasiukajtis st %f0,[%o0] 862*25c28e83SPiotr Jasiukajtis st %f3,[%o0+4] 863*25c28e83SPiotr Jasiukajtis sethi %hi(0x3ff00000),%g5 864*25c28e83SPiotr Jasiukajtis st %g5,[%l3] 865*25c28e83SPiotr Jasiukajtis st %g0,[%l3+4] 866*25c28e83SPiotr Jasiukajtis2: 867*25c28e83SPiotr Jasiukajtis addcc %i0,-1,%i0 868*25c28e83SPiotr Jasiukajtis ble,pn %icc,.end 869*25c28e83SPiotr Jasiukajtis! delay slot, harmless if branch taken 870*25c28e83SPiotr Jasiukajtis add %i3,%i4,%i3 ! s += strides 871*25c28e83SPiotr Jasiukajtis add %l3,%l7,%l3 ! c += stridec 872*25c28e83SPiotr Jasiukajtis andn %l1,%i5,%l0 ! hx &= ~0x80000000 873*25c28e83SPiotr Jasiukajtis fmovs %f10,%f0 874*25c28e83SPiotr Jasiukajtis fmovs %f13,%f3 875*25c28e83SPiotr Jasiukajtis ba,pt %icc,.loop0 876*25c28e83SPiotr Jasiukajtis! delay slot 877*25c28e83SPiotr Jasiukajtis add %i1,%i2,%i1 ! x += stridex 878*25c28e83SPiotr Jasiukajtis 879*25c28e83SPiotr Jasiukajtis 880*25c28e83SPiotr Jasiukajtis .align 16 881*25c28e83SPiotr Jasiukajtis.range1: 882*25c28e83SPiotr Jasiukajtis cmp %l1,%o4 883*25c28e83SPiotr Jasiukajtis bl,pt %icc,1f ! hx < 0x3e400000 884*25c28e83SPiotr Jasiukajtis! delay slot, harmless if branch taken 885*25c28e83SPiotr Jasiukajtis sethi %hi(0x7ff00000),%o7 886*25c28e83SPiotr Jasiukajtis cmp %l1,%o7 887*25c28e83SPiotr Jasiukajtis bl,a,pt %icc,2f ! branch if finite 888*25c28e83SPiotr Jasiukajtis! delay slot, squashed if branch not taken 889*25c28e83SPiotr Jasiukajtis st %o4,[%fp+biguns] ! set biguns 890*25c28e83SPiotr Jasiukajtis fzero %f10 891*25c28e83SPiotr Jasiukajtis fmuld %f12,%f10,%f12 892*25c28e83SPiotr Jasiukajtis st %f12,[%o1] 893*25c28e83SPiotr Jasiukajtis st %f13,[%o1+4] 894*25c28e83SPiotr Jasiukajtis st %f12,[%l3] 895*25c28e83SPiotr Jasiukajtis ba,pt %icc,2f 896*25c28e83SPiotr Jasiukajtis! delay slot 897*25c28e83SPiotr Jasiukajtis st %f13,[%l3+4] 898*25c28e83SPiotr Jasiukajtis1: 899*25c28e83SPiotr Jasiukajtis fdtoi %f12,%f14 ! raise inexact if not zero 900*25c28e83SPiotr Jasiukajtis st %f10,[%o1] 901*25c28e83SPiotr Jasiukajtis st %f13,[%o1+4] 902*25c28e83SPiotr Jasiukajtis sethi %hi(0x3ff00000),%g5 903*25c28e83SPiotr Jasiukajtis st %g5,[%l3] 904*25c28e83SPiotr Jasiukajtis st %g0,[%l3+4] 905*25c28e83SPiotr Jasiukajtis2: 906*25c28e83SPiotr Jasiukajtis addcc %i0,-1,%i0 907*25c28e83SPiotr Jasiukajtis ble,pn %icc,.last1_from_range1 908*25c28e83SPiotr Jasiukajtis! delay slot, harmless if branch taken 909*25c28e83SPiotr Jasiukajtis add %i3,%i4,%i3 ! s += strides 910*25c28e83SPiotr Jasiukajtis add %l3,%l7,%l3 ! c += stridec 911*25c28e83SPiotr Jasiukajtis andn %l2,%i5,%l1 ! hx &= ~0x80000000 912*25c28e83SPiotr Jasiukajtis fmovs %f20,%f10 913*25c28e83SPiotr Jasiukajtis fmovs %f23,%f13 914*25c28e83SPiotr Jasiukajtis ba,pt %icc,.loop1 915*25c28e83SPiotr Jasiukajtis! delay slot 916*25c28e83SPiotr Jasiukajtis add %i1,%i2,%i1 ! x += stridex 917*25c28e83SPiotr Jasiukajtis 918*25c28e83SPiotr Jasiukajtis 919*25c28e83SPiotr Jasiukajtis .align 16 920*25c28e83SPiotr Jasiukajtis.range2: 921*25c28e83SPiotr Jasiukajtis cmp %l2,%o4 922*25c28e83SPiotr Jasiukajtis bl,pt %icc,1f ! hx < 0x3e400000 923*25c28e83SPiotr Jasiukajtis! delay slot, harmless if branch taken 924*25c28e83SPiotr Jasiukajtis sethi %hi(0x7ff00000),%o7 925*25c28e83SPiotr Jasiukajtis cmp %l2,%o7 926*25c28e83SPiotr Jasiukajtis bl,a,pt %icc,2f ! branch if finite 927*25c28e83SPiotr Jasiukajtis! delay slot, squashed if branch not taken 928*25c28e83SPiotr Jasiukajtis st %o4,[%fp+biguns] ! set biguns 929*25c28e83SPiotr Jasiukajtis fzero %f20 930*25c28e83SPiotr Jasiukajtis fmuld %f22,%f20,%f22 931*25c28e83SPiotr Jasiukajtis st %f22,[%o2] 932*25c28e83SPiotr Jasiukajtis st %f23,[%o2+4] 933*25c28e83SPiotr Jasiukajtis st %f22,[%l3] 934*25c28e83SPiotr Jasiukajtis ba,pt %icc,2f 935*25c28e83SPiotr Jasiukajtis! delay slot 936*25c28e83SPiotr Jasiukajtis st %f23,[%l3+4] 937*25c28e83SPiotr Jasiukajtis1: 938*25c28e83SPiotr Jasiukajtis fdtoi %f22,%f24 ! raise inexact if not zero 939*25c28e83SPiotr Jasiukajtis st %f20,[%o2] 940*25c28e83SPiotr Jasiukajtis st %f23,[%o2+4] 941*25c28e83SPiotr Jasiukajtis sethi %hi(0x3ff00000),%g5 942*25c28e83SPiotr Jasiukajtis st %g5,[%l3] 943*25c28e83SPiotr Jasiukajtis st %g0,[%l3+4] 944*25c28e83SPiotr Jasiukajtis2: 945*25c28e83SPiotr Jasiukajtis addcc %i0,-1,%i0 946*25c28e83SPiotr Jasiukajtis ble,pn %icc,.last2_from_range2 947*25c28e83SPiotr Jasiukajtis! delay slot, harmless if branch taken 948*25c28e83SPiotr Jasiukajtis add %i3,%i4,%i3 ! s += strides 949*25c28e83SPiotr Jasiukajtis add %l3,%l7,%l3 ! c += stridec 950*25c28e83SPiotr Jasiukajtis ld [%i1],%l2 951*25c28e83SPiotr Jasiukajtis ld [%i1],%f20 952*25c28e83SPiotr Jasiukajtis ld [%i1+4],%f23 953*25c28e83SPiotr Jasiukajtis andn %l2,%i5,%l2 ! hx &= ~0x80000000 954*25c28e83SPiotr Jasiukajtis ba,pt %icc,.loop2 955*25c28e83SPiotr Jasiukajtis! delay slot 956*25c28e83SPiotr Jasiukajtis add %i1,%i2,%i1 ! x += stridex 957*25c28e83SPiotr Jasiukajtis 958*25c28e83SPiotr Jasiukajtis SET_SIZE(__vsincos) 959*25c28e83SPiotr Jasiukajtis 960