re PR c++/85052 (Implement support for clang's __builtin_convertvector)
authorJakub Jelinek <jakub@redhat.com>
Mon, 7 Jan 2019 08:49:08 +0000 (09:49 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 7 Jan 2019 08:49:08 +0000 (09:49 +0100)
commitd8fcab689435a29dba2862693689c624b257d1bf
tree3ebde208f2b05c57fa2ce4a941e6c4e7811e82c3
parentf881693c53374c743d3b5d1561708a64dcfe7eb6
re PR c++/85052 (Implement support for clang's __builtin_convertvector)

PR c++/85052
* tree-vect-generic.c: Include insn-config.h and recog.h.
(expand_vector_piecewise): Add defaulted ret_type argument,
if non-NULL, use that in preference to type for the result type.
(expand_vector_parallel): Formatting fix.
(do_vec_conversion, do_vec_narrowing_conversion,
expand_vector_conversion): New functions.
(expand_vector_operations_1): Call expand_vector_conversion
for VEC_CONVERT ifn calls.
* internal-fn.def (VEC_CONVERT): New internal function.
* internal-fn.c (expand_VEC_CONVERT): New function.
* fold-const-call.c (fold_const_vec_convert): New function.
(fold_const_call): Use it for CFN_VEC_CONVERT.
* doc/extend.texi (__builtin_convertvector): Document.
c-family/
* c-common.h (enum rid): Add RID_BUILTIN_CONVERTVECTOR.
(c_build_vec_convert): Declare.
* c-common.c (c_build_vec_convert): New function.
c/
* c-parser.c (c_parser_postfix_expression): Parse
__builtin_convertvector.
cp/
* cp-tree.h (cp_build_vec_convert): Declare.
* parser.c (cp_parser_postfix_expression): Parse
__builtin_convertvector.
* constexpr.c: Include fold-const-call.h.
(cxx_eval_internal_function): Handle IFN_VEC_CONVERT.
(potential_constant_expression_1): Likewise.
* semantics.c (cp_build_vec_convert): New function.
* pt.c (tsubst_copy_and_build): Handle CALL_EXPR to
IFN_VEC_CONVERT.
testsuite/
* c-c++-common/builtin-convertvector-1.c: New test.
* c-c++-common/torture/builtin-convertvector-1.c: New test.
* g++.dg/ext/builtin-convertvector-1.C: New test.
* g++.dg/cpp0x/constexpr-builtin4.C: New test.

From-SVN: r267632
22 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/cp-tree.h
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/doc/extend.texi
gcc/fold-const-call.c
gcc/internal-fn.c
gcc/internal-fn.def
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/builtin-convertvector-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/torture/builtin-convertvector-1.c [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/constexpr-builtin4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/builtin-convertvector-1.C [new file with mode: 0644]
gcc/tree-vect-generic.c