diff options
author | Ziemowit Laski <zlaski@apple.com> | 2004-03-04 23:19:29 +0000 |
---|---|---|
committer | Ziemowit Laski <zlaski@gcc.gnu.org> | 2004-03-04 23:19:29 +0000 |
commit | b9e4e5d1c051b8e1316aae6a85d146804fa36df6 (patch) | |
tree | 9f8495eda5db266a273daf6068940c9bf0d08d3a | |
parent | 9fc444cc61c77936768d85191cad5d0b76491a37 (diff) | |
download | gcc-b9e4e5d1c051b8e1316aae6a85d146804fa36df6.zip gcc-b9e4e5d1c051b8e1316aae6a85d146804fa36df6.tar.gz gcc-b9e4e5d1c051b8e1316aae6a85d146804fa36df6.tar.bz2 |
PR c++/14425, c++/14426
[gcc/ChangeLog]
2004-03-04 Ziemowit Laski <zlaski@apple.com>
PR c++/14425, c++/14426
* config/rs6000/altivec.h (vec_splat_s8, vec_splat_s16,
vec_splat_s32, vec_splat_u8, vec_splat_u16, vec_splat_u32):
Change C++ definitions to accept a 'const int' argument;
the prototypes already do.
* config/rs6000/rs6000.c (rs6000_common_init_builtins):
Rename v4si_ftype_char, v8hi_ftype_char, v16qi_ftype_char,
v4sf_ftype_v4si_char, v4si_ftype_v4sf_char, v4si_ftype_v4si_char,
v8hi_ftype_v8hi_char, v16qi_ftype_v16qi_char,
v16qi_ftype_v16qi_v16qi_char, v8hi_ftype_v8hi_v8hi_char,
v4si_ftype_v4si_v4si_char and v4sf_ftype_v4sf_v4sf_char to
end in ..._int; change them to accept an int instead of a char
as the last parameter.
[gcc/testsuite/ChangeLog]
2004-03-04 Ziemowit Laski <zlaski@apple.com>
PR c++/14425, c++/14426
* g++.dg/ext/altivec-4.C: New test.
* g++.dg/ext/altivec-5.C: New test.
From-SVN: r78940
-rw-r--r-- | gcc/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/config/rs6000/altivec.h | 12 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 72 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/altivec-4.C | 11 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/altivec-5.C | 15 |
6 files changed, 90 insertions, 42 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d72dbf6..2495b33 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2004-03-04 Ziemowit Laski <zlaski@apple.com> + + PR c++/14425, c++/14426 + * config/rs6000/altivec.h (vec_splat_s8, vec_splat_s16, + vec_splat_s32, vec_splat_u8, vec_splat_u16, vec_splat_u32): + Change C++ definitions to accept a 'const int' argument; + the prototypes already do. + * config/rs6000/rs6000.c (rs6000_common_init_builtins): + Rename v4si_ftype_char, v8hi_ftype_char, v16qi_ftype_char, + v4sf_ftype_v4si_char, v4si_ftype_v4sf_char, v4si_ftype_v4si_char, + v8hi_ftype_v8hi_char, v16qi_ftype_v16qi_char, + v16qi_ftype_v16qi_v16qi_char, v8hi_ftype_v8hi_v8hi_char, + v4si_ftype_v4si_v4si_char and v4sf_ftype_v4sf_v4sf_char to + end in ..._int; change them to accept an int instead of a char + as the last parameter. + 2004-03-04 Phil Edwards <phil@codesourcery.com> * genmultilib: Change '=' to '-' when translating option names diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h index 42779c5..2ae567e 100644 --- a/gcc/config/rs6000/altivec.h +++ b/gcc/config/rs6000/altivec.h @@ -4613,7 +4613,7 @@ vec_vspltb (vector unsigned char a1, const int a2) /* vec_splat_s8 */ inline vector signed char -vec_splat_s8 (const signed char a1) +vec_splat_s8 (const int a1) { return (vector signed char) __builtin_altivec_vspltisb (a1); } @@ -4621,7 +4621,7 @@ vec_splat_s8 (const signed char a1) /* vec_splat_s16 */ inline vector signed short -vec_splat_s16 (const signed char a1) +vec_splat_s16 (const int a1) { return (vector signed short) __builtin_altivec_vspltish (a1); } @@ -4629,7 +4629,7 @@ vec_splat_s16 (const signed char a1) /* vec_splat_s32 */ inline vector signed int -vec_splat_s32 (const signed char a1) +vec_splat_s32 (const int a1) { return (vector signed int) __builtin_altivec_vspltisw (a1); } @@ -4637,7 +4637,7 @@ vec_splat_s32 (const signed char a1) /* vec_splat_u8 */ inline vector unsigned char -vec_splat_u8 (const signed char a1) +vec_splat_u8 (const int a1) { return (vector unsigned char) __builtin_altivec_vspltisb (a1); } @@ -4645,7 +4645,7 @@ vec_splat_u8 (const signed char a1) /* vec_splat_u16 */ inline vector unsigned short -vec_splat_u16 (const signed char a1) +vec_splat_u16 (const int a1) { return (vector unsigned short) __builtin_altivec_vspltish (a1); } @@ -4653,7 +4653,7 @@ vec_splat_u16 (const signed char a1) /* vec_splat_u32 */ inline vector unsigned int -vec_splat_u32 (const signed char a1) +vec_splat_u32 (const int a1) { return (vector unsigned int) __builtin_altivec_vspltisw (a1); } diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 3466590..b9d9ff4 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -7015,12 +7015,12 @@ rs6000_common_init_builtins (void) = build_function_type_list (V16QI_type_node, V16QI_type_node, V16QI_type_node, V16QI_type_node, NULL_TREE); - tree v4si_ftype_char - = build_function_type_list (V4SI_type_node, char_type_node, NULL_TREE); - tree v8hi_ftype_char - = build_function_type_list (V8HI_type_node, char_type_node, NULL_TREE); - tree v16qi_ftype_char - = build_function_type_list (V16QI_type_node, char_type_node, NULL_TREE); + tree v4si_ftype_int + = build_function_type_list (V4SI_type_node, integer_type_node, NULL_TREE); + tree v8hi_ftype_int + = build_function_type_list (V8HI_type_node, integer_type_node, NULL_TREE); + tree v16qi_ftype_int + = build_function_type_list (V16QI_type_node, integer_type_node, NULL_TREE); tree v8hi_ftype_v16qi = build_function_type_list (V8HI_type_node, V16QI_type_node, NULL_TREE); tree v4sf_ftype_v4sf @@ -7078,37 +7078,37 @@ rs6000_common_init_builtins (void) tree v4si_ftype_v4si_v4si = build_function_type_list (V4SI_type_node, V4SI_type_node, V4SI_type_node, NULL_TREE); - tree v4sf_ftype_v4si_char + tree v4sf_ftype_v4si_int = build_function_type_list (V4SF_type_node, - V4SI_type_node, char_type_node, NULL_TREE); - tree v4si_ftype_v4sf_char + V4SI_type_node, integer_type_node, NULL_TREE); + tree v4si_ftype_v4sf_int = build_function_type_list (V4SI_type_node, - V4SF_type_node, char_type_node, NULL_TREE); - tree v4si_ftype_v4si_char + V4SF_type_node, integer_type_node, NULL_TREE); + tree v4si_ftype_v4si_int = build_function_type_list (V4SI_type_node, - V4SI_type_node, char_type_node, NULL_TREE); - tree v8hi_ftype_v8hi_char + V4SI_type_node, integer_type_node, NULL_TREE); + tree v8hi_ftype_v8hi_int = build_function_type_list (V8HI_type_node, - V8HI_type_node, char_type_node, NULL_TREE); - tree v16qi_ftype_v16qi_char + V8HI_type_node, integer_type_node, NULL_TREE); + tree v16qi_ftype_v16qi_int = build_function_type_list (V16QI_type_node, - V16QI_type_node, char_type_node, NULL_TREE); - tree v16qi_ftype_v16qi_v16qi_char + V16QI_type_node, integer_type_node, NULL_TREE); + tree v16qi_ftype_v16qi_v16qi_int = build_function_type_list (V16QI_type_node, V16QI_type_node, V16QI_type_node, - char_type_node, NULL_TREE); - tree v8hi_ftype_v8hi_v8hi_char + integer_type_node, NULL_TREE); + tree v8hi_ftype_v8hi_v8hi_int = build_function_type_list (V8HI_type_node, V8HI_type_node, V8HI_type_node, - char_type_node, NULL_TREE); - tree v4si_ftype_v4si_v4si_char + integer_type_node, NULL_TREE); + tree v4si_ftype_v4si_v4si_int = build_function_type_list (V4SI_type_node, V4SI_type_node, V4SI_type_node, - char_type_node, NULL_TREE); - tree v4sf_ftype_v4sf_v4sf_char + integer_type_node, NULL_TREE); + tree v4sf_ftype_v4sf_v4sf_int = build_function_type_list (V4SF_type_node, V4SF_type_node, V4SF_type_node, - char_type_node, NULL_TREE); + integer_type_node, NULL_TREE); tree v4sf_ftype_v4sf_v4sf = build_function_type_list (V4SF_type_node, V4SF_type_node, V4SF_type_node, NULL_TREE); @@ -7251,22 +7251,22 @@ rs6000_common_init_builtins (void) /* vchar, vchar, vchar, 4 bit literal. */ else if (mode0 == V16QImode && mode1 == mode0 && mode2 == mode0 && mode3 == QImode) - type = v16qi_ftype_v16qi_v16qi_char; + type = v16qi_ftype_v16qi_v16qi_int; /* vshort, vshort, vshort, 4 bit literal. */ else if (mode0 == V8HImode && mode1 == mode0 && mode2 == mode0 && mode3 == QImode) - type = v8hi_ftype_v8hi_v8hi_char; + type = v8hi_ftype_v8hi_v8hi_int; /* vint, vint, vint, 4 bit literal. */ else if (mode0 == V4SImode && mode1 == mode0 && mode2 == mode0 && mode3 == QImode) - type = v4si_ftype_v4si_v4si_char; + type = v4si_ftype_v4si_v4si_int; /* vfloat, vfloat, vfloat, 4 bit literal. */ else if (mode0 == V4SFmode && mode1 == mode0 && mode2 == mode0 && mode3 == QImode) - type = v4sf_ftype_v4sf_v4sf_char; + type = v4sf_ftype_v4sf_v4sf_int; else abort (); @@ -7355,23 +7355,23 @@ rs6000_common_init_builtins (void) /* vint, vint, 5 bit literal. */ else if (mode0 == V4SImode && mode1 == V4SImode && mode2 == QImode) - type = v4si_ftype_v4si_char; + type = v4si_ftype_v4si_int; /* vshort, vshort, 5 bit literal. */ else if (mode0 == V8HImode && mode1 == V8HImode && mode2 == QImode) - type = v8hi_ftype_v8hi_char; + type = v8hi_ftype_v8hi_int; /* vchar, vchar, 5 bit literal. */ else if (mode0 == V16QImode && mode1 == V16QImode && mode2 == QImode) - type = v16qi_ftype_v16qi_char; + type = v16qi_ftype_v16qi_int; /* vfloat, vint, 5 bit literal. */ else if (mode0 == V4SFmode && mode1 == V4SImode && mode2 == QImode) - type = v4sf_ftype_v4si_char; + type = v4sf_ftype_v4si_int; /* vint, vfloat, 5 bit literal. */ else if (mode0 == V4SImode && mode1 == V4SFmode && mode2 == QImode) - type = v4si_ftype_v4sf_char; + type = v4si_ftype_v4sf_int; else if (mode0 == V2SImode && mode1 == SImode && mode2 == SImode) type = v2si_ftype_int_int; @@ -7424,11 +7424,11 @@ rs6000_common_init_builtins (void) mode1 = insn_data[d->icode].operand[1].mode; if (mode0 == V4SImode && mode1 == QImode) - type = v4si_ftype_char; + type = v4si_ftype_int; else if (mode0 == V8HImode && mode1 == QImode) - type = v8hi_ftype_char; + type = v8hi_ftype_int; else if (mode0 == V16QImode && mode1 == QImode) - type = v16qi_ftype_char; + type = v16qi_ftype_int; else if (mode0 == V4SFmode && mode1 == V4SFmode) type = v4sf_ftype_v4sf; else if (mode0 == V8HImode && mode1 == V16QImode) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1b730c6..bd7dfe5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2004-03-04 Ziemowit Laski <zlaski@apple.com> + + PR c++/14425, c++/14426 + * g++.dg/ext/altivec-4.C: New test. + * g++.dg/ext/altivec-5.C: New test. + 2004-03-04 Geoffrey Keating <geoffk@apple.com> * g++.old-deja/g++.other/linkage1.C: Expect errors about diff --git a/gcc/testsuite/g++.dg/ext/altivec-4.C b/gcc/testsuite/g++.dg/ext/altivec-4.C new file mode 100644 index 0000000..f6d8462 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/altivec-4.C @@ -0,0 +1,11 @@ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-options "-maltivec" } */ + +/* PR c++/14425 */ + +#include <altivec.h> + +vector unsigned int splat0(vector unsigned int x) +{ + return vec_splat(x, 0); +} diff --git a/gcc/testsuite/g++.dg/ext/altivec-5.C b/gcc/testsuite/g++.dg/ext/altivec-5.C new file mode 100644 index 0000000..213bde0 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/altivec-5.C @@ -0,0 +1,15 @@ +/* { dg-do compile { target powerpc*-*-* } } */ +/* { dg-options "-maltivec" } */ + +/* PR c++/14426 */ + +#include <altivec.h> + +vector unsigned int splat0u() +{ + return vec_splat_u32(0); +} +vector int splat0s() +{ + return vec_splat_s32(0); +} |