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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [powerpc/] [altivec-cell-4.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 691 jeremybenn
/* { dg-do run { target { powerpc*-*-* && vmx_hw } } } */
2
/* { dg-do compile { target { powerpc*-*-* && { ! vmx_hw } } } } */
3
/* { dg-require-effective-target powerpc_altivec_ok } */
4
/* { dg-options "-maltivec" } */
5
 
6
/* Test the vec_splats and vec_promote VMX intrinsics.  */
7
#include <altivec.h>
8
 
9
extern void abort (void);
10
 
11
vector int a[] = {{0, 0, 0, 0}, {1,0,0,0}, {1,2,0,0},{1,2,3,0},{1,2,3,4},{5,2,3,4},{5,6,3,4}};
12
vector int c = {0,6,3,4};
13
vector int d = {0,0,3,4};
14
int main1(int t) __attribute__((noinline));
15
int main1(int t)
16
{
17
  int i;
18
  vector int b = vec_splats(0);
19
  for(i = 0;i<sizeof(a)/sizeof(a[0])-1;i++)
20
    {
21
        if (__builtin_memcmp (&b, &a[i], sizeof(vector int)))
22
          abort ();
23
        b = vec_insert(i+1, b, i);
24
    }
25
  if (__builtin_memcmp (&b, &a[i], sizeof(vector int)))
26
    abort ();
27
 
28
  b = vec_insert(0, b, 0);
29
  if (__builtin_memcmp (&b, &c, sizeof(vector int)))
30
    abort ();
31
 
32
  b = vec_insert(0, b, 1);
33
  if (__builtin_memcmp (&b, &d, sizeof(vector int)))
34
    abort ();
35
 
36
  return 0;
37
}
38
 
39
int main(void)
40
{
41
  return main1 (0);
42
}

powered by: WebSVN 2.1.0

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