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/] [vperm-v4sf-1.c] - Blame information for rev 327

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

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-O -msse" } */
3
/* { dg-require-effective-target sse } */
4
/* { dg-require-effective-target sse_runtime } */
5
 
6
#include "isa-check.h"
7
 
8
typedef float S;
9
typedef float V __attribute__((vector_size(16)));
10
typedef int IV __attribute__((vector_size(16)));
11
typedef union { S s[4]; V v; } U;
12
 
13
static U i[2], b, c;
14
 
15
extern int memcmp (const void *, const void *, __SIZE_TYPE__);
16
#define assert(T) ((T) || (__builtin_trap (), 0))
17
 
18
#define TEST(E0, E1, E2, E3) \
19
  b.v = __builtin_ia32_vec_perm_v4sf (i[0].v, i[1].v, (IV){E0, E1, E2, E3}); \
20
  c.s[0] = i[0].s[E0]; \
21
  c.s[1] = i[0].s[E1]; \
22
  c.s[2] = i[0].s[E2]; \
23
  c.s[3] = i[0].s[E3]; \
24
  __asm__("" : : : "memory"); \
25
  assert (memcmp (&b, &c, sizeof(c)) == 0);
26
 
27
#include "vperm-4-1.inc"
28
 
29
int main()
30
{
31
  i[0].s[0] = 0;
32
  i[0].s[1] = 1;
33
  i[0].s[2] = 2;
34
  i[0].s[3] = 3;
35
  i[0].s[4] = 4;
36
  i[0].s[5] = 5;
37
  i[0].s[6] = 6;
38
  i[0].s[7] = 7;
39
 
40
  check();
41
  return 0;
42
}

powered by: WebSVN 2.1.0

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