OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.target/] [powerpc/] [altivec-10.c] - Blame information for rev 384

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 -mabi=altivec -fno-inline" } */
5
 
6
#include <altivec.h>
7
 
8
extern void exit (int);
9
extern void abort (void);
10
 
11
typedef union
12
{
13
  float         f[4];
14
  unsigned int  i[4];
15
  vector float  v;
16
} vec_float_t;
17
 
18
void
19
check_vec_all_num ()
20
{
21
  vec_float_t a, b, c;
22
 
23
  a.i[0] = 0xfffa5a5a;
24
  a.f[1] = 1.0;
25
  a.f[2] = 1.0;
26
  a.f[3] = 1.0;
27
 
28
  b.f[0] = 1.0;
29
  b.f[1] = 1.0;
30
  b.f[2] = 1.0;
31
  b.f[3] = 1.0;
32
 
33
  c.i[0] = 0xfffa5a5a;
34
  c.i[1] = 0xfffa5a5a;
35
  c.i[2] = 0xfffa5a5a;
36
  c.i[3] = 0xfffa5a5a;
37
 
38
  if (vec_all_numeric (a.v))
39
    abort ();
40
 
41
  if (vec_all_nan (a.v))
42
    abort ();
43
 
44
  if (!vec_all_numeric (b.v))
45
    abort ();
46
 
47
  if (vec_all_nan (b.v))
48
    abort ();
49
 
50
  if (vec_all_numeric (c.v))
51
    abort ();
52
 
53
  if (!vec_all_nan (c.v))
54
    abort ();
55
 
56
}
57
 
58
void
59
check_cmple()
60
{
61
  vector float a = {1.0, 2.0, 3.0, 4.0};
62
  vector float b = {1.0, 3.0, 2.0, 5.0};
63
  vector bool int aux;
64
  vector signed int le = {-1, -1, 0, -1};
65
 
66
  aux = vec_cmple (a, b);
67
 
68
  if (!vec_all_eq (aux, le))
69
    abort ();
70
}
71
 
72
 
73
int
74
main()
75
{
76
  check_cmple ();
77
  check_vec_all_num ();
78
  exit (0);
79
}

powered by: WebSVN 2.1.0

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