This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add comparison operators for vector types
- From: Paolo Bonzini <paolo dot bonzini at gmail dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Andrew Pinski <Andrew_Pinski at playstation dot sony dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Trevor_Smigiel <Trevor_Smigiel at playstation dot sony dot com>
- Date: Thu, 04 Jun 2009 09:59:06 +0200
- Subject: Re: [PATCH] Add comparison operators for vector types
- References: <de8d50360905291806i2b12b4a6n9179a3cd2f9e47d2@mail.gmail.com> <Pine.LNX.4.64.0906011330010.1133@digraph.polyomino.org.uk>
The general model used for the generic vector extensions is C++ valarray,
which returns valarray<bool> for these operations. Since comparisons in C
return int not bool, this might suggest valarray<int> for C; bearing in
mind that vectors of the given number of bools or ints may not exist in
hardware, the OpenCL approach of returning a vector of the same size as
the inputs seems reasonable, even if the choice of -1 for true elements
seems odd in language design terms.
Agreed. I don't think this particular extension should go into FSF GCC
in a target-independent manner.
Paolo