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	"__vexpf.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 Jasiukajtis!!  2^(i/256) - ((i & 0xf0) << 44), i = [0, 255]
36*25c28e83SPiotr Jasiukajtis.CONST_TBL:
37*25c28e83SPiotr Jasiukajtis	.word	0x3ff00000, 0x00000000, 0x3ff00b1a, 0xfa5abcbf
38*25c28e83SPiotr Jasiukajtis	.word	0x3ff0163d, 0xa9fb3335, 0x3ff02168, 0x143b0281
39*25c28e83SPiotr Jasiukajtis	.word	0x3ff02c9a, 0x3e778061, 0x3ff037d4, 0x2e11bbcc
40*25c28e83SPiotr Jasiukajtis	.word	0x3ff04315, 0xe86e7f85, 0x3ff04e5f, 0x72f654b1
41*25c28e83SPiotr Jasiukajtis	.word	0x3ff059b0, 0xd3158574, 0x3ff0650a, 0x0e3c1f89
42*25c28e83SPiotr Jasiukajtis	.word	0x3ff0706b, 0x29ddf6de, 0x3ff07bd4, 0x2b72a836
43*25c28e83SPiotr Jasiukajtis	.word	0x3ff08745, 0x18759bc8, 0x3ff092bd, 0xf66607e0
44*25c28e83SPiotr Jasiukajtis	.word	0x3ff09e3e, 0xcac6f383, 0x3ff0a9c7, 0x9b1f3919
45*25c28e83SPiotr Jasiukajtis	.word	0x3fefb558, 0x6cf9890f, 0x3fefc0f1, 0x45e46c85
46*25c28e83SPiotr Jasiukajtis	.word	0x3fefcc92, 0x2b7247f7, 0x3fefd83b, 0x23395dec
47*25c28e83SPiotr Jasiukajtis	.word	0x3fefe3ec, 0x32d3d1a2, 0x3fefefa5, 0x5fdfa9c5
48*25c28e83SPiotr Jasiukajtis	.word	0x3feffb66, 0xaffed31b, 0x3ff00730, 0x28d7233e
49*25c28e83SPiotr Jasiukajtis	.word	0x3ff01301, 0xd0125b51, 0x3ff01edb, 0xab5e2ab6
50*25c28e83SPiotr Jasiukajtis	.word	0x3ff02abd, 0xc06c31cc, 0x3ff036a8, 0x14f204ab
51*25c28e83SPiotr Jasiukajtis	.word	0x3ff0429a, 0xaea92de0, 0x3ff04e95, 0x934f312e
52*25c28e83SPiotr Jasiukajtis	.word	0x3ff05a98, 0xc8a58e51, 0x3ff066a4, 0x5471c3c2
53*25c28e83SPiotr Jasiukajtis	.word	0x3fef72b8, 0x3c7d517b, 0x3fef7ed4, 0x8695bbc0
54*25c28e83SPiotr Jasiukajtis	.word	0x3fef8af9, 0x388c8dea, 0x3fef9726, 0x58375d2f
55*25c28e83SPiotr Jasiukajtis	.word	0x3fefa35b, 0xeb6fcb75, 0x3fefaf99, 0xf8138a1c
56*25c28e83SPiotr Jasiukajtis	.word	0x3fefbbe0, 0x84045cd4, 0x3fefc82f, 0x95281c6b
57*25c28e83SPiotr Jasiukajtis	.word	0x3fefd487, 0x3168b9aa, 0x3fefe0e7, 0x5eb44027
58*25c28e83SPiotr Jasiukajtis	.word	0x3fefed50, 0x22fcd91d, 0x3feff9c1, 0x8438ce4d
59*25c28e83SPiotr Jasiukajtis	.word	0x3ff0063b, 0x88628cd6, 0x3ff012be, 0x3578a819
60*25c28e83SPiotr Jasiukajtis	.word	0x3ff01f49, 0x917ddc96, 0x3ff02bdd, 0xa27912d1
61*25c28e83SPiotr Jasiukajtis	.word	0x3fef387a, 0x6e756238, 0x3fef451f, 0xfb82140a
62*25c28e83SPiotr Jasiukajtis	.word	0x3fef51ce, 0x4fb2a63f, 0x3fef5e85, 0x711ece75
63*25c28e83SPiotr Jasiukajtis	.word	0x3fef6b45, 0x65e27cdd, 0x3fef780e, 0x341ddf29
64*25c28e83SPiotr Jasiukajtis	.word	0x3fef84df, 0xe1f56381, 0x3fef91ba, 0x7591bb70
65*25c28e83SPiotr Jasiukajtis	.word	0x3fef9e9d, 0xf51fdee1, 0x3fefab8a, 0x66d10f13
66*25c28e83SPiotr Jasiukajtis	.word	0x3fefb87f, 0xd0dad990, 0x3fefc57e, 0x39771b2f
67*25c28e83SPiotr Jasiukajtis	.word	0x3fefd285, 0xa6e4030b, 0x3fefdf96, 0x1f641589
68*25c28e83SPiotr Jasiukajtis	.word	0x3fefecaf, 0xa93e2f56, 0x3feff9d2, 0x4abd886b
69*25c28e83SPiotr Jasiukajtis	.word	0x3fef06fe, 0x0a31b715, 0x3fef1432, 0xedeeb2fd
70*25c28e83SPiotr Jasiukajtis	.word	0x3fef2170, 0xfc4cd831, 0x3fef2eb8, 0x3ba8ea32
71*25c28e83SPiotr Jasiukajtis	.word	0x3fef3c08, 0xb26416ff, 0x3fef4962, 0x66e3fa2d
72*25c28e83SPiotr Jasiukajtis	.word	0x3fef56c5, 0x5f929ff1, 0x3fef6431, 0xa2de883b
73*25c28e83SPiotr Jasiukajtis	.word	0x3fef71a7, 0x373aa9cb, 0x3fef7f26, 0x231e754a
74*25c28e83SPiotr Jasiukajtis	.word	0x3fef8cae, 0x6d05d866, 0x3fef9a40, 0x1b7140ef
75*25c28e83SPiotr Jasiukajtis	.word	0x3fefa7db, 0x34e59ff7, 0x3fefb57f, 0xbfec6cf4
76*25c28e83SPiotr Jasiukajtis	.word	0x3fefc32d, 0xc313a8e5, 0x3fefd0e5, 0x44ede173
77*25c28e83SPiotr Jasiukajtis	.word	0x3feedea6, 0x4c123422, 0x3feeec70, 0xdf1c5175
78*25c28e83SPiotr Jasiukajtis	.word	0x3feefa45, 0x04ac801c, 0x3fef0822, 0xc367a024
79*25c28e83SPiotr Jasiukajtis	.word	0x3fef160a, 0x21f72e2a, 0x3fef23fb, 0x2709468a
80*25c28e83SPiotr Jasiukajtis	.word	0x3fef31f5, 0xd950a897, 0x3fef3ffa, 0x3f84b9d4
81*25c28e83SPiotr Jasiukajtis	.word	0x3fef4e08, 0x6061892d, 0x3fef5c20, 0x42a7d232
82*25c28e83SPiotr Jasiukajtis	.word	0x3fef6a41, 0xed1d0057, 0x3fef786d, 0x668b3237
83*25c28e83SPiotr Jasiukajtis	.word	0x3fef86a2, 0xb5c13cd0, 0x3fef94e1, 0xe192aed2
84*25c28e83SPiotr Jasiukajtis	.word	0x3fefa32a, 0xf0d7d3de, 0x3fefb17d, 0xea6db7d7
85*25c28e83SPiotr Jasiukajtis	.word	0x3feebfda, 0xd5362a27, 0x3feece41, 0xb817c114
86*25c28e83SPiotr Jasiukajtis	.word	0x3feedcb2, 0x99fddd0d, 0x3feeeb2d, 0x81d8abff
87*25c28e83SPiotr Jasiukajtis	.word	0x3feef9b2, 0x769d2ca7, 0x3fef0841, 0x7f4531ee
88*25c28e83SPiotr Jasiukajtis	.word	0x3fef16da, 0xa2cf6642, 0x3fef257d, 0xe83f4eef
89*25c28e83SPiotr Jasiukajtis	.word	0x3fef342b, 0x569d4f82, 0x3fef42e2, 0xf4f6ad27
90*25c28e83SPiotr Jasiukajtis	.word	0x3fef51a4, 0xca5d920f, 0x3fef6070, 0xdde910d2
91*25c28e83SPiotr Jasiukajtis	.word	0x3fef6f47, 0x36b527da, 0x3fef7e27, 0xdbe2c4cf
92*25c28e83SPiotr Jasiukajtis	.word	0x3fef8d12, 0xd497c7fd, 0x3fef9c08, 0x27ff07cc
93*25c28e83SPiotr Jasiukajtis	.word	0x3feeab07, 0xdd485429, 0x3feeba11, 0xfba87a03
94*25c28e83SPiotr Jasiukajtis	.word	0x3feec926, 0x8a5946b7, 0x3feed845, 0x90998b93
95*25c28e83SPiotr Jasiukajtis	.word	0x3feee76f, 0x15ad2148, 0x3feef6a3, 0x20dceb71
96*25c28e83SPiotr Jasiukajtis	.word	0x3fef05e1, 0xb976dc09, 0x3fef152a, 0xe6cdf6f4
97*25c28e83SPiotr Jasiukajtis	.word	0x3fef247e, 0xb03a5585, 0x3fef33dd, 0x1d1929fd
98*25c28e83SPiotr Jasiukajtis	.word	0x3fef4346, 0x34ccc320, 0x3fef52b9, 0xfebc8fb7
99*25c28e83SPiotr Jasiukajtis	.word	0x3fef6238, 0x82552225, 0x3fef71c1, 0xc70833f6
100*25c28e83SPiotr Jasiukajtis	.word	0x3fef8155, 0xd44ca973, 0x3fef90f4, 0xb19e9538
101*25c28e83SPiotr Jasiukajtis	.word	0x3feea09e, 0x667f3bcd, 0x3feeb052, 0xfa75173e
102*25c28e83SPiotr Jasiukajtis	.word	0x3feec012, 0x750bdabf, 0x3feecfdc, 0xddd47645
103*25c28e83SPiotr Jasiukajtis	.word	0x3feedfb2, 0x3c651a2f, 0x3feeef92, 0x98593ae5
104*25c28e83SPiotr Jasiukajtis	.word	0x3feeff7d, 0xf9519484, 0x3fef0f74, 0x66f42e87
105*25c28e83SPiotr Jasiukajtis	.word	0x3fef1f75, 0xe8ec5f74, 0x3fef2f82, 0x86ead08a
106*25c28e83SPiotr Jasiukajtis	.word	0x3fef3f9a, 0x48a58174, 0x3fef4fbd, 0x35d7cbfd
107*25c28e83SPiotr Jasiukajtis	.word	0x3fef5feb, 0x564267c9, 0x3fef7024, 0xb1ab6e09
108*25c28e83SPiotr Jasiukajtis	.word	0x3fef8069, 0x4fde5d3f, 0x3fef90b9, 0x38ac1cf6
109*25c28e83SPiotr Jasiukajtis	.word	0x3feea114, 0x73eb0187, 0x3feeb17b, 0x0976cfdb
110*25c28e83SPiotr Jasiukajtis	.word	0x3feec1ed, 0x0130c132, 0x3feed26a, 0x62ff86f0
111*25c28e83SPiotr Jasiukajtis	.word	0x3feee2f3, 0x36cf4e62, 0x3feef387, 0x8491c491
112*25c28e83SPiotr Jasiukajtis	.word	0x3fef0427, 0x543e1a12, 0x3fef14d2, 0xadd106d9
113*25c28e83SPiotr Jasiukajtis	.word	0x3fef2589, 0x994cce13, 0x3fef364c, 0x1eb941f7
114*25c28e83SPiotr Jasiukajtis	.word	0x3fef471a, 0x4623c7ad, 0x3fef57f4, 0x179f5b21
115*25c28e83SPiotr Jasiukajtis	.word	0x3fef68d9, 0x9b4492ed, 0x3fef79ca, 0xd931a436
116*25c28e83SPiotr Jasiukajtis	.word	0x3fef8ac7, 0xd98a6699, 0x3fef9bd0, 0xa478580f
117*25c28e83SPiotr Jasiukajtis	.word	0x3feeace5, 0x422aa0db, 0x3feebe05, 0xbad61778
118*25c28e83SPiotr Jasiukajtis	.word	0x3feecf32, 0x16b5448c, 0x3feee06a, 0x5e0866d9
119*25c28e83SPiotr Jasiukajtis	.word	0x3feef1ae, 0x99157736, 0x3fef02fe, 0xd0282c8a
120*25c28e83SPiotr Jasiukajtis	.word	0x3fef145b, 0x0b91ffc6, 0x3fef25c3, 0x53aa2fe2
121*25c28e83SPiotr Jasiukajtis	.word	0x3fef3737, 0xb0cdc5e5, 0x3fef48b8, 0x2b5f98e5
122*25c28e83SPiotr Jasiukajtis	.word	0x3fef5a44, 0xcbc8520f, 0x3fef6bdd, 0x9a7670b3
123*25c28e83SPiotr Jasiukajtis	.word	0x3fef7d82, 0x9fde4e50, 0x3fef8f33, 0xe47a22a2
124*25c28e83SPiotr Jasiukajtis	.word	0x3fefa0f1, 0x70ca07ba, 0x3fefb2bb, 0x4d53fe0d
125*25c28e83SPiotr Jasiukajtis	.word	0x3feec491, 0x82a3f090, 0x3feed674, 0x194bb8d5
126*25c28e83SPiotr Jasiukajtis	.word	0x3feee863, 0x19e32323, 0x3feefa5e, 0x8d07f29e
127*25c28e83SPiotr Jasiukajtis	.word	0x3fef0c66, 0x7b5de565, 0x3fef1e7a, 0xed8eb8bb
128*25c28e83SPiotr Jasiukajtis	.word	0x3fef309b, 0xec4a2d33, 0x3fef42c9, 0x80460ad8
129*25c28e83SPiotr Jasiukajtis	.word	0x3fef5503, 0xb23e255d, 0x3fef674a, 0x8af46052
130*25c28e83SPiotr Jasiukajtis	.word	0x3fef799e, 0x1330b358, 0x3fef8bfe, 0x53c12e59
131*25c28e83SPiotr Jasiukajtis	.word	0x3fef9e6b, 0x5579fdbf, 0x3fefb0e5, 0x21356eba
132*25c28e83SPiotr Jasiukajtis	.word	0x3fefc36b, 0xbfd3f37a, 0x3fefd5ff, 0x3a3c2774
133*25c28e83SPiotr Jasiukajtis	.word	0x3feee89f, 0x995ad3ad, 0x3feefb4c, 0xe622f2ff
134*25c28e83SPiotr Jasiukajtis	.word	0x3fef0e07, 0x298db666, 0x3fef20ce, 0x6c9a8952
135*25c28e83SPiotr Jasiukajtis	.word	0x3fef33a2, 0xb84f15fb, 0x3fef4684, 0x15b749b1
136*25c28e83SPiotr Jasiukajtis	.word	0x3fef5972, 0x8de5593a, 0x3fef6c6e, 0x29f1c52a
137*25c28e83SPiotr Jasiukajtis	.word	0x3fef7f76, 0xf2fb5e47, 0x3fef928c, 0xf22749e4
138*25c28e83SPiotr Jasiukajtis	.word	0x3fefa5b0, 0x30a1064a, 0x3fefb8e0, 0xb79a6f1f
139*25c28e83SPiotr Jasiukajtis	.word	0x3fefcc1e, 0x904bc1d2, 0x3fefdf69, 0xc3f3a207
140*25c28e83SPiotr Jasiukajtis	.word	0x3feff2c2, 0x5bd71e09, 0x3ff00628, 0x6141b33d
141*25c28e83SPiotr Jasiukajtis	.word	0x3fef199b, 0xdd85529c, 0x3fef2d1c, 0xd9fa652c
142*25c28e83SPiotr Jasiukajtis	.word	0x3fef40ab, 0x5fffd07a, 0x3fef5447, 0x78fafb22
143*25c28e83SPiotr Jasiukajtis	.word	0x3fef67f1, 0x2e57d14b, 0x3fef7ba8, 0x8988c933
144*25c28e83SPiotr Jasiukajtis	.word	0x3fef8f6d, 0x9406e7b5, 0x3fefa340, 0x5751c4db
145*25c28e83SPiotr Jasiukajtis	.word	0x3fefb720, 0xdcef9069, 0x3fefcb0f, 0x2e6d1675
146*25c28e83SPiotr Jasiukajtis	.word	0x3fefdf0b, 0x555dc3fa, 0x3feff315, 0x5b5bab74
147*25c28e83SPiotr Jasiukajtis	.word	0x3ff0072d, 0x4a07897c, 0x3ff01b53, 0x2b08c968
148*25c28e83SPiotr Jasiukajtis	.word	0x3ff02f87, 0x080d89f2, 0x3ff043c8, 0xeacaa1d6
149*25c28e83SPiotr Jasiukajtis	.word	0x3fef5818, 0xdcfba487, 0x3fef6c76, 0xe862e6d3
150*25c28e83SPiotr Jasiukajtis	.word	0x3fef80e3, 0x16c98398, 0x3fef955d, 0x71ff6075
151*25c28e83SPiotr Jasiukajtis	.word	0x3fefa9e6, 0x03db3285, 0x3fefbe7c, 0xd63a8315
152*25c28e83SPiotr Jasiukajtis	.word	0x3fefd321, 0xf301b460, 0x3fefe7d5, 0x641c0658
153*25c28e83SPiotr Jasiukajtis	.word	0x3feffc97, 0x337b9b5f, 0x3ff01167, 0x6b197d17
154*25c28e83SPiotr Jasiukajtis	.word	0x3ff02646, 0x14f5a129, 0x3ff03b33, 0x3b16ee12
155*25c28e83SPiotr Jasiukajtis	.word	0x3ff0502e, 0xe78b3ff6, 0x3ff06539, 0x24676d76
156*25c28e83SPiotr Jasiukajtis	.word	0x3ff07a51, 0xfbc74c83, 0x3ff08f79, 0x77cdb740
157*25c28e83SPiotr Jasiukajtis	.word	0x3fefa4af, 0xa2a490da, 0x3fefb9f4, 0x867cca6e
158*25c28e83SPiotr Jasiukajtis	.word	0x3fefcf48, 0x2d8e67f1, 0x3fefe4aa, 0xa2188510
159*25c28e83SPiotr Jasiukajtis	.word	0x3feffa1b, 0xee615a27, 0x3ff00f9c, 0x1cb6412a
160*25c28e83SPiotr Jasiukajtis	.word	0x3ff0252b, 0x376bba97, 0x3ff03ac9, 0x48dd7274
161*25c28e83SPiotr Jasiukajtis	.word	0x3ff05076, 0x5b6e4540, 0x3ff06632, 0x798844f8
162*25c28e83SPiotr Jasiukajtis	.word	0x3ff07bfd, 0xad9cbe14, 0x3ff091d8, 0x02243c89
163*25c28e83SPiotr Jasiukajtis	.word	0x3ff0a7c1, 0x819e90d8, 0x3ff0bdba, 0x3692d514
164*25c28e83SPiotr Jasiukajtis	.word	0x3ff0d3c2, 0x2b8f71f1, 0x3ff0e9d9, 0x6b2a23d9
165*25c28e83SPiotr Jasiukajtis
166*25c28e83SPiotr Jasiukajtis	.word	0x7149f2ca, 0x0da24260	! 1.0e30f, 1.0e-30f
167*25c28e83SPiotr Jasiukajtis	.word	0x3ecebfbe, 0x9d182250	! KA2 = 3.66556671660783833261e-06
168*25c28e83SPiotr Jasiukajtis	.word	0x3f662e43, 0xe2528362	! KA1 = 2.70760782821392980564e-03
169*25c28e83SPiotr Jasiukajtis	.word	0x40771547, 0x652b82fe	! K256ONLN2 = 369.3299304675746271
170*25c28e83SPiotr Jasiukajtis	.word	0x42aeac4f, 0x42b17218	! THRESHOLD = 87.3365402f
171*25c28e83SPiotr Jasiukajtis					! THRESHOLDL = 88.7228394f
172*25c28e83SPiotr Jasiukajtis! local storage indices
173*25c28e83SPiotr Jasiukajtis
174*25c28e83SPiotr Jasiukajtis#define tmp0		STACK_BIAS-32
175*25c28e83SPiotr Jasiukajtis#define tmp1		STACK_BIAS-28
176*25c28e83SPiotr Jasiukajtis#define tmp2		STACK_BIAS-24
177*25c28e83SPiotr Jasiukajtis#define tmp3		STACK_BIAS-20
178*25c28e83SPiotr Jasiukajtis#define tmp4		STACK_BIAS-16
179*25c28e83SPiotr Jasiukajtis#define tmp5		STACK_BIAS-12
180*25c28e83SPiotr Jasiukajtis#define tmp6		STACK_BIAS-8
181*25c28e83SPiotr Jasiukajtis#define tmp7		STACK_BIAS-4
182*25c28e83SPiotr Jasiukajtis
183*25c28e83SPiotr Jasiukajtis! sizeof temp storage - must be a multiple of 16 for V9
184*25c28e83SPiotr Jasiukajtis#define tmps 		0x20
185*25c28e83SPiotr Jasiukajtis
186*25c28e83SPiotr Jasiukajtis#define I5_THRESHOLD	%i5
187*25c28e83SPiotr Jasiukajtis#define G1_CONST_TBL	%g5
188*25c28e83SPiotr Jasiukajtis#define G5_CONST	%g1
189*25c28e83SPiotr Jasiukajtis
190*25c28e83SPiotr Jasiukajtis#define F62_K256ONLN2	%f62
191*25c28e83SPiotr Jasiukajtis#define F60_KA2		%f60
192*25c28e83SPiotr Jasiukajtis#define F58_KA1		%f58
193*25c28e83SPiotr Jasiukajtis
194*25c28e83SPiotr Jasiukajtis#define THRESHOLDL	%f0
195*25c28e83SPiotr Jasiukajtis
196*25c28e83SPiotr Jasiukajtis! register use
197*25c28e83SPiotr Jasiukajtis! i0  n
198*25c28e83SPiotr Jasiukajtis! i1  x
199*25c28e83SPiotr Jasiukajtis! i2  stridex
200*25c28e83SPiotr Jasiukajtis! i3  y
201*25c28e83SPiotr Jasiukajtis! i4  stridey
202*25c28e83SPiotr Jasiukajtis
203*25c28e83SPiotr Jasiukajtis! i5  0x42aeac4f (87.3365402f)
204*25c28e83SPiotr Jasiukajtis
205*25c28e83SPiotr Jasiukajtis! g1  CONST_TBL
206*25c28e83SPiotr Jasiukajtis! g5  0x7fffffff
207*25c28e83SPiotr Jasiukajtis
208*25c28e83SPiotr Jasiukajtis! f62 K256ONLN2 = 369.3299304675746271
209*25c28e83SPiotr Jasiukajtis! f60 KA2 = 3.66556671660783833261e-06
210*25c28e83SPiotr Jasiukajtis! f58 KA1 = 2.70760782821392980564e-03
211*25c28e83SPiotr Jasiukajtis
212*25c28e83SPiotr Jasiukajtis
213*25c28e83SPiotr Jasiukajtis!		!!!!!  Algorithm  !!!!!
214*25c28e83SPiotr Jasiukajtis!
215*25c28e83SPiotr Jasiukajtis!  double y, dtmp, drez;
216*25c28e83SPiotr Jasiukajtis!  int k, sign, Xi;
217*25c28e83SPiotr Jasiukajtis!  float X, Y;
218*25c28e83SPiotr Jasiukajtis!  int THRESHOLD = 0x42aeac4f; /* 87.3365402f */
219*25c28e83SPiotr Jasiukajtis!  float THRESHOLDL = 88.7228394f;
220*25c28e83SPiotr Jasiukajtis!  double KA2 = 3.66556671660783833261e-06;
221*25c28e83SPiotr Jasiukajtis!  double KA1 = 2.70760782821392980564e-03;
222*25c28e83SPiotr Jasiukajtis!  double K256ONLN2 = 369.3299304675746271;
223*25c28e83SPiotr Jasiukajtis!  char *CONST_TBL;
224*25c28e83SPiotr Jasiukajtis!
225*25c28e83SPiotr Jasiukajtis!  X  = px[0];
226*25c28e83SPiotr Jasiukajtis!  Xi = ((int*)px)[0];
227*25c28e83SPiotr Jasiukajtis!  ax = Xi & 0x7fffffff;
228*25c28e83SPiotr Jasiukajtis!
229*25c28e83SPiotr Jasiukajtis!  if (ax > THRESHOLD) {
230*25c28e83SPiotr Jasiukajtis!    sign = ((unsigned)Xi >> 29) & 4;
231*25c28e83SPiotr Jasiukajtis!    if (ax >= 0x7f800000) {      /* Inf or NaN */
232*25c28e83SPiotr Jasiukajtis!      if (ax > 0x7f800000) {     /* NaN */
233*25c28e83SPiotr Jasiukajtis!        Y = X * X;               /* NaN -> NaN */
234*25c28e83SPiotr Jasiukajtis!        return Y;
235*25c28e83SPiotr Jasiukajtis!      }
236*25c28e83SPiotr Jasiukajtis!      Y = (sign) ? zero : X;     /* +Inf -> +Inf , -Inf -> zero */
237*25c28e83SPiotr Jasiukajtis!      return Y;
238*25c28e83SPiotr Jasiukajtis!    }
239*25c28e83SPiotr Jasiukajtis!
240*25c28e83SPiotr Jasiukajtis!    if ( X < 0.0f || X >= THRESHOLDL ) {
241*25c28e83SPiotr Jasiukajtis!      Y = ((float*)(CONST_TBL + 2048 + sign))[0];
242*25c28e83SPiotr Jasiukajtis!         /* Xi >= THRESHOLDL : Y = 1.0e+30f */
243*25c28e83SPiotr Jasiukajtis!         /* Xi < -THRESHOLD  : Y = 1.0e-30f */
244*25c28e83SPiotr Jasiukajtis!      Y =  Y * Y;
245*25c28e83SPiotr Jasiukajtis!         /* Xi >= THRESHOLDL : +Inf + overflow  */
246*25c28e83SPiotr Jasiukajtis!         /* Xi < -THRESHOLD  : +0 + underflow */
247*25c28e83SPiotr Jasiukajtis!      return Y;
248*25c28e83SPiotr Jasiukajtis!    }
249*25c28e83SPiotr Jasiukajtis!  }
250*25c28e83SPiotr Jasiukajtis!  vis_write_gsr(12 << 3);
251*25c28e83SPiotr Jasiukajtis!  y = (double) X;
252*25c28e83SPiotr Jasiukajtis!  y = K256ONLN2 * y;
253*25c28e83SPiotr Jasiukajtis!  k = (int) y;
254*25c28e83SPiotr Jasiukajtis!  dtmp = (double) k;
255*25c28e83SPiotr Jasiukajtis!  y -= dtmp;
256*25c28e83SPiotr Jasiukajtis!  dtmp = y * KA2;
257*25c28e83SPiotr Jasiukajtis!  dtmp += KA1;
258*25c28e83SPiotr Jasiukajtis!  y *= dtmp;
259*25c28e83SPiotr Jasiukajtis!  y = (y * KA2 + KA1) * y;
260*25c28e83SPiotr Jasiukajtis!  ((int*)&drez)[0] = k;
261*25c28e83SPiotr Jasiukajtis!  ((int*)&drez)[1] = 0;
262*25c28e83SPiotr Jasiukajtis!  ((float*)&drez)[0] = vis_fpackfix(drez);
263*25c28e83SPiotr Jasiukajtis!  k &= 255;
264*25c28e83SPiotr Jasiukajtis!  k <<= 3;
265*25c28e83SPiotr Jasiukajtis!  dtmp = ((double*)(CONST_TBL + k))[0];
266*25c28e83SPiotr Jasiukajtis!  drez = vis_fpadd32(drez,dtmp);
267*25c28e83SPiotr Jasiukajtis!  y *= drez;
268*25c28e83SPiotr Jasiukajtis!  y += drez;
269*25c28e83SPiotr Jasiukajtis!  Y = (float) y;
270*25c28e83SPiotr Jasiukajtis!
271*25c28e83SPiotr Jasiukajtis!
272*25c28e83SPiotr Jasiukajtis!  fstod %f16,%f40			! y = (double) X
273*25c28e83SPiotr Jasiukajtis!  fmuld F62_K256ONLN2,%f40,%f40	! y *= K256ONLN2
274*25c28e83SPiotr Jasiukajtis!  fdtoi %f40,%f16			! k = (int) y
275*25c28e83SPiotr Jasiukajtis!  st  %f16,[%fp+tmp0]			! store k
276*25c28e83SPiotr Jasiukajtis!  fitod %f16,%f34			! dtmp = (double) k
277*25c28e83SPiotr Jasiukajtis!  fpackfix  %f16,%f16			! ((float*)&drez)[0] = vis_fpackfix(drez)
278*25c28e83SPiotr Jasiukajtis!  fsubd %f40,%f34,%f40			! y -= dtmp
279*25c28e83SPiotr Jasiukajtis!  fmuld F60_KA2,%f40,%f34		! dtmp = y * KA2
280*25c28e83SPiotr Jasiukajtis!  faddd F58_KA1,%f34,%f34		! dtmp += KA1
281*25c28e83SPiotr Jasiukajtis!  ld  [%fp+tmp0],%o0			! load k
282*25c28e83SPiotr Jasiukajtis!  fmuld %f34,%f40,%f40			! y *= dtmp
283*25c28e83SPiotr Jasiukajtis!  and %o0,255,%o0			! k &= 255
284*25c28e83SPiotr Jasiukajtis!  sll  %o0,3,%o0			! k <<= 3
285*25c28e83SPiotr Jasiukajtis!  ldd [G1_CONST_TBL+%o0],%f34		! dtmp = ((double*)(CONST_TBL + k))[0]
286*25c28e83SPiotr Jasiukajtis!  fpadd32 %f16,%f34,%f34		! drez = vis_fpadd32(drez,dtmp)
287*25c28e83SPiotr Jasiukajtis!  fmuld %f34,%f40,%f40			! y *= drez
288*25c28e83SPiotr Jasiukajtis!  faddd %f34,%f40,%f40			! y += drez
289*25c28e83SPiotr Jasiukajtis!  fdtos %f40,%f26			! (float) y
290*25c28e83SPiotr Jasiukajtis!--------------------------------------------------------------------
291*25c28e83SPiotr Jasiukajtis
292*25c28e83SPiotr Jasiukajtis	ENTRY(__vexpf)
293*25c28e83SPiotr Jasiukajtis	save	%sp,-SA(MINFRAME)-tmps,%sp
294*25c28e83SPiotr Jasiukajtis	PIC_SETUP(l7)
295*25c28e83SPiotr Jasiukajtis	PIC_SET(l7,.CONST_TBL,g5)
296*25c28e83SPiotr Jasiukajtis
297*25c28e83SPiotr Jasiukajtis	wr	%g0,0x82,%asi		! set %asi for non-faulting loads
298*25c28e83SPiotr Jasiukajtis	wr	%g0,0x60,%gsr
299*25c28e83SPiotr Jasiukajtis
300*25c28e83SPiotr Jasiukajtis	sll	%i2,2,%i2
301*25c28e83SPiotr Jasiukajtis	sll	%i4,2,%i4
302*25c28e83SPiotr Jasiukajtis
303*25c28e83SPiotr Jasiukajtis	ldd	[G1_CONST_TBL+2056],F60_KA2
304*25c28e83SPiotr Jasiukajtis	sethi	%hi(0x7ffffc00),G5_CONST
305*25c28e83SPiotr Jasiukajtis	ldd	[G1_CONST_TBL+2064],F58_KA1
306*25c28e83SPiotr Jasiukajtis	add	G5_CONST,1023,G5_CONST
307*25c28e83SPiotr Jasiukajtis	ldd	[G1_CONST_TBL+2072],F62_K256ONLN2
308*25c28e83SPiotr Jasiukajtis	ld	[G1_CONST_TBL+2080],I5_THRESHOLD
309*25c28e83SPiotr Jasiukajtis	ld	[G1_CONST_TBL+2084],THRESHOLDL
310*25c28e83SPiotr Jasiukajtis
311*25c28e83SPiotr Jasiukajtis	subcc	%i0,8,%i0
312*25c28e83SPiotr Jasiukajtis	bneg,pn	%icc,.tail
313*25c28e83SPiotr Jasiukajtis	fzeros	%f3
314*25c28e83SPiotr Jasiukajtis
315*25c28e83SPiotr Jasiukajtis.main_loop_preload:
316*25c28e83SPiotr Jasiukajtis
317*25c28e83SPiotr Jasiukajtis! preload 8 elements and get absolute values
318*25c28e83SPiotr Jasiukajtis	ld	[%i1],%l0		! (0) Xi = ((int*)px)[0]
319*25c28e83SPiotr Jasiukajtis	fzeros	%f5
320*25c28e83SPiotr Jasiukajtis	ld	[%i1],%f16		! (0) X = px[0]
321*25c28e83SPiotr Jasiukajtis	fzeros	%f7
322*25c28e83SPiotr Jasiukajtis	add	%i1,%i2,%o5		! px += stridex
323*25c28e83SPiotr Jasiukajtis	ld	[%o5],%l1		! (1) Xi = ((int*)px)[0]
324*25c28e83SPiotr Jasiukajtis	and	%l0,G5_CONST,%l0	! (0) ax = Xi & 0x7fffffff
325*25c28e83SPiotr Jasiukajtis	fzeros	%f9
326*25c28e83SPiotr Jasiukajtis	ld	[%o5],%f2		! (1) X = px[0]
327*25c28e83SPiotr Jasiukajtis	fzeros	%f11
328*25c28e83SPiotr Jasiukajtis	add	%o5,%i2,%i1		! px += stridex
329*25c28e83SPiotr Jasiukajtis	ld	[%i1],%l2		! (2) Xi = ((int*)px)[0]
330*25c28e83SPiotr Jasiukajtis	and	%l1,G5_CONST,%l1	! (1) ax = Xi & 0x7fffffff
331*25c28e83SPiotr Jasiukajtis	fzeros	%f13
332*25c28e83SPiotr Jasiukajtis	ld	[%i1],%f4		! (2) X = px[0]
333*25c28e83SPiotr Jasiukajtis	fzeros	%f15
334*25c28e83SPiotr Jasiukajtis	add	%i1,%i2,%o5		! px += stridex
335*25c28e83SPiotr Jasiukajtis	ld	[%o5],%l3		! (3) Xi = ((int*)px)[0]
336*25c28e83SPiotr Jasiukajtis	and	%l2,G5_CONST,%l2	! (2) ax = Xi & 0x7fffffff
337*25c28e83SPiotr Jasiukajtis	fzeros	%f17
338*25c28e83SPiotr Jasiukajtis	ld	[%o5],%f6		! (3) X = px[0]
339*25c28e83SPiotr Jasiukajtis	add	%o5,%i2,%o0		! px += stridex
340*25c28e83SPiotr Jasiukajtis	ld	[%o0],%l4		! (4) Xi = ((int*)px)[0]
341*25c28e83SPiotr Jasiukajtis	and	%l3,G5_CONST,%l3	! (3) ax = Xi & 0x7fffffff
342*25c28e83SPiotr Jasiukajtis	add	%o0,%i2,%o1		! px += stridex
343*25c28e83SPiotr Jasiukajtis	ld	[%o1],%l5		! (5) Xi = ((int*)px)[0]
344*25c28e83SPiotr Jasiukajtis	add	%o1,%i2,%o2		! px += stridex
345*25c28e83SPiotr Jasiukajtis	ld	[%o2],%l6		! (6) Xi = ((int*)px)[0]
346*25c28e83SPiotr Jasiukajtis	and	%l4,G5_CONST,%l4	! (4) ax = Xi & 0x7fffffff
347*25c28e83SPiotr Jasiukajtis	add	%o2,%i2,%o3		! px += stridex
348*25c28e83SPiotr Jasiukajtis	ld	[%o3],%l7		! (7) Xi = ((int*)px)[0]
349*25c28e83SPiotr Jasiukajtis	add	%o3,%i2,%i1		! px += stridex
350*25c28e83SPiotr Jasiukajtis	and	%l5,G5_CONST,%l5	! (5) ax = Xi & 0x7fffffff
351*25c28e83SPiotr Jasiukajtis	and	%l6,G5_CONST,%l6	! (6) ax = Xi & 0x7fffffff
352*25c28e83SPiotr Jasiukajtis	ba	.main_loop
353*25c28e83SPiotr Jasiukajtis	and	%l7,G5_CONST,%l7	! (7) ax = Xi & 0x7fffffff
354*25c28e83SPiotr Jasiukajtis
355*25c28e83SPiotr Jasiukajtis	.align	16
356*25c28e83SPiotr Jasiukajtis.main_loop:
357*25c28e83SPiotr Jasiukajtis	cmp	%l0,I5_THRESHOLD
358*25c28e83SPiotr Jasiukajtis	bg,pn	%icc,.spec0		! (0) if (ax > THRESHOLD)
359*25c28e83SPiotr Jasiukajtis	lda	[%o0]%asi,%f8		! (4) X = px[0]
360*25c28e83SPiotr Jasiukajtis	fstod	%f16,%f40		! (0) y = (double) X
361*25c28e83SPiotr Jasiukajtis.spec0_cont:
362*25c28e83SPiotr Jasiukajtis	cmp	%l1,I5_THRESHOLD
363*25c28e83SPiotr Jasiukajtis	bg,pn	%icc,.spec1		! (1) if (ax > THRESHOLD)
364*25c28e83SPiotr Jasiukajtis	lda	[%o1]%asi,%f10		! (5) X = px[0]
365*25c28e83SPiotr Jasiukajtis	fstod	%f2,%f42		! (1) y = (double) X
366*25c28e83SPiotr Jasiukajtis.spec1_cont:
367*25c28e83SPiotr Jasiukajtis	cmp	%l2,I5_THRESHOLD
368*25c28e83SPiotr Jasiukajtis	bg,pn	%icc,.spec2		! (2) if (ax > THRESHOLD)
369*25c28e83SPiotr Jasiukajtis	lda	[%o2]%asi,%f12		! (6) X = px[0]
370*25c28e83SPiotr Jasiukajtis	fstod	%f4,%f44		! (2) y = (double) X
371*25c28e83SPiotr Jasiukajtis.spec2_cont:
372*25c28e83SPiotr Jasiukajtis	cmp	%l3,I5_THRESHOLD
373*25c28e83SPiotr Jasiukajtis	bg,pn	%icc,.spec3		! (3) if (ax > THRESHOLD)
374*25c28e83SPiotr Jasiukajtis	lda	[%o3]%asi,%f14		! (7) X = px[0]
375*25c28e83SPiotr Jasiukajtis	fstod	%f6,%f46		! (3) y = (double) X
376*25c28e83SPiotr Jasiukajtis.spec3_cont:
377*25c28e83SPiotr Jasiukajtis	cmp	%l4,I5_THRESHOLD
378*25c28e83SPiotr Jasiukajtis	bg,pn	%icc,.spec4		! (4) if (ax > THRESHOLD)
379*25c28e83SPiotr Jasiukajtis	fmuld	F62_K256ONLN2,%f40,%f40	! (0) y *= K256ONLN2
380*25c28e83SPiotr Jasiukajtis	fstod	%f8,%f48		! (4) y = (double) X
381*25c28e83SPiotr Jasiukajtis.spec4_cont:
382*25c28e83SPiotr Jasiukajtis	cmp	%l5,I5_THRESHOLD
383*25c28e83SPiotr Jasiukajtis	bg,pn	%icc,.spec5		! (5) if (ax > THRESHOLD)
384*25c28e83SPiotr Jasiukajtis	fmuld	F62_K256ONLN2,%f42,%f42	! (1) y *= K256ONLN2
385*25c28e83SPiotr Jasiukajtis	fstod	%f10,%f50		! (5) y = (double) X
386*25c28e83SPiotr Jasiukajtis.spec5_cont:
387*25c28e83SPiotr Jasiukajtis	cmp	%l6,I5_THRESHOLD
388*25c28e83SPiotr Jasiukajtis	bg,pn	%icc,.spec6		! (6) if (ax > THRESHOLD)
389*25c28e83SPiotr Jasiukajtis	fmuld	F62_K256ONLN2,%f44,%f44	! (2) y *= K256ONLN2
390*25c28e83SPiotr Jasiukajtis	fstod	%f12,%f52		! (6) y = (double) X
391*25c28e83SPiotr Jasiukajtis.spec6_cont:
392*25c28e83SPiotr Jasiukajtis	cmp	%l7,I5_THRESHOLD
393*25c28e83SPiotr Jasiukajtis	bg,pn	%icc,.spec7		! (7) if (ax > THRESHOLD)
394*25c28e83SPiotr Jasiukajtis	fmuld	F62_K256ONLN2,%f46,%f46	! (3) y *= K256ONLN2
395*25c28e83SPiotr Jasiukajtis	fstod	%f14,%f54		! (7) y = (double) X
396*25c28e83SPiotr Jasiukajtis.spec7_cont:
397*25c28e83SPiotr Jasiukajtis	fdtoi	%f40,%f16		! (0) k = (int) y
398*25c28e83SPiotr Jasiukajtis	st	%f16,[%fp+tmp0]
399*25c28e83SPiotr Jasiukajtis	fmuld	F62_K256ONLN2,%f48,%f48	! (4) y *= K256ONLN2
400*25c28e83SPiotr Jasiukajtis
401*25c28e83SPiotr Jasiukajtis	fdtoi	%f42,%f2		! (1) k = (int) y
402*25c28e83SPiotr Jasiukajtis	st	%f2,[%fp+tmp1]
403*25c28e83SPiotr Jasiukajtis	fmuld	F62_K256ONLN2,%f50,%f50	! (5) y *= K256ONLN2
404*25c28e83SPiotr Jasiukajtis
405*25c28e83SPiotr Jasiukajtis	fdtoi	%f44,%f4		! (2) k = (int) y
406*25c28e83SPiotr Jasiukajtis	st	%f4,[%fp+tmp2]
407*25c28e83SPiotr Jasiukajtis	fmuld	F62_K256ONLN2,%f52,%f52	! (6) y *= K256ONLN2
408*25c28e83SPiotr Jasiukajtis
409*25c28e83SPiotr Jasiukajtis	fdtoi	%f46,%f6		! (3) k = (int) y
410*25c28e83SPiotr Jasiukajtis	st	%f6,[%fp+tmp3]
411*25c28e83SPiotr Jasiukajtis	fmuld	F62_K256ONLN2,%f54,%f54	! (7) y *= K256ONLN2
412*25c28e83SPiotr Jasiukajtis
413*25c28e83SPiotr Jasiukajtis	fdtoi	%f48,%f8		! (4) k = (int) y
414*25c28e83SPiotr Jasiukajtis	st	%f8,[%fp+tmp4]
415*25c28e83SPiotr Jasiukajtis
416*25c28e83SPiotr Jasiukajtis	fdtoi	%f50,%f10		! (5) k = (int) y
417*25c28e83SPiotr Jasiukajtis	st	%f10,[%fp+tmp5]
418*25c28e83SPiotr Jasiukajtis
419*25c28e83SPiotr Jasiukajtis	fitod	%f16,%f34		! (0) dtmp = (double) k
420*25c28e83SPiotr Jasiukajtis	fpackfix	%f16,%f16	! (0) ((float*)&drez)[0] = vis_fpackfix(drez)
421*25c28e83SPiotr Jasiukajtis	nop
422*25c28e83SPiotr Jasiukajtis	nop
423*25c28e83SPiotr Jasiukajtis
424*25c28e83SPiotr Jasiukajtis	fdtoi	%f52,%f12		! (6) k = (int) y
425*25c28e83SPiotr Jasiukajtis	st	%f12,[%fp+tmp6]
426*25c28e83SPiotr Jasiukajtis
427*25c28e83SPiotr Jasiukajtis	fdtoi	%f54,%f14		! (7) k = (int) y
428*25c28e83SPiotr Jasiukajtis	st	%f14,[%fp+tmp7]
429*25c28e83SPiotr Jasiukajtis
430*25c28e83SPiotr Jasiukajtis	lda	[%i1]%asi,%l0		! (8) Xi = ((int*)px)[0]
431*25c28e83SPiotr Jasiukajtis	add	%i1,%i2,%o5		! px += stridex
432*25c28e83SPiotr Jasiukajtis	fitod	%f2,%f18		! (1) dtmp = (double) k
433*25c28e83SPiotr Jasiukajtis	fpackfix	%f2,%f2		! (1) ((float*)&drez)[0] = vis_fpackfix(drez)
434*25c28e83SPiotr Jasiukajtis
435*25c28e83SPiotr Jasiukajtis	lda	[%o5]%asi,%l1		! (9) Xi = ((int*)px)[0]
436*25c28e83SPiotr Jasiukajtis	add	%o5,%i2,%i1		! px += stridex
437*25c28e83SPiotr Jasiukajtis	fitod	%f4,%f20		! (2) dtmp = (double) k
438*25c28e83SPiotr Jasiukajtis	fpackfix	%f4,%f4		! (2) ((float*)&drez)[0] = vis_fpackfix(drez)
439*25c28e83SPiotr Jasiukajtis
440*25c28e83SPiotr Jasiukajtis	lda	[%i1]%asi,%l2		! (10) Xi = ((int*)px)[0]
441*25c28e83SPiotr Jasiukajtis	add	%i1,%i2,%o5		! px += stridex
442*25c28e83SPiotr Jasiukajtis	fitod	%f6,%f22		! (3) dtmp = (double) k
443*25c28e83SPiotr Jasiukajtis	fpackfix	%f6,%f6		! (3) ((float*)&drez)[0] = vis_fpackfix(drez)
444*25c28e83SPiotr Jasiukajtis
445*25c28e83SPiotr Jasiukajtis	lda	[%o5]%asi,%l3		! (11) Xi = ((int*)px)[0]
446*25c28e83SPiotr Jasiukajtis	add	%o5,%i2,%i1		! px += stridex
447*25c28e83SPiotr Jasiukajtis	fitod	%f8,%f24		! (4) dtmp = (double) k
448*25c28e83SPiotr Jasiukajtis	fpackfix	%f8,%f8		! (4) ((float*)&drez)[0] = vis_fpackfix(drez)
449*25c28e83SPiotr Jasiukajtis
450*25c28e83SPiotr Jasiukajtis	fitod	%f10,%f26		! (5) dtmp = (double) k
451*25c28e83SPiotr Jasiukajtis	fpackfix	%f10,%f10	! (5) ((float*)&drez)[0] = vis_fpackfix(drez)
452*25c28e83SPiotr Jasiukajtis
453*25c28e83SPiotr Jasiukajtis	fitod	%f12,%f28		! (6) dtmp = (double) k
454*25c28e83SPiotr Jasiukajtis	fpackfix	%f12,%f12	! (6) ((float*)&drez)[0] = vis_fpackfix(drez)
455*25c28e83SPiotr Jasiukajtis
456*25c28e83SPiotr Jasiukajtis	fitod	%f14,%f30		! (7) dtmp = (double) k
457*25c28e83SPiotr Jasiukajtis	fpackfix	%f14,%f14	! (7) ((float*)&drez)[0] = vis_fpackfix(drez)
458*25c28e83SPiotr Jasiukajtis
459*25c28e83SPiotr Jasiukajtis	ld	[%fp+tmp0],%o0		! (0) load k
460*25c28e83SPiotr Jasiukajtis	and	%l0,G5_CONST,%l0	! (8) ax = Xi & 0x7fffffff
461*25c28e83SPiotr Jasiukajtis	fsubd	%f40,%f34,%f40		! (0) y -= dtmp
462*25c28e83SPiotr Jasiukajtis
463*25c28e83SPiotr Jasiukajtis	ld	[%fp+tmp1],%o1		! (1) load k
464*25c28e83SPiotr Jasiukajtis	and	%l1,G5_CONST,%l1	! (9) ax = Xi & 0x7fffffff
465*25c28e83SPiotr Jasiukajtis	fsubd	%f42,%f18,%f42		! (1) y -= dtmp
466*25c28e83SPiotr Jasiukajtis
467*25c28e83SPiotr Jasiukajtis	ld	[%fp+tmp2],%o2		! (2) load k
468*25c28e83SPiotr Jasiukajtis	and	%l2,G5_CONST,%l2	! (10) ax = Xi & 0x7fffffff
469*25c28e83SPiotr Jasiukajtis	and	%o0,255,%o0		! (0) k &= 255
470*25c28e83SPiotr Jasiukajtis	fsubd	%f44,%f20,%f44		! (2) y -= dtmp
471*25c28e83SPiotr Jasiukajtis
472*25c28e83SPiotr Jasiukajtis	ld	[%fp+tmp3],%o3		! (3) load k
473*25c28e83SPiotr Jasiukajtis	and	%o1,255,%o1		! (1) k &= 255
474*25c28e83SPiotr Jasiukajtis	fsubd	%f46,%f22,%f46		! (3) y -= dtmp
475*25c28e83SPiotr Jasiukajtis
476*25c28e83SPiotr Jasiukajtis	sll	%o0,3,%o0		! (0) k <<= 3
477*25c28e83SPiotr Jasiukajtis	sll	%o1,3,%o1		! (1) k <<= 3
478*25c28e83SPiotr Jasiukajtis	fmuld	F60_KA2,%f40,%f34	! (0) dtmp = y * KA2
479*25c28e83SPiotr Jasiukajtis	fsubd	%f48,%f24,%f48		! (4) y -= dtmp
480*25c28e83SPiotr Jasiukajtis
481*25c28e83SPiotr Jasiukajtis	and	%l3,G5_CONST,%l3	! (11) ax = Xi & 0x7fffffff
482*25c28e83SPiotr Jasiukajtis	and	%o2,255,%o2		! (2) k &= 255
483*25c28e83SPiotr Jasiukajtis	fmuld	F60_KA2,%f42,%f18	! (1) dtmp = y * KA2
484*25c28e83SPiotr Jasiukajtis	fsubd	%f50,%f26,%f50		! (5) y -= dtmp
485*25c28e83SPiotr Jasiukajtis
486*25c28e83SPiotr Jasiukajtis	sll	%o2,3,%o2		! (2) k <<= 3
487*25c28e83SPiotr Jasiukajtis	fmuld	F60_KA2,%f44,%f20	! (2) dtmp = y * KA2
488*25c28e83SPiotr Jasiukajtis	fsubd	%f52,%f28,%f52		! (6) y -= dtmp
489*25c28e83SPiotr Jasiukajtis
490*25c28e83SPiotr Jasiukajtis	ld	[%fp+tmp4],%o4		! (4) load k
491*25c28e83SPiotr Jasiukajtis	and	%o3,255,%o3		! (3) k &= 255
492*25c28e83SPiotr Jasiukajtis	fmuld	F60_KA2,%f46,%f22	! (3) dtmp = y * KA2
493*25c28e83SPiotr Jasiukajtis	fsubd	%f54,%f30,%f54		! (7) y -= dtmp
494*25c28e83SPiotr Jasiukajtis
495*25c28e83SPiotr Jasiukajtis	ld	[%fp+tmp5],%o5		! (5) load k
496*25c28e83SPiotr Jasiukajtis	sll	%o3,3,%o3		! (3) k <<= 3
497*25c28e83SPiotr Jasiukajtis	fmuld	F60_KA2,%f48,%f24	! (4) dtmp = y * KA2
498*25c28e83SPiotr Jasiukajtis	faddd	F58_KA1,%f34,%f34	! (0) dtmp += KA1
499*25c28e83SPiotr Jasiukajtis
500*25c28e83SPiotr Jasiukajtis	ld	[%fp+tmp6],%o7		! (6) load k
501*25c28e83SPiotr Jasiukajtis	and	%o4,255,%o4		! (4) k &= 255
502*25c28e83SPiotr Jasiukajtis	fmuld	F60_KA2,%f50,%f26	! (5) dtmp = y * KA2
503*25c28e83SPiotr Jasiukajtis	faddd	F58_KA1,%f18,%f18	! (1) dtmp += KA1
504*25c28e83SPiotr Jasiukajtis
505*25c28e83SPiotr Jasiukajtis	ld	[%fp+tmp7],%l4		! (7) load k
506*25c28e83SPiotr Jasiukajtis	and	%o5,255,%o5		! (5) k &= 255
507*25c28e83SPiotr Jasiukajtis	fmuld	F60_KA2,%f52,%f28	! (6) dtmp = y * KA2
508*25c28e83SPiotr Jasiukajtis	faddd	F58_KA1,%f20,%f20	! (2) dtmp += KA1
509*25c28e83SPiotr Jasiukajtis
510*25c28e83SPiotr Jasiukajtis	sll	%o5,3,%o5		! (5) k <<= 3
511*25c28e83SPiotr Jasiukajtis	fmuld	F60_KA2,%f54,%f30	! (7) dtmp = y * KA2
512*25c28e83SPiotr Jasiukajtis	faddd	F58_KA1,%f22,%f22	! (3) dtmp += KA1
513*25c28e83SPiotr Jasiukajtis
514*25c28e83SPiotr Jasiukajtis	fmuld	%f34,%f40,%f40		! (0) y *= dtmp
515*25c28e83SPiotr Jasiukajtis	ldd	[G1_CONST_TBL+%o0],%f34	! (0) dtmp = ((double*)(CONST_TBL + k))[0]
516*25c28e83SPiotr Jasiukajtis	and	%l4,255,%l4		! (7) k &= 255
517*25c28e83SPiotr Jasiukajtis	faddd	F58_KA1,%f24,%f24	! (4) dtmp += KA1
518*25c28e83SPiotr Jasiukajtis
519*25c28e83SPiotr Jasiukajtis	fmuld	%f18,%f42,%f42		! (1) y *= dtmp
520*25c28e83SPiotr Jasiukajtis	ldd	[G1_CONST_TBL+%o1],%f18	! (1) dtmp = ((double*)(CONST_TBL + k))[0]
521*25c28e83SPiotr Jasiukajtis	sll	%l4,3,%l4		! (7) k <<= 3
522*25c28e83SPiotr Jasiukajtis	faddd	F58_KA1,%f26,%f26	! (5) dtmp += KA1
523*25c28e83SPiotr Jasiukajtis
524*25c28e83SPiotr Jasiukajtis	fmuld	%f20,%f44,%f44		! (2) y *= dtmp
525*25c28e83SPiotr Jasiukajtis	ldd	[G1_CONST_TBL+%o2],%f20	! (2) dtmp = ((double*)(CONST_TBL + k))[0]
526*25c28e83SPiotr Jasiukajtis	faddd	F58_KA1,%f28,%f28	! (6) dtmp += KA1
527*25c28e83SPiotr Jasiukajtis
528*25c28e83SPiotr Jasiukajtis	fmuld	%f22,%f46,%f46		! (3) y *= dtmp
529*25c28e83SPiotr Jasiukajtis	ldd	[G1_CONST_TBL+%o3],%f22	! (3) dtmp = ((double*)(CONST_TBL + k))[0]
530*25c28e83SPiotr Jasiukajtis	sll	%o4,3,%o4		! (4) k <<= 3
531*25c28e83SPiotr Jasiukajtis	faddd	F58_KA1,%f30,%f30	! (7) dtmp += KA1
532*25c28e83SPiotr Jasiukajtis
533*25c28e83SPiotr Jasiukajtis	fmuld	%f24,%f48,%f48		! (4) y *= dtmp
534*25c28e83SPiotr Jasiukajtis	ldd	[G1_CONST_TBL+%o4],%f24	! (4) dtmp = ((double*)(CONST_TBL + k))[0]
535*25c28e83SPiotr Jasiukajtis	and	%o7,255,%o7		! (6) k &= 255
536*25c28e83SPiotr Jasiukajtis	fpadd32 %f16,%f34,%f34		! (0) drez = vis_fpadd32(drez,dtmp)
537*25c28e83SPiotr Jasiukajtis
538*25c28e83SPiotr Jasiukajtis	fmuld	%f26,%f50,%f50		! (5) y *= dtmp
539*25c28e83SPiotr Jasiukajtis	ldd	[G1_CONST_TBL+%o5],%f26	! (5) dtmp = ((double*)(CONST_TBL + k))[0]
540*25c28e83SPiotr Jasiukajtis	sll	%o7,3,%o7		! (6) k <<= 3
541*25c28e83SPiotr Jasiukajtis	fpadd32 %f2,%f18,%f18		! (1) drez = vis_fpadd32(drez,dtmp)
542*25c28e83SPiotr Jasiukajtis
543*25c28e83SPiotr Jasiukajtis	fmuld	%f28,%f52,%f52		! (6) y *= dtmp
544*25c28e83SPiotr Jasiukajtis	ldd	[G1_CONST_TBL+%o7],%f28	! (6) dtmp = ((double*)(CONST_TBL + k))[0]
545*25c28e83SPiotr Jasiukajtis	sll	%i2,2,%o0
546*25c28e83SPiotr Jasiukajtis	fpadd32 %f4,%f20,%f20		! (2) drez = vis_fpadd32(drez,dtmp)
547*25c28e83SPiotr Jasiukajtis
548*25c28e83SPiotr Jasiukajtis	fmuld	%f30,%f54,%f54		! (7) y *= dtmp
549*25c28e83SPiotr Jasiukajtis	ldd	[G1_CONST_TBL+%l4],%f30	! (7) dtmp = ((double*)(CONST_TBL + k))[0]
550*25c28e83SPiotr Jasiukajtis	sub	%i1,%o0,%o0
551*25c28e83SPiotr Jasiukajtis	fpadd32 %f6,%f22,%f22		! (3) drez = vis_fpadd32(drez,dtmp)
552*25c28e83SPiotr Jasiukajtis
553*25c28e83SPiotr Jasiukajtis	lda	[%i1]%asi,%l4		! (12) Xi = ((int*)px)[0]
554*25c28e83SPiotr Jasiukajtis	add	%i1,%i2,%o1		! px += stridex
555*25c28e83SPiotr Jasiukajtis	fpadd32 %f8,%f24,%f24		! (4) drez = vis_fpadd32(drez,dtmp)
556*25c28e83SPiotr Jasiukajtis	fmuld	%f34,%f40,%f40		! (0) y *= drez
557*25c28e83SPiotr Jasiukajtis
558*25c28e83SPiotr Jasiukajtis	lda	[%o1]%asi,%l5		! (13) Xi = ((int*)px)[0]
559*25c28e83SPiotr Jasiukajtis	add	%o1,%i2,%o2		! px += stridex
560*25c28e83SPiotr Jasiukajtis	fpadd32 %f10,%f26,%f26		! (5)  drez = vis_fpadd32(drez,dtmp)
561*25c28e83SPiotr Jasiukajtis	fmuld	%f18,%f42,%f42		! (1)  y *= drez
562*25c28e83SPiotr Jasiukajtis
563*25c28e83SPiotr Jasiukajtis	lda	[%o2]%asi,%l6		! (14) Xi = ((int*)px)[0]
564*25c28e83SPiotr Jasiukajtis	add	%o2,%i2,%o3		! px += stridex
565*25c28e83SPiotr Jasiukajtis	fpadd32 %f12,%f28,%f28		! (6)  drez = vis_fpadd32(drez,dtmp)
566*25c28e83SPiotr Jasiukajtis	fmuld	%f20,%f44,%f44		! (2)  y *= drez
567*25c28e83SPiotr Jasiukajtis
568*25c28e83SPiotr Jasiukajtis	lda	[%o3]%asi,%l7		! (15) Xi = ((int*)px)[0]
569*25c28e83SPiotr Jasiukajtis	add	%o3,%i2,%i1		! px += stridex
570*25c28e83SPiotr Jasiukajtis	fpadd32 %f14,%f30,%f30		! (7)  drez = vis_fpadd32(drez,dtmp)
571*25c28e83SPiotr Jasiukajtis	fmuld	%f22,%f46,%f46		! (3)  y *= drez
572*25c28e83SPiotr Jasiukajtis
573*25c28e83SPiotr Jasiukajtis	lda	[%o0]%asi,%f16		! (8)  X = px[0]
574*25c28e83SPiotr Jasiukajtis	add	%o0,%i2,%o5
575*25c28e83SPiotr Jasiukajtis	fmuld	%f24,%f48,%f48		! (4)  y *= drez
576*25c28e83SPiotr Jasiukajtis	faddd	%f34,%f40,%f40		! (0)  y += drez
577*25c28e83SPiotr Jasiukajtis
578*25c28e83SPiotr Jasiukajtis	lda	[%o5]%asi,%f2		! (9)  X = px[0]
579*25c28e83SPiotr Jasiukajtis	add	%o5,%i2,%o0
580*25c28e83SPiotr Jasiukajtis	fmuld	%f26,%f50,%f50		! (5)  y *= drez
581*25c28e83SPiotr Jasiukajtis	faddd	%f18,%f42,%f42		! (1)  y += drez
582*25c28e83SPiotr Jasiukajtis
583*25c28e83SPiotr Jasiukajtis	lda	[%o0]%asi,%f4		! (10) X = px[0]
584*25c28e83SPiotr Jasiukajtis	add	%o0,%i2,%o5
585*25c28e83SPiotr Jasiukajtis	fmuld	%f28,%f52,%f52		! (6)  y *= drez
586*25c28e83SPiotr Jasiukajtis	faddd	%f20,%f44,%f44		! (2)  y += drez
587*25c28e83SPiotr Jasiukajtis
588*25c28e83SPiotr Jasiukajtis	lda	[%o5]%asi,%f6		! (11) X = px[0]
589*25c28e83SPiotr Jasiukajtis	add	%o5,%i2,%o0
590*25c28e83SPiotr Jasiukajtis	fmuld	%f30,%f54,%f54		! (7)  y *= drez
591*25c28e83SPiotr Jasiukajtis	faddd	%f22,%f46,%f46		! (3)  y += drez
592*25c28e83SPiotr Jasiukajtis
593*25c28e83SPiotr Jasiukajtis	and	%l4,G5_CONST,%l4	! (12) ax = Xi & 0x7fffffff
594*25c28e83SPiotr Jasiukajtis	faddd	%f24,%f48,%f48		! (4)  y += drez
595*25c28e83SPiotr Jasiukajtis
596*25c28e83SPiotr Jasiukajtis	and	%l5,G5_CONST,%l5	! (13) ax = Xi & 0x7fffffff
597*25c28e83SPiotr Jasiukajtis	faddd	%f26,%f50,%f50		! (5)  y += drez
598*25c28e83SPiotr Jasiukajtis
599*25c28e83SPiotr Jasiukajtis	and	%l6,G5_CONST,%l6	! (14) ax = Xi & 0x7fffffff
600*25c28e83SPiotr Jasiukajtis	faddd	%f28,%f52,%f52		! (6)  y += drez
601*25c28e83SPiotr Jasiukajtis
602*25c28e83SPiotr Jasiukajtis	and	%l7,G5_CONST,%l7	! (15) ax = Xi & 0x7fffffff
603*25c28e83SPiotr Jasiukajtis	faddd	%f30,%f54,%f54		! (7)  y += drez
604*25c28e83SPiotr Jasiukajtis
605*25c28e83SPiotr Jasiukajtis	fdtos	%f40,%f26		! (0) (float) y
606*25c28e83SPiotr Jasiukajtis	st	%f26,[%i3]
607*25c28e83SPiotr Jasiukajtis	add	%i3,%i4,%o4		! py += stridey
608*25c28e83SPiotr Jasiukajtis
609*25c28e83SPiotr Jasiukajtis	fdtos	%f42,%f18		! (1) (float) y
610*25c28e83SPiotr Jasiukajtis	st	%f18,[%o4]
611*25c28e83SPiotr Jasiukajtis	add	%o4,%i4,%i3		! py += stridey
612*25c28e83SPiotr Jasiukajtis
613*25c28e83SPiotr Jasiukajtis	fdtos	%f44,%f20		! (2) (float) y
614*25c28e83SPiotr Jasiukajtis	st	%f20,[%i3]
615*25c28e83SPiotr Jasiukajtis	add	%i3,%i4,%o4		! py += stridey
616*25c28e83SPiotr Jasiukajtis
617*25c28e83SPiotr Jasiukajtis	fdtos	%f46,%f22		! (3) (float) y
618*25c28e83SPiotr Jasiukajtis	st	%f22,[%o4]
619*25c28e83SPiotr Jasiukajtis	add	%o4,%i4,%i3		! py += stridey
620*25c28e83SPiotr Jasiukajtis
621*25c28e83SPiotr Jasiukajtis	fdtos	%f48,%f24		! (4) (float) y
622*25c28e83SPiotr Jasiukajtis	st	%f24,[%i3]
623*25c28e83SPiotr Jasiukajtis	subcc	%i0,8,%i0
624*25c28e83SPiotr Jasiukajtis	add	%i3,%i4,%o4		! py += stridey
625*25c28e83SPiotr Jasiukajtis
626*25c28e83SPiotr Jasiukajtis	fdtos	%f50,%f26		! (5) (float) y
627*25c28e83SPiotr Jasiukajtis	st	%f26,[%o4]
628*25c28e83SPiotr Jasiukajtis	add	%o4,%i4,%o5		! py += stridey
629*25c28e83SPiotr Jasiukajtis	add	%i4,%i4,%o7
630*25c28e83SPiotr Jasiukajtis
631*25c28e83SPiotr Jasiukajtis	fdtos	%f52,%f28		! (6) (float) y
632*25c28e83SPiotr Jasiukajtis	st	%f28,[%o5]
633*25c28e83SPiotr Jasiukajtis	add	%o5,%i4,%o4		! py += stridey
634*25c28e83SPiotr Jasiukajtis	add	%o5,%o7,%i3		! py += stridey
635*25c28e83SPiotr Jasiukajtis
636*25c28e83SPiotr Jasiukajtis	fdtos	%f54,%f30		! (7) (float) y
637*25c28e83SPiotr Jasiukajtis	st	%f30,[%o4]
638*25c28e83SPiotr Jasiukajtis	bpos,pt	%icc,.main_loop
639*25c28e83SPiotr Jasiukajtis	nop
640*25c28e83SPiotr Jasiukajtis.after_main_loop:
641*25c28e83SPiotr Jasiukajtis	sll	%i2,3,%o2
642*25c28e83SPiotr Jasiukajtis	sub	%i1,%o2,%i1
643*25c28e83SPiotr Jasiukajtis
644*25c28e83SPiotr Jasiukajtis.tail:
645*25c28e83SPiotr Jasiukajtis	add	%i0,8,%i0
646*25c28e83SPiotr Jasiukajtis	subcc	%i0,1,%i0
647*25c28e83SPiotr Jasiukajtis	bneg,pn	%icc,.exit
648*25c28e83SPiotr Jasiukajtis
649*25c28e83SPiotr Jasiukajtis	ld	[%i1],%l0
650*25c28e83SPiotr Jasiukajtis	ld	[%i1],%f2
651