summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/sse5-pcmov2.c
blob: 6b174d66631bfa7fc27517c8a8cb164f0896769b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* Test that the compiler properly optimizes conditional floating point moves
   into the pcmov instruction on SSE5 systems.  */

/* { dg-do compile } */
/* { dg-require-effective-target lp64 } */
/* { dg-options "-O2 -msse5" } */

extern void exit (int);

float flt_test (float a, float b, float c, float d)
{
  return (a > b) ? c : d;
}

float flt_a = 1, flt_b = 2, flt_c = 3, flt_d = 4, flt_e;

int main()
{
  flt_e = flt_test (flt_a, flt_b, flt_c, flt_d);
  exit (0);
}

/* { dg-final { scan-assembler "pcmov" } } */