From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: aburgess@broadcom.com (Andrew Burgess)
Cc: tromey@redhat.com (Tom Tromey),
gdb-patches@sourceware.org (gdb-patches@sourceware.org),
ken@linux.vnet.ibm.com (Ken Werner)
Subject: Re: [PATCH] Vector to scalar casting and widening
Date: Mon, 26 Nov 2012 14:18:00 -0000 [thread overview]
Message-ID: <201211261418.qAQEI3Kv008073@d06av02.portsmouth.uk.ibm.com> (raw)
In-Reply-To: <50AFA38D.3040602@broadcom.com> from "Andrew Burgess" at Nov 23, 2012 04:25:49 PM
Andrew Burgess wrote:
> On 19/11/2012 9:16 PM, Tom Tromey wrote:
> >>>>>> "Andrew" == Andrew Burgess <aburgess@broadcom.com> writes:
> >
> > Andrew> I'd like to change the way gdb handles scalar to vector
> > Andrew> widening. I believe that the changes I propose will bring gdb
> > Andrew> expression evaluation into line with how gcc handles these
> > Andrew> things; this seems a good thing to me, but I'd be interested to
> > Andrew> hear why anyone things we should stick with the current scheme.
This difference between OpenCL semantics and GCC is a bit annoying;
for the most part, GCC vector extensions were chosen to match (or
at least extend) OpenCL semantics. But in the particular case of
explicit conversion between integer and vector types it seems
the behaviour of the GCC extension dates way back to 2000 or so,
long before we even had OpenCL ...
Given that, I agree that we ought to match GCC's behaviour when
targeting non-OpenCL languages.
> In order to maintain current opencl behaviour I've created a new patch,
> this one has a flag on the language_defn structure to control how vector
> casting functions. I reuse the vector widening code where appropriate.
> The choices then are:
> 1. vector to vector cast
> 1.1 This is not allowed in OpenCL (see above pdf) so I throw an error.
> 1.2 This is only allowed for gcc/c vectors if they are the same size,
> otherwise throw an error.
> 2. scalar to vector cast
> 2.1 For OpenCL, cast scalar to vector element type and replicate.
> 2.2 For gcc/c vectors, only allow if the scalar is the same size as
> the vector.
However, I'm not sure I like the new language_defn flag. Generally, the
OpenCL code has kept all expression evaluation that differs from the
default behaviour local in evaluate_subexp_opencl; see e.g. the treatment
of relational operations.
Thus, I'd prefer a patch that:
- changes the default behaviour of value_cast etc. to the GCC behaviour, and
- adds handling of UNOP_CAST etc. to evaluate_subexp_opencl to implement the
OpenCL semantics.
> I've tested the standard non-opencl side of things, but haven't been able
> to figure out how to run the opencl tests (any pointers welcome), so I don't
> know if I've broken any of those tests.
Unfortunately the only environment I know of to test the GDB OpenCL support
is the IBM OpenCL SDK for PowerPC. I'll be happy to run the test for you ...
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2012-11-26 14:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-13 14:10 Andrew Burgess
2012-11-19 21:17 ` Tom Tromey
2012-11-23 16:26 ` Andrew Burgess
2012-11-26 14:18 ` Ulrich Weigand [this message]
2012-11-28 22:08 ` Andrew Burgess
2012-11-29 17:50 ` Ulrich Weigand
2012-11-29 18:13 ` Andrew Burgess
2013-01-04 14:45 ` Andrew Burgess
2013-01-07 16:23 ` Ulrich Weigand
2013-01-08 15:08 ` Andrew Burgess
2013-01-08 19:05 ` Ulrich Weigand
2013-01-09 19:13 ` Tom Tromey
2013-01-25 17:18 ` Andrew Burgess
2013-01-09 19:08 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201211261418.qAQEI3Kv008073@d06av02.portsmouth.uk.ibm.com \
--to=uweigand@de.ibm.com \
--cc=aburgess@broadcom.com \
--cc=gdb-patches@sourceware.org \
--cc=ken@linux.vnet.ibm.com \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox