Use conditional internal functions in if-conversion
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr64019.c
blobd90c4800a1e35587b5da8ea6bf00e977541f2720
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* { dg-require-effective-target powerpc_vsx_ok } */
4 /* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
5 /* { dg-options "-O2 -ffast-math -mcpu=power7" } */
7 #include <math.h>
9 typedef struct
11 double x, y, z;
12 double q, a, b, mass;
13 double vx, vy, vz, vw, dx, dy, dz;
15 ATOM;
16 int
17 u_f_nonbon (lambda)
18 double lambda;
20 double r, r0, xt, yt, zt;
21 double lcutoff, cutoff, get_f_variable ();
22 double rdebye;
23 int inbond, inangle, i;
24 ATOM *a1, *a2, *bonded[10], *angled[10];
25 ATOM *(*use)[];
26 int uselist (), nuse, used;
27 ATOM *cp, *bp;
28 int a_number (), inbuffer;
29 double (*buffer)[], xx, yy, zz, k;
30 int invector, atomsused, ii, jj, imax;
31 double (*vector)[];
32 ATOM *(*atms)[];
33 double dielectric;
34 rdebye = cutoff / 2.;
35 dielectric = get_f_variable ("dielec");
36 imax = a_number ();
37 for (jj = 1; jj < imax; jj++, a1 = bp)
39 if ((*use)[used] == a1)
41 used += 1;
43 while ((*use)[used] != a1)
45 for (i = 0; i < inbuffer; i++)
48 xx = a1->x + lambda * a1->dx;
49 yy = a1->y + lambda * a1->dy;
50 zz = a1->z + lambda * a1->dz;
51 for (i = 0; i < inbuffer; i++)
53 xt = xx - (*buffer)[3 * i];
54 yt = yy - (*buffer)[3 * i + 1];
55 zt = zz - (*buffer)[3 * i + 2];
56 r = xt * xt + yt * yt + zt * zt;
57 r0 = sqrt (r);
58 xt = xt / r0;
59 zt = zt / r0;
60 k =
61 -a1->q * (*atms)[i]->q * dielectric * exp (-r0 / rdebye) *
62 (1. / (rdebye * r0) + 1. / r);
63 k += a1->a * (*atms)[i]->a / r / r0 * 6;
64 k -= a1->b * (*atms)[i]->b / r / r / r0 * 12;
65 (*vector)[3 * i] = xt * k;
66 (*vector)[3 * i + 1] = yt * k;
67 (*vector)[3 * i + 2] = zt * k;