diff options
author | Andrew Burgess <aburgess@broadcom.com> | 2013-01-25 17:16:43 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@broadcom.com> | 2013-01-25 17:16:43 +0000 |
commit | 8954db33ac73962ac337cc456a782db7e9539c06 (patch) | |
tree | 9ca8b23663dcfd7823bc8f3ecbc8641c397e7613 /gdb/value.h | |
parent | d79dcc73ac46dad924acf843a2c3546517506f9e (diff) | |
download | gdb-8954db33ac73962ac337cc456a782db7e9539c06.zip gdb-8954db33ac73962ac337cc456a782db7e9539c06.tar.gz gdb-8954db33ac73962ac337cc456a782db7e9539c06.tar.bz2 |
http://sourceware.org/ml/gdb-patches/2012-11/msg00312.html
gdb/ChangeLog
* valarith.c (value_vector_widen): New function for replicating a
scalar into a vector.
(value_binop): Use value_vector_widen to widen scalar to vector
rather than casting, this better matches gcc C behaviour.
* valops.c (value_casst): Update logic for casting between vector
types, and for casting from scalar to vector, try to match gcc C
behaviour.
* value.h (value_vector_widen): Declare.
* opencl-lang.c (opencl_value_cast): New opencl specific casting
function, handle special case for casting scalar to vector.
(opencl_relop): Use opencl_value_cast.
(evaluate_subexp_opencl): Use opencl_value_cast instead of
value_cast, and handle BINOP_ASSIGN, UNOP_CAST, and UNOP_CAST_TYPE
in order to use opencl_value_cast.
gdb/testsuite/ChangeLog
* gdb.base/gnu_vector.c: New variable for use in tests.
* gdb.base/gnu_vector.exp: Update and extend tests to reflect
changes in scalar to vector casting and widening.
* gdb.python/py-type.c: New variables for use in tests.
* gdb.python/py-type.exp: Update vector related tests to reflect
changes in scalar to vector casting and widening.
Diffstat (limited to 'gdb/value.h')
-rw-r--r-- | gdb/value.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/value.h b/gdb/value.h index 67f1d04..5825f6e 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -482,6 +482,12 @@ extern void read_value_memory (struct value *val, int embedded_offset, int stack, CORE_ADDR memaddr, gdb_byte *buffer, size_t length); +/* Cast SCALAR_VALUE to the element type of VECTOR_TYPE, then replicate + into each element of a new vector value with VECTOR_TYPE. */ + +struct value *value_vector_widen (struct value *scalar_value, + struct type *vector_type); + #include "symtab.h" |