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-insvsi.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
#include <string.h>
17
 
18
typedef int T __attribute__((may_alias));
19
struct S { __m128i d; };
20
 
21
__m128i
22
__attribute__((noinline))
23
foo (__m128i y, int x)
24
{
25
  struct S s;
26
 
27
  s.d = y;
28
  ((T *) &s.d)[1] = x;
29
  return s.d;
30
}
31
 
32
static void
33
TEST (void)
34
{
35
  union
36
    {
37
      __m128i x;
38
      unsigned int i[4];
39
    } res, val, tmp;
40
  unsigned int ins[4] = { 3, 4, 5, 6 };
41
 
42
  val.i[0] = 0x35251505;
43
  val.i[1] = 0x75655545;
44
  val.i[2] = 0xB5A59585;
45
  val.i[3] = 0xF5E5D5C5;
46
 
47
  res.x = foo (val.x, ins[3]);
48
 
49
  tmp.x = val.x;
50
  tmp.i[1] = ins[3];
51
  if (memcmp (&tmp, &res, sizeof (tmp)))
52
    abort ();
53
}

powered by: WebSVN 2.1.0

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