summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.arch/e500-regs.c
blob: bae5f3955b4e8c251e48fd86002a6743bd6357f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <spe.h>
#include <stdio.h>

#define vector __attribute__((vector_size(8)))


vector int
vector_fun (vector int a, vector int b)
{
  vector int c;
  a = (vector int) __ev_create_s32 (2, 2);
  b = (vector int) __ev_create_s32 (3, 3);

  c = __ev_and (a, b);
  return c;
}
 
int
main ()
{
  vector int y; 
  vector int x; 
  vector int z; 
  int a;

  /* This line may look unnecessary but we do need it, because we want to
     have a line to do a next over (so that gdb refetches the registers)
     and we don't want the code to change any vector registers.
     The splat operations below modify the VRs,
     so we don't want to execute them yet.  */
  a = 9;
  x = (vector int) __ev_create_s32 (-2, -2);
  y = (vector int) __ev_create_s32 (1, 1);
	
  z = vector_fun (x, y);

  return 0;
}