altivec.h (vec_dst, [...]): Add prototypes, marked with always_inline attribute.

[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.

From-SVN: r79726
This commit is contained in:
Ziemowit Laski 2004-03-20 02:56:54 +00:00 committed by Ziemowit Laski
parent 147d77b682
commit 86e7df90ac
5 changed files with 50 additions and 5 deletions

View File

@ -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

View File

@ -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));

View File

@ -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;
}

View File

@ -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.

View File

@ -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);
}