This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r253409 - in /trunk/gcc: jit/ChangeLog jit/docs...
- From: dmalcolm at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Wed, 04 Oct 2017 13:41:01 -0000
- Subject: r253409 - in /trunk/gcc: jit/ChangeLog jit/docs...
Author: dmalcolm
Date: Wed Oct 4 13:41:01 2017
New Revision: 253409
URL: https://gcc.gnu.org/viewcvs?rev=253409&root=gcc&view=rev
Log:
jit: implement gcc_jit_context_new_rvalue_from_vector
This patch implements a new API entrypoint:
/* Build a vector rvalue from an array of elements.
"vec_type" should be a vector type, created using gcc_jit_type_get_vector.
This API entrypoint was added in LIBGCCJIT_ABI_10; you can test for its
presence using
#ifdef LIBGCCJIT_HAVE_gcc_jit_context_new_rvalue_from_vector
*/
extern gcc_jit_rvalue *
gcc_jit_context_new_rvalue_from_vector (gcc_jit_context *ctxt,
gcc_jit_location *loc,
gcc_jit_type *vec_type,
size_t num_elements,
gcc_jit_rvalue **elements);
gcc/jit/ChangeLog:
* docs/cp/topics/expressions.rst (Vector expressions): New
section.
* docs/topics/compatibility.rst (LIBGCCJIT_ABI_10): New ABI tag.
* docs/topics/expressions.rst (Vector expressions): New section.
* docs/topics/types.rst (gcc_jit_type_get_vector): Add link to
gcc_jit_context_new_rvalue_from_vector.
* jit-common.h (gcc::jit:recording::vector_type): New forward
decl.
* jit-playback.c
(gcc::jit::playback::context::new_rvalue_from_vector): New method.
* jit-playback.h
(gcc::jit::playback::context::new_rvalue_from_vector): New method.
* jit-recording.c: In namespace gcc::jit::
(class comma_separated_string): New class.
(comma_separated_string::comma_separated_string): New ctor,
adapted from recording::call::make_debug_string.
(comma_separated_string::~comma_separated_string): New dtor.
In namespace gcc::jit::recording::
(context::new_rvalue_from_vector): New method.
(type::get_vector): Update for renaming of memento_of_get_vector.
(class memento_of_get_vector): Rename to...
(class vector_type): ..this.
(memento_of_new_rvalue_from_vector::memento_of_new_rvalue_from_vector):
New ctor.
(memento_of_new_rvalue_from_vector::replay_into): New method.
(memento_of_new_rvalue_from_vector::visit_children): New method.
(memento_of_new_rvalue_from_vector::make_debug_string): New
method.
(memento_of_new_rvalue_from_vector::write_reproducer): New method.
(call::make_debug_string): Split out arg-printing code into ctor
for comma_separated_string.
* jit-recording.h: In namespace gcc::jit::recording::
(context::new_rvalue_from_vector): New method.
(type::dyn_cast_vector_type): New virtual function.
(class memento_of_get_vector): Rename to...
(class vector_type): ...this.
(vector_type::unqualified): Remove this vfunc override in favor
of...
(vector_type::get_element_type): ...this new method.
(vector_type::get_num_units): New method.
(vector_type::dyn_cast_vector_type): New vfunc override.
(class memento_of_new_rvalue_from_vector): New class.
* libgccjit++.h (gccjit::context::new_rvalue): Add overload for
vector of rvalue.
* libgccjit.c (gcc_jit_context_new_binary_op): Strip off type
qualifications when checking that both operands have same type.
(gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
* libgccjit.h
(LIBGCCJIT_HAVE_gcc_jit_context_new_rvalue_from_vector): New
macro.
(gcc_jit_context_new_rvalue_from_vector): New API entrypoint.
* libgccjit.map (LIBGCCJIT_ABI_10): New ABI tag.
gcc/testsuite/ChangeLog:
* jit.dg/test-expressions.c (make_test_of_vectors): New function.
(create_code): Call it.
* jit.dg/test-vector-rvalues.cc: New test case.
Added:
trunk/gcc/testsuite/jit.dg/test-vector-rvalues.cc
Modified:
trunk/gcc/jit/ChangeLog
trunk/gcc/jit/docs/_build/texinfo/libgccjit.texi
trunk/gcc/jit/docs/cp/topics/expressions.rst
trunk/gcc/jit/docs/topics/compatibility.rst
trunk/gcc/jit/docs/topics/expressions.rst
trunk/gcc/jit/docs/topics/types.rst
trunk/gcc/jit/jit-common.h
trunk/gcc/jit/jit-playback.c
trunk/gcc/jit/jit-playback.h
trunk/gcc/jit/jit-recording.c
trunk/gcc/jit/jit-recording.h
trunk/gcc/jit/libgccjit++.h
trunk/gcc/jit/libgccjit.c
trunk/gcc/jit/libgccjit.h
trunk/gcc/jit/libgccjit.map
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/jit.dg/test-expressions.c