diff options
author | zlaski <zlaski@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-03-20 02:56:54 +0000 |
---|---|---|
committer | zlaski <zlaski@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-03-20 02:56:54 +0000 |
commit | cce398ee7a028ad9d288932937515a8e744c87c0 (patch) | |
tree | 34ee714cd7b95eb1b7846350f8737c44b868ef8b /gcc | |
parent | d0764c9e02e4da05b7b7877e0279fdba92ae2438 (diff) | |
download | gcc-cce398ee7a028ad9d288932937515a8e744c87c0.tar.gz |
[gcc/ChangeLog]
2004-03-19 Ziemowit Laski <zlaski@apple.com>
* config/rs6000/altivec.h (vec_dst, vec_dstst, vec_dststt,
vec_dstt, vec_sld, vec_splat): Add prototypes, marked with
always_inline attribute.
* config/rs6000/rs6000.c (altivec_expand_dst_builtin):
Treat expansion as completed even if literal argument is
invalid (so that other expansions are not tried in vain).
[gcc/testsuite/ChangeLog]
2004-03-19 Ziemowit Laski <zlaski@apple.com>
* g++.dg/ext/altivec-6.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@79726 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/config/rs6000/altivec.h | 13 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/altivec-6.C | 27 |
5 files changed, 50 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3aa00184e4c..ebda5ec1c78 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2004-03-19 Ziemowit Laski <zlaski@apple.com> + + * config/rs6000/altivec.h (vec_dst, vec_dstst, vec_dststt, + vec_dstt, vec_sld, vec_splat): Add prototypes, marked with + always_inline attribute. + * config/rs6000/rs6000.c (altivec_expand_dst_builtin): + Treat expansion as completed even if literal argument is + invalid (so that other expansions are not tried in vain). + 2004-03-19 Kazu Hirata <kazu@cs.umass.edu> * loop-doloop.c (add_test): Replace GEN_INT (0) with diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h index 2ae567ef3d4..632f03930ff 100644 --- a/gcc/config/rs6000/altivec.h +++ b/gcc/config/rs6000/altivec.h @@ -117,7 +117,7 @@ inline void vec_dst (const vector unsigned int *, int, const int) __attribute__ inline void vec_dst (const vector signed int *, int, const int) __attribute__ ((always_inline)); inline void vec_dst (const vector bool int *, int, const int) __attribute__ ((always_inline)); inline void vec_dst (const vector float *, int, const int) __attribute__ ((always_inline)); -inline void vec_dst (const int *, int, const int) __attribute__ ((always_inline)); +inline void vec_dst (const unsigned char *, int, const int) __attribute__ ((always_inline)); inline void vec_dst (const signed char *, int, const int) __attribute__ ((always_inline)); inline void vec_dst (const unsigned short *, int, const int) __attribute__ ((always_inline)); inline void vec_dst (const short *, int, const int) __attribute__ ((always_inline)); @@ -138,7 +138,7 @@ inline void vec_dstst (const vector unsigned int *, int, const int) __attribute_ inline void vec_dstst (const vector signed int *, int, const int) __attribute__ ((always_inline)); inline void vec_dstst (const vector bool int *, int, const int) __attribute__ ((always_inline)); inline void vec_dstst (const vector float *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstst (const int *, int, const int) __attribute__ ((always_inline)); +inline void vec_dstst (const unsigned char *, int, const int) __attribute__ ((always_inline)); inline void vec_dstst (const signed char *, int, const int) __attribute__ ((always_inline)); inline void vec_dstst (const unsigned short *, int, const int) __attribute__ ((always_inline)); inline void vec_dstst (const short *, int, const int) __attribute__ ((always_inline)); @@ -159,7 +159,7 @@ inline void vec_dststt (const vector unsigned int *, int, const int) __attribute inline void vec_dststt (const vector signed int *, int, const int) __attribute__ ((always_inline)); inline void vec_dststt (const vector bool int *, int, const int) __attribute__ ((always_inline)); inline void vec_dststt (const vector float *, int, const int) __attribute__ ((always_inline)); -inline void vec_dststt (const int *, int, const int) __attribute__ ((always_inline)); +inline void vec_dststt (const unsigned char *, int, const int) __attribute__ ((always_inline)); inline void vec_dststt (const signed char *, int, const int) __attribute__ ((always_inline)); inline void vec_dststt (const unsigned short *, int, const int) __attribute__ ((always_inline)); inline void vec_dststt (const short *, int, const int) __attribute__ ((always_inline)); @@ -180,7 +180,7 @@ inline void vec_dstt (const vector unsigned int *, int, const int) __attribute__ inline void vec_dstt (const vector signed int *, int, const int) __attribute__ ((always_inline)); inline void vec_dstt (const vector bool int *, int, const int) __attribute__ ((always_inline)); inline void vec_dstt (const vector float *, int, const int) __attribute__ ((always_inline)); -inline void vec_dstt (const int *, int, const int) __attribute__ ((always_inline)); +inline void vec_dstt (const unsigned char *, int, const int) __attribute__ ((always_inline)); inline void vec_dstt (const signed char *, int, const int) __attribute__ ((always_inline)); inline void vec_dstt (const unsigned short *, int, const int) __attribute__ ((always_inline)); inline void vec_dstt (const short *, int, const int) __attribute__ ((always_inline)); @@ -195,15 +195,20 @@ inline vector signed int vec_sld (vector signed int, vector signed int, const in inline vector unsigned int vec_sld (vector unsigned int, vector unsigned int, const int) __attribute__ ((always_inline)); inline vector signed short vec_sld (vector signed short, vector signed short, const int) __attribute__ ((always_inline)); inline vector unsigned short vec_sld (vector unsigned short, vector unsigned short, const int) __attribute__ ((always_inline)); +inline vector pixel vec_sld (vector pixel, vector pixel, const int) __attribute__ ((always_inline)); inline vector signed char vec_sld (vector signed char, vector signed char, const int) __attribute__ ((always_inline)); inline vector unsigned char vec_sld (vector unsigned char, vector unsigned char, const int) __attribute__ ((always_inline)); inline vector signed char vec_splat (vector signed char, const int) __attribute__ ((always_inline)); inline vector unsigned char vec_splat (vector unsigned char, const int) __attribute__ ((always_inline)); +inline vector bool char vec_splat (vector bool char, const int) __attribute__ ((always_inline)); inline vector signed short vec_splat (vector signed short, const int) __attribute__ ((always_inline)); inline vector unsigned short vec_splat (vector unsigned short, const int) __attribute__ ((always_inline)); +inline vector bool short vec_splat (vector bool short, const int) __attribute__ ((always_inline)); +inline vector pixel vec_splat (vector pixel, const int) __attribute__ ((always_inline)); inline vector float vec_splat (vector float, const int) __attribute__ ((always_inline)); inline vector signed int vec_splat (vector signed int, const int) __attribute__ ((always_inline)); inline vector unsigned int vec_splat (vector unsigned int, const int) __attribute__ ((always_inline)); +inline vector bool int vec_splat (vector bool int, const int) __attribute__ ((always_inline)); inline vector signed char vec_splat_s8 (const int) __attribute__ ((always_inline)); inline vector signed short vec_splat_s16 (const int) __attribute__ ((always_inline)); inline vector signed int vec_splat_s32 (const int) __attribute__ ((always_inline)); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index f431108cfc7..e046aa4dd07 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -6004,6 +6004,7 @@ altivec_expand_dst_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, || arg2 == error_mark_node) return const0_rtx; + *expandedp = true; STRIP_NOPS (arg2); if (TREE_CODE (arg2) != INTEGER_CST || TREE_INT_CST_LOW (arg2) & ~0x3) @@ -6021,7 +6022,6 @@ altivec_expand_dst_builtin (tree exp, rtx target ATTRIBUTE_UNUSED, if (pat != 0) emit_insn (pat); - *expandedp = true; return NULL_RTX; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 213613e51f0..155127db2ef 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2004-03-19 Ziemowit Laski <zlaski@apple.com> + + * g++.dg/ext/altivec-6.C: New test. + 2004-03-19 Mark Mitchell <mark@codesourcery.com> * g++.dg/init/placement3.C: New test. diff --git a/gcc/testsuite/g++.dg/ext/altivec-6.C b/gcc/testsuite/g++.dg/ext/altivec-6.C new file mode 100644 index 00000000000..611047ed528 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/altivec-6.C @@ -0,0 +1,27 @@ +/* Test for correct handling of literal arguments. */ +/* Author: Ziemowit Laski <zlaski@apple.com> */ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-options "-maltivec" } */ + +#include <altivec.h> + +void foo(void) { + const unsigned char *buf; + vector pixel vp = { 3, 4, 5, 6 }; + vector bool int vbi = { 1, 0, 1, 0 }; + vector bool short vbs = { 1, 0, 1, 0, 1, 0, 1, 0 }; + vector bool char vbc = { 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0 }; + vector signed char vsc; + int a = 3; + + vec_dst(buf, a, 1); + vec_dstst(buf, a, 2); + vec_dststt(buf, a, 3); + vec_dststt(buf, a, 2); + + vp = vec_sld(vp, vp, 5); + vbc = vec_splat(vbc, 7); + vbs = vec_splat(vbs, 12); + vp = vec_splat(vp, 17); + vbi = vec_splat(vbi, 31); +} |