diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-05-14 22:02:52 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2002-05-14 22:02:52 +0000 |
commit | 57680a243bff8a2196f342acca83f00b1b7571e2 (patch) | |
tree | bfcabcdca3a706a141cca9dcca9d7e7a66781b2d /gdb/testsuite/gdb.arch/altivec-regs.c | |
parent | a86bc61c350fe9cd7f8c31d3807277a06a594a85 (diff) | |
download | binutils-gdb-57680a243bff8a2196f342acca83f00b1b7571e2.tar.gz |
2002-05-14 Elena Zannoni <ezannoni@redhat.com>
* gdb.arch/altivec-abi.c: New file.
* gdb.arch/altivec-abi.exp: New file.
* gdb.arch/altivec-regs.c: New file.
* gdb.arch/altivec-regs.exp: New file.
Diffstat (limited to 'gdb/testsuite/gdb.arch/altivec-regs.c')
-rw-r--r-- | gdb/testsuite/gdb.arch/altivec-regs.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.arch/altivec-regs.c b/gdb/testsuite/gdb.arch/altivec-regs.c new file mode 100644 index 00000000000..4d4fe3f5dbb --- /dev/null +++ b/gdb/testsuite/gdb.arch/altivec-regs.c @@ -0,0 +1,41 @@ +#include <altivec.h> +#include <stdio.h> + +vector unsigned int +vector_fun (vector unsigned int a, vector unsigned int b) +{ + vector unsigned int c; + a = ((vector unsigned int) vec_splat_u8(2)); + b = ((vector unsigned int) vec_splat_u8(3)); + + c = vec_add (a, b); + return c; +} + +int +main () +{ + vector unsigned int y; + vector unsigned int x; + vector unsigned 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,i + so we don't want to execute them yet. */ + a = 9; + x = ((vector unsigned int) vec_splat_u8 (-2)); + y = ((vector unsigned int) vec_splat_u8 (1)); + + z = vector_fun (x, y); + x = vec_sld (x,y,2); + + x = vec_add (x, ((vector unsigned int){5,6,7,8})); + z = (vector unsigned int) vec_splat_u8 ( -2); + y = vec_add (x, z); + z = (vector unsigned int) vec_cmpeq (x,y); + + return 0; +} |