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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.target/] [powerpc/] [altivec-7.c] - Blame information for rev 867

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

Line No. Rev Author Line
1 149 jeremybenn
/* Origin: Aldy Hernandez  <aldyh@redhat.com>  */
2
 
3
/* { dg-do compile { target powerpc*-*-* } } */
4
/* { dg-require-effective-target powerpc_altivec_ok } */
5
/* { dg-options "-maltivec" } */
6
 
7
#include <altivec.h>
8
 
9
int **intp;
10
int *var_int;
11
unsigned int **uintp;
12
vector pixel *varpixel;
13
vector signed char *vecchar;
14
vector signed int *vecint;
15
vector signed short *vecshort;
16
vector unsigned char *vecuchar;
17
vector unsigned int *vecuint;
18
vector unsigned short *vecushort;
19
vector float *vecfloat;
20
 
21
int main ()
22
{
23
  *vecfloat++ = vec_andc((vector bool int)vecint[0], vecfloat[1]);
24
  *vecfloat++ = vec_andc(vecfloat[0], (vector bool int)vecint[1]);
25
  *vecfloat++ = vec_vxor((vector bool int)vecint[0], vecfloat[1]);
26
  *vecfloat++ = vec_vxor(vecfloat[0], (vector bool int)vecint[1]);
27
  *varpixel++ = vec_packpx(vecuint[0], vecuint[1]);
28
  *varpixel++ = vec_vpkpx(vecuint[0], vecuint[1]);
29
  *vecshort++ = vec_vmulosb(vecchar[0], vecchar[1]);
30
  *vecint++ = vec_ld(var_int[0], intp[1]);
31
  *vecint++ = vec_lde(var_int[0], intp[1]);
32
  *vecint++ = vec_ldl(var_int[0], intp[1]);
33
  *vecint++ = vec_lvewx(var_int[0], intp[1]);
34
  *vecint++ = vec_unpackh(vecshort[0]);
35
  *vecint++ = vec_unpackl(vecshort[0]);
36
  *vecushort++ = vec_andc((vector bool short)vecshort[0], vecushort[1]);
37
  *vecushort++ = vec_andc(vecushort[0], (vector bool short)vecshort[1]);
38
  *vecushort++ = vec_vxor((vector bool short)vecshort[0], vecushort[1]);
39
  *vecushort++ = vec_vxor(vecushort[0], (vector bool short)vecshort[1]);
40
  *vecuint++ = vec_ld(var_int[0], uintp[1]);
41
  *vecuint++ = vec_lvx(var_int[0], uintp[1]);
42
  *vecuint++ = vec_vmsumubm(vecuchar[0], vecuchar[1], vecuint[2]);
43
  *vecuchar++ = vec_xor(vecuchar[0], (vector unsigned char)vecchar[1]);
44
 
45
  return 0;
46
}

powered by: WebSVN 2.1.0

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