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]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
23 */
24 /*
25 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 .file "hypot.s"
30
31 #include "libm.h"
32 LIBM_ANSI_PRAGMA_WEAK(hypot,function)
33 #include "libm_synonyms.h"
34 #include "libm_protos.h"
35
36 #undef fabs
37
38 .data
39 .align 4
40 inf:
41 .long 0x7f800000
42
43 ENTRY(hypot)
44 movl 8(%esp),%eax / eax <-- hi_32(x)
45 andl $0x7fffffff,%eax / eax <-- hi_32(|x|)
46 jz .x_maybe_0 / if x = +/-0, return |y|
47 subl $0x7ff00000,%eax / eax <-- hi_32(|x|) - hi_32(INF)
48 jz .x_maybe_inf
49 .check_y:
50 movl 16(%esp),%eax / eax <-- hi_32(y)
51 andl $0x7fffffff,%eax / eax <-- hi_32(|y|)
52 jz .y_maybe_0 / if y = +/-0, return |x|
53 subl $0x7ff00000,%eax / eax <-- hi_32(|y|) - hi_32(INF)
|
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]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
23 */
24 /*
25 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 .file "hypot.s"
30
31 #include "libm.h"
32 LIBM_ANSI_PRAGMA_WEAK(hypot,function)
33 #include "libm_protos.h"
34
35 #undef fabs
36
37 .data
38 .align 4
39 inf:
40 .long 0x7f800000
41
42 ENTRY(hypot)
43 movl 8(%esp),%eax / eax <-- hi_32(x)
44 andl $0x7fffffff,%eax / eax <-- hi_32(|x|)
45 jz .x_maybe_0 / if x = +/-0, return |y|
46 subl $0x7ff00000,%eax / eax <-- hi_32(|x|) - hi_32(INF)
47 jz .x_maybe_inf
48 .check_y:
49 movl 16(%esp),%eax / eax <-- hi_32(y)
50 andl $0x7fffffff,%eax / eax <-- hi_32(|y|)
51 jz .y_maybe_0 / if y = +/-0, return |x|
52 subl $0x7ff00000,%eax / eax <-- hi_32(|y|) - hi_32(INF)
|