1 /* { dg-do compile } */
2 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv4t" } } */
3 /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */
4 /* { dg-options "-mthumb" } */
5 /* { dg-add-options arm_arch_v4t } */
6 /*
7 * ====================================================
8 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
9 *
10 * Developed at SunPro, a Sun Microsystems, Inc. business.
11 * Permission to use, copy, modify, and distribute this
12 * software is freely granted, provided that this notice
13 * is preserved.
14 * ====================================================
15 */
16 typedef union
17 {
18 double value;
19 struct
20 {
21 unsigned int msw;
22 } parts;
23 } ieee_double_shape_type;
__ieee754_hypot(double x,double y)24 double __ieee754_hypot(double x, double y)
25 {
26 double a=x,b=y,t1,t2,y1,y2,w;
27 int j,k,ha,hb;
28 do { ieee_double_shape_type gh_u; gh_u.value = (x); (ha) = gh_u.parts.msw; } while (0);;
29 if(hb > ha) {a=y;b=x;j=ha; ha=hb;hb=j;} else {a=x;b=y;}
30 if(ha > 0x5f300000) {
31 do { ieee_double_shape_type sh_u; sh_u.value = (a); sh_u.parts.msw = (ha); (a) = sh_u.value; } while (0);;
32 }
33 w = a-b;
34 if (w <= b)
35 {
36 t2 = a - t1;
37 w = t1*y1-(w*(-w)-(t1*y2+t2*b));
38 }
39 if(k!=0) {
40 } else return w;
41 }
42