1 /* Compute the hypothenuse of X and Y.
2 Copyright (C) 1998-2017 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, see
18 <http://www.gnu.org/licenses/>. */
21 #include <i386-math-asm.h>
26 # define MO(op) op##@GOTOFF(%edx)
32 ENTRY(__ieee754_hypot)
39 fldl 12(%esp) // y : x
47 fmul %st(0) // y * y : x
49 fmul %st(0) // x * x : y * y
50 faddp // x * x + y * y
52 DBL_NARROW_EVAL_UFLOW_NONNEG
55 // We have to test whether any of the parameters is Inf.
56 // In this case the result is infinity.
59 je 3f // jump if y is Inf
62 jne 4f // jump if x is not Inf
75 strong_alias (__ieee754_hypot, __hypot_finite)