Add translations for various sub-directories
[binutils-gdb.git] / gdb / testsuite / gdb.arch / altivec-regs.c
bloba838b28b9b51f8905eff14f01a3c3d8500a981c0
1 #include <altivec.h>
2 #include <stdio.h>
4 vector unsigned int
5 vector_fun (volatile vector unsigned int a, volatile vector unsigned int b)
7 vector unsigned int c;
8 a = ((vector unsigned int) vec_splat_u8(2));
9 b = ((vector unsigned int) vec_splat_u8(3));
11 c = vec_add (a, b);
12 return c;
15 int
16 main ()
18 vector unsigned int y;
19 vector unsigned int x;
20 vector unsigned int z;
21 int a = 0;
23 #ifdef _AIX
24 /* On AIX, the debugger cannot access vector registers before they
25 are first used by the inferior. Perform such an access here. */
26 x = ((vector unsigned int) vec_splat_u8 (0));
27 #endif
29 /* This line may look unnecessary but we do need it, because we want to
30 have a line to do a next over (so that gdb refetches the registers)
31 and we don't want the code to change any vector registers.
32 The splat operations below modify the VRs,i
33 so we don't want to execute them yet. */
34 a = 9; /* start here */
35 x = ((vector unsigned int) vec_splat_u8 (-2));
36 y = ((vector unsigned int) vec_splat_u8 (1));
38 z = vector_fun (x, y);
39 x = vec_sld (x,y,2);
41 x = vec_add (x, ((vector unsigned int){5,6,7,8}));
42 z = (vector unsigned int) vec_splat_u8 ( -2);
43 y = vec_add (x, z);
44 z = (vector unsigned int) vec_cmpeq (x,y);
46 return 0;