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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.1/] [gdb/] [testsuite/] [gdb.arch/] [e500-abi.c] - Blame information for rev 387

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

Line No. Rev Author Line
1 227 jeremybenn
#include <spe.h>
2
 
3
/* Test PowerPC SPU extensions.  */
4
 
5
#define vector __attribute__((vector_size(8)))
6
 
7
vector unsigned short f_vec;
8
vector short g_vec;
9
vector float h_vec;
10
vector float i_vec;
11
vector unsigned int l_vec;
12
vector int m_vec;
13
vector int n_vec;
14
 
15
/* dummy variables used in the testfile */
16
vector unsigned int a_vec_d = {1, 1};
17
vector int b_vec_d = {0, 0};
18
vector float c_vec_d = {1.0, 1.0};
19
vector unsigned int d_vec_d = {0, 0};
20
vector int e_vec_d = {1, 1};
21
vector unsigned short f_vec_d = {1, 1, 1, 1};
22
vector short g_vec_d = {1, 1, 1, 1};
23
vector float h_vec_d = {1.0, 1.0};
24
vector float i_vec_d = {2.0, 2.0};
25
vector unsigned int l_vec_d = {0, 0};
26
vector int m_vec_d = {0, 0};
27
 
28
 
29
vector int
30
vec_func (vector unsigned int a_vec_f,
31
          vector int b_vec_f,
32
          vector float c_vec_f,
33
          vector unsigned int d_vec_f,
34
          vector int e_vec_f,
35
          vector unsigned short f_vec_f,
36
          vector short g_vec_f,
37
          vector float h_vec_f,
38
          vector float i_vec_f,
39
          vector unsigned int l_vec_f,
40
          vector int m_vec_f)
41
{
42
  vector int n_vec;
43
 
44
 
45
  int x,y,z;
46
  x = 2;
47
  y = 3;
48
 
49
  z = x + y;
50
  z++;
51
  n_vec = __ev_and(a_vec_f, b_vec_f);
52
  n_vec = __ev_or(c_vec_f, d_vec_f);
53
  n_vec = __ev_or(e_vec_f, f_vec_f);
54
  n_vec = __ev_and(g_vec_f, h_vec_f);
55
  n_vec = __ev_and(i_vec_f, l_vec_f);
56
  n_vec = __ev_or(m_vec_f, a_vec_f);
57
 
58
  return n_vec;
59
}
60
 
61
void marker(void) {};
62
 
63
int
64
main (void)
65
{
66
  vector unsigned int a_vec;
67
  vector int b_vec;
68
  vector float c_vec;
69
  vector unsigned int d_vec;
70
  vector int e_vec;
71
 
72
  vector int res_vec;
73
 
74
  a_vec = (vector unsigned int)__ev_create_u64 ((uint64_t) 55);
75
  b_vec = __ev_create_s64 ((int64_t) 66);
76
  c_vec = (vector float) __ev_create_fs (3.14F, 2.18F);
77
  d_vec = (vector unsigned int) __ev_create_u32 ((uint32_t) 5, (uint32_t) 4);
78
  e_vec = (vector int) __ev_create_s32 ((int32_t) 5, (int32_t) 6);
79
  f_vec = (vector unsigned short) __ev_create_u16 ((uint16_t) 6, (uint16_t) 6, (uint16_t) 7, (uint16_t) 1);
80
  g_vec = (vector short) __ev_create_s16 ((int16_t) 6, (int16_t) 6, (int16_t) 7, (int16_t) 9);
81
  h_vec = (vector float) __ev_create_sfix32_fs (3.0F, 2.0F);
82
  i_vec = (vector float) __ev_create_ufix32_fs (3.0F, 2.0F);
83
  l_vec = (vector unsigned int) __ev_create_ufix32_u32 (3U, 5U);
84
  m_vec = (vector int) __ev_create_sfix32_s32 (6, 9);
85
 
86
  marker ();
87
 
88
#if 0
89
/* This line is useful for cut-n-paste from a gdb session. */
90
vec_func(a_vec,b_vec,c_vec,d_vec,e_vec,f_vec,g_vec,h_vec,i_vec,l_vec,m_vec)
91
#endif
92
 
93
  res_vec = vec_func (a_vec,  /* goes in r3 */
94
                      b_vec,  /* goes in r4 */
95
                      c_vec,  /* goes in r5 */
96
                      d_vec,  /* goes in r6 */
97
                      e_vec,  /* goes in r7 */
98
                      f_vec,  /* goes in r8 */
99
                      g_vec,  /* goes in r9 */
100
                      h_vec,  /* goes in r10 */
101
                      i_vec,  /* goes in stack */
102
                      l_vec,  /* goes in stack */
103
                      m_vec);  /* goes in stack */
104
 
105
  return 0;
106
}

powered by: WebSVN 2.1.0

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