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/] [powerpc/] [altivec-24.c] - Blame information for rev 327

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

Line No. Rev Author Line
1 322 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
#include <altivec.h>
7
 
8
extern void abort (void);
9
 
10
typedef int v4si __attribute__ ((vector_size (16)));
11
 
12
#define MAGIC_NUMBER 12345
13
 
14
v4si my_vect;
15
int my_array[4] __attribute__ ((aligned (16)));
16
 
17
void initialize (int a)
18
{
19
  my_vect = (v4si) {0, a, 2, 3};
20
  vec_st (my_vect, 0, my_array);
21
}
22
 
23
int verify (void)
24
{
25
  if (my_array[1] != MAGIC_NUMBER)
26
    abort ();
27
}
28
 
29
int main (void)
30
{
31
  initialize (MAGIC_NUMBER);
32
  verify ();
33
  return 0;
34
}
35
 

powered by: WebSVN 2.1.0

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