This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

test case for 'i386 floating point conditional move patch'


John Wehle and I were having a discussion.

> There were two decisions that were yours.  You just made the second.
> The remaining one is to decide if you want it in the suite or not.
> This probably pivots on whether you think this is a problem likely
> to ever be seen again or if you think this is just noise in you
> reenabling the cmov stuff.

I think it was always broken and I wouldn't be suprised if it gets
broken again considering the number of problems that there have been
with the conditional move patterns on the i386.  Thus:

  1) Yes, please add it to the test suite.

  2) Place it in gcc.dg.

>> it will only run on a Pentium Pro or better when compiled in this fashion).
>
> Will only fail or will only run?  If you run the test on, say, a 486 but
> specify "-march-pentiumpro", would you expect the binary to fail in the
> predictable way, or are there other Pro-specific things that will send a
> Pre-P6 core down in flames?

The conditional move instructions which are used when compiled with -O
-march=pentiumpro are not implemented on earlier processors and will
probably cause the illegal instruction handler to be invoked.  Ideally
this should result in a SIGILL signal on a well behaved system.

=-=-=-=-=-=-

In light of this, I've made the test run only when configured for a 686.
I've tested that it correctly won't try to execute on a "mere" P5 core. 

I've also tested that it fails to fail if you run the wrong runtest, but
that's a different story. :-)

Please consider the following test case addition.

$ cat 980604-1.c
/* { dg-do run { target i686-*-* } } */
/* { dg-options "-O -march=pentiumpro" } */

int a = 1;
int b = -1;

int c = 1;
int d = 0;

int  main ()
{
       double e;
       double f;
       double g;

       f = c;
       g = d;
       e = (a < b) ? f : g;

       if ( e == 1.0)
            abort();
       exit(0);
}



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]