From: Dorit Naishlos Date: Mon, 20 Sep 2004 16:26:24 +0000 (+0000) Subject: vect-74.c: Avoid floating point precision error in comparison. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1cdcb2cfd16e771b7a5a452099a4b5a933083351;p=gcc.git vect-74.c: Avoid floating point precision error in comparison. * gcc.dg/vect/vect-74.c: Avoid floating point precision error in comparison. * gcc.dg/vect/vect-79.c: Likewise. * gcc.dg/vect/vect-80.c: Likewise. From-SVN: r87762 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8a2968859a5..3414502a11f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2004-09-20 Dorit Naishlos + + * gcc.dg/vect/vect-74.c: Avoid floating point precision error + in comparison. + * gcc.dg/vect/vect-79.c: Likewise. + * gcc.dg/vect/vect-80.c: Likewise. + 2004-09-20 Tobias Schlueter PR fortran/15750 diff --git a/gcc/testsuite/gcc.dg/vect/vect-74.c b/gcc/testsuite/gcc.dg/vect/vect-74.c index 66619dc82e6..a8b950f39cf 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-74.c +++ b/gcc/testsuite/gcc.dg/vect/vect-74.c @@ -11,8 +11,8 @@ typedef float afloat __attribute__ ((__aligned__(16))); afloat a[N]; -afloat b[N+4] = {0.2, 1.3, 2.3, 3.4, 4.5, 5.6, 7.8, 9.0, 10.11, 11.12, 12.13, 13.14, 14.15, 15.16, 16.17, 17.18, 18.19, 19.20}; -afloat c[N] = {0.2, 1.3, 2.3, 3.4, 4.5, 5.6, 7.8, 9.0, 10.11, 11.12, 12.13, 13.14, 14.15, 15.16}; +afloat b[N+4] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 7.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0}; +afloat c[N] = {0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5}; int main1 (afloat *__restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ pc) diff --git a/gcc/testsuite/gcc.dg/vect/vect-79.c b/gcc/testsuite/gcc.dg/vect/vect-79.c index 639172425d4..a05642d5451 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-79.c +++ b/gcc/testsuite/gcc.dg/vect/vect-79.c @@ -11,12 +11,12 @@ typedef float afloat __attribute__ ((__aligned__(16))); afloat a[N]; -afloat b[N+4] = {0.2, 1.3, 2.3, 3.4, 4.5, 5.6, 7.8, 9.0, 10.11, 11.12, 12.13, 13.14, 14.15, 15.16, 16.17, 17.18, 18.19, 19.20}; -afloat c[N] = {0.2, 1.3, 2.3, 3.4, 4.5, 5.6, 7.8, 9.0, 10.11, 11.12, 12.13, 13.14, 14.15, 15.16}; +afloat b[N+4] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 7.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0}; +afloat c[N] = {0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5}; /* Not vectorizable. Alias. */ int -main2 (afloat *pa, afloat *pb, afloat *pc) +main1 (afloat *pa, afloat *pb, afloat *pc) { int i; afloat *q = pb + 4; @@ -40,7 +40,7 @@ int main (void) { check_vect (); - main2 (a, b, c); + main1 (a, b, c); return 0; } diff --git a/gcc/testsuite/gcc.dg/vect/vect-80.c b/gcc/testsuite/gcc.dg/vect/vect-80.c index b1be712c926..cc0b9ec5352 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-80.c +++ b/gcc/testsuite/gcc.dg/vect/vect-80.c @@ -10,17 +10,16 @@ typedef float afloat __attribute__ ((__aligned__(16))); -float fa[N]; -float fb[N+4] = {0.2, 1.3, 2.3, 3.4, 4.5, 5.6, 7.8, 9.0, 10.11, 11.12, 12.13, 13.14, 14.15, 15.16, -16.17, 17.18, 18.19, 19.20}; -float fc[N] = {0.2, 1.3, 2.3, 3.4, 4.5, 5.6, 7.8, 9.0, 10.11, 11.12, 12.13, 13.14, 14.15, 15.16}; +afloat fa[N]; +afloat fb[N+4] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 7.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0}; +afloat fc[N] = {0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5}; /* Not vectorizable: not aligned pointers. */ int -main3 (float * __restrict__ pa, float * __restrict__ pb, float *__restrict__ pc) +main1 (float * __restrict__ pa, float * __restrict__ pb, float *__restrict__ pc) { int i; - afloat *q = pb + 4; + float *q = pb + 4; for (i = 0; i < N; i++) { @@ -41,7 +40,7 @@ int main (void) { check_vect (); - main3 (fa, fb, fc); + main1 (fa, fb, fc); return 0; }