summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/intrinsics_opt-2.c
blob: fb87be8cc16638c21582a0380c6534ae39410486 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do compile } */
/* { dg-options "-O -ffast-math -msse2 -fdump-tree-optimized" } */

#include <emmintrin.h>

int f(__m128d x){
  x = _mm_sub_pd (x, x);
  x = _mm_mul_pd (x, x);
  double r = 42;
  _mm_storeh_pd (&r, x);
  int z = r == 0;
  return __builtin_constant_p (z) && z;
}

/* { dg-final { scan-tree-dump "return 1;" "optimized" } } */