This is the mail archive of the
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: <email@example.com> <Pine.LNX.firstname.lastname@example.org>
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.