This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH rs6000] (small C++ patch) Add intrinsics for the new vec_* specified by the C/C++ Language Extension for the CBEA
- From: "David Edelsohn" <dje dot gcc at gmail dot com>
- To: "Andrew Pinski" <Andrew_Pinski at playstation dot sony dot com>
- Cc: "GCC Patches" <gcc-patches at gcc dot gnu dot org>, Trevor_Smigiel <Trevor_Smigiel at playstation dot sony dot com>
- Date: Wed, 1 Oct 2008 10:13:35 -0400
- Subject: Re: [PATCH rs6000] (small C++ patch) Add intrinsics for the new vec_* specified by the C/C++ Language Extension for the CBEA
- References: <de8d50360809301900l56f33058k781b528f6cbc793b@mail.gmail.com>
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
Handle ALTIVEC_BUILTIN_VEC_SPLATS, ALTIVEC_BUILTIN_VEC_PROMOTE,
ALTIVEC_BUILTIN_VEC_EXTRACT, and ALTIVEC_BUILTIN_VEC_INSERT specially,
they translate to non builtins.
* config/rs6000/rs6000.c (altivec_init_builtins): Add new variable
opaque_ftype_opaque. Define builtins __builtin_vec_splats,
__builtin_vec_promote, __builtin_vec_extract, and
__builtin_vec_insert.
* config/rs6000/rs6000.h (enum rs6000_builtins): Add
ALTIVEC_BUILTIN_VEC_EXTRACT, ALTIVEC_BUILTIN_VEC_PROMOTE,
ALTIVEC_BUILTIN_VEC_INSERT, and ALTIVEC_BUILTIN_VEC_SPLATS.
* config/rs6000/altivec.h (vec_extract): Define
(vec_insert): Define.
(vec_splats): Define.
(vec_promote): Define.
cp/ChangeLog:
* tree.c (lvalue_p_1): COMPOUND_LITERAL_EXPR is also an lvalue.
testsuite/ChangeLog:
* gcc.target/powerpc/altivec-cell-1.c: New test.
* gcc.target/powerpc/altivec-cell-2.c: New test.
* gcc.target/powerpc/altivec-cell-3.c: New test.
* gcc.target/powerpc/altivec-cell-4.c: New test.
* g++.dg/ext/altivec-cell-1.C: New test.
* g++.dg/ext/altivec-cell-2.C: New test.
* g++.dg/ext/altivec-cell-3.C: New test.
* g++.dg/ext/altivec-cell-4.C: New test.
Okay.
Index: config/rs6000/rs6000-c.c
===================================================================
--- config/rs6000/rs6000-c.c (revision 140763)
+++ config/rs6000/rs6000-c.c (working copy)
@@ -2685,6 +2685,200 @@ altivec_resolve_overloaded_builtin (tree
|| fcode > ALTIVEC_BUILTIN_OVERLOADED_LAST)
return NULL_TREE;
+ /* For no treat vec_splats and vec_promote as the same. */
Spelling: "For now"?
Thanks, David