summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/intrinsics_opt-2.c
blob: 56be74b7e56ff190f89d76b93a36231805f3801f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* { 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" } } */
/* { dg-final { cleanup-tree-dump "optimized" } } */