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/] [sse2-shufps-1.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-options "-O2 -msse2" } */
3
/* { dg-require-effective-target sse2 } */
4
 
5
#ifndef CHECK_H
6
#define CHECK_H "sse2-check.h"
7
#endif
8
 
9
#ifndef TEST
10
#define TEST sse2_test
11
#endif
12
 
13
#define MASK 0xab
14
 
15
#include CHECK_H
16
 
17
#include <emmintrin.h>
18
 
19
float select4(const float *src, unsigned int control)
20
{
21
    switch(control) {
22
    case 0:
23
        return src[0];
24
    case 1:
25
        return src[1];
26
    case 2:
27
        return src[2];
28
    case 3:
29
        return src[3];
30
    }
31
    return -1;
32
}
33
 
34
static __m128
35
__attribute__((noinline, unused))
36
test (__m128 s1, __m128 s2)
37
{
38
  return _mm_shuffle_ps (s1, s2, MASK);
39
}
40
 
41
static void
42
TEST (void)
43
{
44
  union128 u, s1, s2;
45
  float e[4] = {0.0};
46
 
47
  s1.x = _mm_set_ps (1.1, 1.2, 1.3, 1.4);
48
  s2.x = _mm_set_ps (2.1, 2.2, 2.3, 2.4);
49
  u.x = test (s1.x, s2.x);
50
 
51
  e[0] = select4(s1.a,   (MASK >> 0) & 0x3);
52
  e[1] = select4(s1.a,   (MASK >> 2) & 0x3);
53
  e[2] = select4(s2.a,   (MASK >> 4) & 0x3);
54
  e[3] = select4(s2.a,   (MASK >> 6) & 0x3);
55
 
56
  if (check_union128(u, e))
57
    abort ();
58
}

powered by: WebSVN 2.1.0

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