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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [sse3-lddqu.c] - Blame information for rev 724

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do run } */
2
/* { dg-require-effective-target sse3 } */
3
/* { dg-options "-O2 -msse3 -mfpmath=sse" } */
4
 
5
#ifndef CHECK_H
6
#define CHECK_H "sse3-check.h"
7
#endif
8
 
9
#ifndef TEST
10
#define TEST sse3_test
11
#endif
12
 
13
#include CHECK_H
14
#include <pmmintrin.h>
15
 
16
static void
17
sse3_test_lddqu (double *i1, double *r)
18
{
19
  __m128i t1 = _mm_lddqu_si128 ((__m128i *) i1);
20
 
21
  _mm_storeu_si128 ((__m128i *) r, t1);
22
}
23
 
24
static int
25
chk_pd (double *v1, double *v2)
26
{
27
  int i;
28
  int n_fails = 0;
29
 
30
  for (i = 0; i < 2; i++)
31
    if (v1[i] != v2[i])
32
      n_fails += 1;
33
 
34
  return n_fails;
35
}
36
 
37
static double p1[2];
38
static double p2[2];
39
static double ck[2];
40
 
41
static double vals[80] =
42
  {
43
    100.0,  200.0, 300.0, 400.0, 5.0, -1.0, .345, -21.5,
44
    1100.0, 0.235, 321.3, 53.40, 0.3, 10.0, 42.0, 32.52,
45
    32.6,   123.3, 1.234, 2.156, 0.1, 3.25, 4.75, 32.44,
46
    12.16,  52.34, 64.12, 71.13, -.1, 2.30, 5.12, 3.785,
47
    541.3,  321.4, 231.4, 531.4, 71., 321., 231., -531.,
48
    23.45,  23.45, 23.45, 23.45, 23.45, 23.45, 23.45, 23.45,
49
    23.45,  -1.43, -6.74, 6.345, -20.1, -20.1, -40.1, -40.1,
50
    1.234,  2.345, 3.456, 4.567, 5.678, 6.789, 7.891, 8.912,
51
    -9.32,  -8.41, -7.50, -6.59, -5.68, -4.77, -3.86, -2.95,
52
    9.32,  8.41, 7.50, 6.59, -5.68, -4.77, -3.86, -2.95
53
  };
54
 
55
static void
56
TEST (void)
57
{
58
  int i;
59
  int fail = 0;
60
 
61
  for (i = 0; i < 80; i += 2)
62
    {
63
      p1[0] = vals[i+0];
64
      p1[1] = vals[i+1];
65
 
66
      sse3_test_lddqu (p1, p2);
67
 
68
      ck[0] = p1[0];
69
      ck[1] = p1[1];
70
 
71
      fail += chk_pd (ck, p2);
72
    }
73
 
74
  if (fail != 0)
75
    abort ();
76
}

powered by: WebSVN 2.1.0

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