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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [i386/] [sse4_1-pmuldq.c] - Blame information for rev 691

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 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
#define NUM 64
18
 
19
static void
20
TEST (void)
21
{
22
  union
23
    {
24
      __m128i x[NUM / 2];
25
      long long ll[NUM];
26
    } dst;
27
  union
28
    {
29
      __m128i x[NUM / 2];
30
      int i[NUM * 2];
31
    } src1, src2;
32
  int i, sign = 1;
33
  long long value;
34
 
35
  for (i = 0; i < NUM; i += 2)
36
    {
37
      src1.i[i] = i * i * sign;
38
      src2.i[i] = (i + 20) * sign;
39
      sign = -sign;
40
    }
41
 
42
  for (i = 0; i < NUM; i += 2)
43
    dst.x[i / 2] = _mm_mul_epi32 (src1.x[i / 2], src2.x[i / 2]);
44
 
45
  for (i = 0; i < NUM; i++)
46
    {
47
      value = (long long) src1.i[i * 2] * (long long) src2.i[i * 2];
48
      if (value != dst.ll[i])
49
        abort ();
50
    }
51
}

powered by: WebSVN 2.1.0

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