OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [sse4_1-dppd-2.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do run } */
2
/* { dg-require-effective-target sse4 } */
3
/* { dg-options "-O2 -msse4.1" } */
4
 
5
#ifndef CHECK_H
6
#define CHECK_H "sse4_1-check.h"
7
#endif
8
 
9
#ifndef TEST
10
#define TEST sse4_1_test
11
#endif
12
 
13
#include CHECK_H
14
 
15
#include <smmintrin.h>
16
 
17
#include <string.h>
18
 
19
#define lmskN  0x00
20
#define lmsk0  0x01
21
#define lmsk1  0x02
22
#define lmsk01 0x03
23
 
24
#define hmskA  0x30
25
#define hmsk0  0x10
26
#define hmsk1  0x20
27
#define hmsk01 0x30
28
#define hmskN  0x00
29
 
30
#ifndef HIMASK
31
#define HIMASK hmskA
32
#endif
33
 
34
#ifndef LOMASK
35
#define LOMASK lmsk01
36
#endif
37
 
38
static void
39
TEST (void)
40
{
41
  union
42
    {
43
      __m128d x;
44
      double d[2];
45
    } val1[4], val2[4], res[4], chk[4];
46
  int i, j;
47
  double tmp;
48
 
49
  for (i = 0; i < 4; i++)
50
    {
51
      val1[i].d [0] = 2.;
52
      val1[i].d [1] = 3.;
53
 
54
      val2[i].d [0] = 10.;
55
      val2[i].d [1] = 100.;
56
 
57
      tmp = 0.;
58
      for (j = 0; j < 2; j++)
59
        if ((HIMASK & (0x10 << j)))
60
          tmp += val1[i].d [j] * val2[i].d [j];
61
 
62
      for (j = 0; j < 2; j++)
63
        if ((LOMASK & (1 << j)))
64
          chk[i].d[j] = tmp;
65
    }
66
 
67
  for (i = 0; i < 4; i++)
68
    {
69
      res[i].x = _mm_dp_pd (val1[i].x, val2[i].x, HIMASK | LOMASK);
70
      if (memcmp (&res[i], &chk[i], sizeof (chk[i])))
71
        abort ();
72
    }
73
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.