This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Vector comparison
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Artem Shinkarov <artyom dot shinkaroff at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Guenther <richard dot guenther at gmail dot com>
- Date: Sun, 15 Aug 2010 10:30:51 -0700
- Subject: Re: Vector comparison
- References: <AANLkTimDve4hPRY9NEHprfa9SDjUGRykgEM=mdDFKNQf@mail.gmail.com>
On Sun, Aug 15, 2010 at 10:09 AM, Artem Shinkarov
<artyom.shinkaroff@gmail.com> wrote:
> This patch implements vector comparison according to OpenCL standard.
> The patch tries to dispatch vector comparison to hardware-specific
> instructions. If case when it is impossible, vector comparison is
> expanded piecewise.
I had posted a patch which had implemented them using the standard
tree codes and expansion and tree-lower-vect took care of the rest.
This was for reduction of vector comparison into a single scalar.
In fact we had agreed that they should implicitly turn a vector int
into a scalar when used in the context of a bool.
See http://gcc.gnu.org/ml/gcc-patches/2009-05/msg01912.html .
Please consider using tree codes all the way through the gimple IR if
the target supports expansion and doing the expansion only at expand
time. Building a call expression is expensive and really you could
use opcodes and not worry about a target hook. I think opcodes it is
a much easier way allowing for targets to add support rather than
adding more and more target hooks.
Thanks,
Andrew Pinski