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-insvdi.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 lp64 } */
3
/* { dg-require-effective-target sse4 } */
4
/* { dg-options "-O2 -msse4.1" } */
5
 
6
#ifndef CHECK_H
7
#define CHECK_H "sse4_1-check.h"
8
#endif
9
 
10
#ifndef TEST
11
#define TEST sse4_1_test
12
#endif
13
 
14
#include CHECK_H
15
 
16
#include <smmintrin.h>
17
#include <string.h>
18
 
19
typedef long T __attribute__((may_alias));
20
struct S { __m128i d; };
21
 
22
__m128i
23
__attribute__((noinline))
24
foo (__m128i y, long x)
25
{
26
  struct S s;
27
 
28
  s.d = y;
29
  ((T *) &s.d)[1] = x;
30
  return s.d;
31
}
32
 
33
static void
34
TEST (void)
35
{
36
  union
37
    {
38
      __m128i x;
39
      unsigned int i[4];
40
      unsigned long l[2];
41
    } res, val, tmp;
42
  unsigned long ins[4] = { 3, 4, 5, 6 };
43
 
44
  val.i[0] = 0x35251505;
45
  val.i[1] = 0x75655545;
46
  val.i[2] = 0xB5A59585;
47
  val.i[3] = 0xF5E5D5C5;
48
 
49
  res.x = foo (val.x, ins[3]);
50
 
51
  tmp.x = val.x;
52
  tmp.l[1] = ins[3];
53
  if (memcmp (&tmp, &res, sizeof (tmp)))
54
    abort ();
55
}

powered by: WebSVN 2.1.0

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