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-10.c] - Blame information for rev 154

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

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

powered by: WebSVN 2.1.0

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