altivec.h (vec_sld): Add overloads for argument/return types of 'vector bool int'...
[gcc/ChangeLog] 2004-05-10 Ziemowit Laski <zlaski@apple.com> * config/rs6000/altivec.h (vec_sld): Add overloads for argument/return types of 'vector bool int', 'vector bool short' and 'vector bool char'. [gcc/testsuite/ChangeLog] 2004-05-10 Ziemowit Laski <zlaski@apple.com> * g++.dg/ext/altivec-8.C: New test case. * gcc.dg/altivec-13.c: New test case. From-SVN: r81681
This commit is contained in:
parent
3f68457e24
commit
16cfa3dc57
|
@ -1,3 +1,9 @@
|
|||
2004-05-10 Ziemowit Laski <zlaski@apple.com>
|
||||
|
||||
* config/rs6000/altivec.h (vec_sld): Add overloads for
|
||||
argument/return types of 'vector bool int', 'vector bool short'
|
||||
and 'vector bool char'.
|
||||
|
||||
2004-05-10 Zack Weinberg <zack@codesourcery.com>
|
||||
|
||||
* c-decl.c (store_parm_decls_newstyle): Correct test for a
|
||||
|
|
|
@ -200,11 +200,14 @@ inline void vec_dstt (const float *, int, const int) __attribute__ ((always_inli
|
|||
inline vector float vec_sld (vector float, vector float, const int) __attribute__ ((always_inline));
|
||||
inline vector signed int vec_sld (vector signed int, vector signed int, const int) __attribute__ ((always_inline));
|
||||
inline vector unsigned int vec_sld (vector unsigned int, vector unsigned int, const int) __attribute__ ((always_inline));
|
||||
inline vector bool int vec_sld (vector bool int, vector bool 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 bool short vec_sld (vector bool short, vector bool 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 bool char vec_sld (vector bool char, vector bool 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));
|
||||
|
@ -4196,6 +4199,12 @@ vec_sld (vector unsigned int a1, vector unsigned int a2, const int a3)
|
|||
return (vector unsigned int) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
|
||||
}
|
||||
|
||||
inline vector bool int
|
||||
vec_sld (vector bool int a1, vector bool int a2, const int a3)
|
||||
{
|
||||
return (vector bool int) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
|
||||
}
|
||||
|
||||
inline vector signed short
|
||||
vec_sld (vector signed short a1, vector signed short a2, const int a3)
|
||||
{
|
||||
|
@ -4208,6 +4217,12 @@ vec_sld (vector unsigned short a1, vector unsigned short a2, const int a3)
|
|||
return (vector unsigned short) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
|
||||
}
|
||||
|
||||
inline vector bool short
|
||||
vec_sld (vector bool short a1, vector bool short a2, const int a3)
|
||||
{
|
||||
return (vector bool short) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
|
||||
}
|
||||
|
||||
inline vector pixel
|
||||
vec_sld (vector pixel a1, vector pixel a2, const int a3)
|
||||
{
|
||||
|
@ -4226,6 +4241,12 @@ vec_sld (vector unsigned char a1, vector unsigned char a2, const int a3)
|
|||
return (vector unsigned char) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
|
||||
}
|
||||
|
||||
inline vector bool char
|
||||
vec_sld (vector bool char a1, vector bool char a2, const int a3)
|
||||
{
|
||||
return (vector bool char) __builtin_altivec_vsldoi_4si ((vector signed int) a1, (vector signed int) a2, a3);
|
||||
}
|
||||
|
||||
/* vec_sll */
|
||||
|
||||
inline vector signed int
|
||||
|
@ -9534,17 +9555,23 @@ __ch (__tern_args_eq (vector signed int, (a1), vector signed int, (a2), int, (a3
|
|||
((vector signed int) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
|
||||
__ch (__tern_args_eq (vector unsigned int, (a1), vector unsigned int, (a2), int, (a3)), \
|
||||
((vector unsigned int) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
|
||||
__ch (__tern_args_eq (vector bool int, (a1), vector bool int, (a2), int, (a3)), \
|
||||
((vector bool int) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
|
||||
__ch (__tern_args_eq (vector signed short, (a1), vector signed short, (a2), int, (a3)), \
|
||||
((vector signed short) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
|
||||
__ch (__tern_args_eq (vector unsigned short, (a1), vector unsigned short, (a2), int, (a3)), \
|
||||
((vector unsigned short) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
|
||||
__ch (__tern_args_eq (vector bool short, (a1), vector bool short, (a2), int, (a3)), \
|
||||
((vector bool short) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
|
||||
__ch (__tern_args_eq (vector pixel, (a1), vector pixel, (a2), int, (a3)), \
|
||||
((vector pixel) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
|
||||
__ch (__tern_args_eq (vector signed char, (a1), vector signed char, (a2), int, (a3)), \
|
||||
((vector signed char) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
|
||||
__ch (__tern_args_eq (vector unsigned char, (a1), vector unsigned char, (a2), int, (a3)), \
|
||||
((vector unsigned char) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
|
||||
__builtin_altivec_compiletime_error ("vec_sld")))))))))
|
||||
__ch (__tern_args_eq (vector bool char, (a1), vector bool char, (a2), int, (a3)), \
|
||||
((vector bool char) __builtin_altivec_vsldoi_4si ((vector signed int) (a1), (vector signed int) (a2), (const int) (a3))), \
|
||||
__builtin_altivec_compiletime_error ("vec_sld"))))))))))))
|
||||
|
||||
#define vec_sll(a1, a2) \
|
||||
__ch (__bin_args_eq (vector signed int, (a1), vector unsigned int, (a2)), \
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2004-05-10 Ziemowit Laski <zlaski@apple.com>
|
||||
|
||||
* g++.dg/ext/altivec-8.C: New test case.
|
||||
* gcc.dg/altivec-13.c: New test case.
|
||||
|
||||
2004-05-08 Roger Sayle <roger@eyesopen.com>
|
||||
|
||||
* gcc.c-torture/execute/divcmp-1.c: New test case.
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
/* { dg-do compile { target powerpc*-*-* } } */
|
||||
/* { dg-options "-faltivec" } */
|
||||
/* Author: Ziemowit Laski <zlaski@apple.com> */
|
||||
|
||||
/* This test case exercises intrinsic/argument combinations that,
|
||||
while not in the Motorola AltiVec PIM, have nevertheless crept
|
||||
into the AltiVec vernacular over the years. */
|
||||
|
||||
void foo() {
|
||||
vector bool int boolVec1 = (vector bool int) vec_splat_u32(3);
|
||||
vector bool short boolVec2 = (vector bool short) vec_splat_u16(3);
|
||||
vector bool char boolVec3 = (vector bool char) vec_splat_u8(3);
|
||||
boolVec1 = vec_sld( boolVec1, boolVec1, 4 );
|
||||
boolVec2 = vec_sld( boolVec2, boolVec2, 2 );
|
||||
boolVec3 = vec_sld( boolVec3, boolVec3, 1 );
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
/* { dg-do compile { target powerpc*-*-* } } */
|
||||
/* { dg-options "-faltivec" } */
|
||||
/* Author: Ziemowit Laski <zlaski@apple.com> */
|
||||
|
||||
/* This test case exercises intrinsic/argument combinations that,
|
||||
while not in the Motorola AltiVec PIM, have nevertheless crept
|
||||
into the AltiVec vernacular over the years. */
|
||||
|
||||
void foo() {
|
||||
vector bool int boolVec1 = (vector bool int) vec_splat_u32(3);
|
||||
vector bool short boolVec2 = (vector bool short) vec_splat_u16(3);
|
||||
vector bool char boolVec3 = (vector bool char) vec_splat_u8(3);
|
||||
boolVec1 = vec_sld( boolVec1, boolVec1, 4 );
|
||||
boolVec2 = vec_sld( boolVec2, boolVec2, 2 );
|
||||
boolVec3 = vec_sld( boolVec3, boolVec3, 1 );
|
||||
}
|
Loading…
Reference in New Issue