4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
26 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
27 * Use is subject to license terms.
30 #include "libm_inlines.h"
33 #define restrict _Restrict
38 extern double sqrt(double);
41 __vhypotf(int n
, float * restrict x
, int stridex
, float * restrict y
,
42 int stridey
, float * restrict z
, int stridez
)
44 float x0
, x1
, x2
, y0
, y1
, y2
, z0
, z1
, z2
, *pz0
, *pz1
, *pz2
;
45 unsigned hx0
, hx1
, hx2
, hy0
, hy1
, hy2
;
51 hx0
= *(unsigned*)x
& ~0x80000000;
52 hy0
= *(unsigned*)y
& ~0x80000000;
53 *(unsigned*)&x0
= hx0
;
54 *(unsigned*)&y0
= hy0
;
58 j0
= hy0
& 0x7f800000;
65 j0
= hx0
& 0x7f800000;
71 if (i
>= 0x0c800000 || j0
>= 0x7f800000)
74 if (hx0
== 0x7f800000)
76 else if (hy0
== 0x7f800000)
78 else if (hx0
> 0x7f800000 || hy0
> 0x7f800000)
98 hx1
= *(unsigned*)x
& ~0x80000000;
99 hy1
= *(unsigned*)y
& ~0x80000000;
100 *(unsigned*)&x1
= hx1
;
101 *(unsigned*)&y1
= hy1
;
105 j1
= hy1
& 0x7f800000;
112 j1
= hx1
& 0x7f800000;
118 if (i
>= 0x0c800000 || j1
>= 0x7f800000)
121 if (hx1
== 0x7f800000)
123 else if (hy1
== 0x7f800000)
125 else if (hx1
> 0x7f800000 || hy1
> 0x7f800000)
145 hx2
= *(unsigned*)x
& ~0x80000000;
146 hy2
= *(unsigned*)y
& ~0x80000000;
147 *(unsigned*)&x2
= hx2
;
148 *(unsigned*)&y2
= hy2
;
152 j2
= hy2
& 0x7f800000;
159 j2
= hx2
& 0x7f800000;
165 if (i
>= 0x0c800000 || j2
>= 0x7f800000)
168 if (hx2
== 0x7f800000)
170 else if (hy2
== 0x7f800000)
172 else if (hx2
> 0x7f800000 || hy2
> 0x7f800000)
185 z0
= sqrt(x0
* (double)x0
+ y0
* (double)y0
);
186 z1
= sqrt(x1
* (double)x1
+ y1
* (double)y1
);
187 z2
= sqrt(x2
* (double)x2
+ y2
* (double)y2
);
202 z1
= sqrt(x1
* (double)x1
+ y1
* (double)y1
);
205 z0
= sqrt(x0
* (double)x0
+ y0
* (double)y0
);