summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/pr54400.c
blob: 5ed5ba066444475bcafa04d5354d3f50b125ca6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* { dg-do compile } */
/* { dg-options "-O2 -msse3 -mfpmath=sse" } */

#include <x86intrin.h>

double f (__m128d p)
{
  return p[0] - p[1];
}

double g1 (__m128d p)
{
  return p[0] + p[1];
}

double g2 (__m128d p)
{
  return p[1] + p[0];
}

__m128d h (__m128d p, __m128d q)
{
  __m128d r = { p[0] - p[1], q[0] - q[1] };
  return r;
}

__m128d i1 (__m128d p, __m128d q)
{
  __m128d r = { p[0] + p[1], q[0] + q[1] };
  return r;
}

__m128d i2 (__m128d p, __m128d q)
{
  __m128d r = { p[0] + p[1], q[1] + q[0] };
  return r;
}

__m128d i3 (__m128d p, __m128d q)
{
  __m128d r = { p[1] + p[0], q[0] + q[1] };
  return r;
}

__m128d i4 (__m128d p, __m128d q)
{
  __m128d r = { p[1] + p[0], q[1] + q[0] };
  return r;
}

/* { dg-final { scan-assembler-times "hsubpd" 2 } } */
/* { dg-final { scan-assembler-times "haddpd" 6 } } */
/* { dg-final { scan-assembler-not "unpck" } } */