This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC C++ / PR51033 ] Handle __builtin_shuffle in constexpr properly in the C++ frontend.
- From: Ramana Radhakrishnan <ramana dot radhakrishnan at linaro dot org>
- To: Marc Glisse <marc dot glisse at inria dot fr>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Patch Tracking <patches at linaro dot org>, Jason Merrill <jason at redhat dot com>
- Date: Mon, 30 Jul 2012 12:15:40 +0100
- Subject: Re: [RFC C++ / PR51033 ] Handle __builtin_shuffle in constexpr properly in the C++ frontend.
- References: <CACUk7=WW+PQYjq9w6OtTB+Mqm1Hpcne85zau_v8u_v=yhrYvKA@mail.gmail.com> <alpine.DEB.2.02.1207281114420.3227@laptop-mg.saclay.inria.fr>
On 28 July 2012 10:26, Marc Glisse <marc.glisse@inria.fr> wrote:
> On Mon, 18 Jun 2012, Ramana Radhakrishnan wrote:
>
>> This patch following on from the fix for turning on __builtin_shuffle
>> for c++ , enables folding of vec_perm_exprs in the front-end for
>> constexpr and constructor style values.
>
>
> Hello,
>
> I took a look, and the example I gave in
> http://gcc.gnu.org/ml/gcc-patches/2012-06/msg01066.html
> although it doesn't crash the compiler anymore, still fails to compile. I am
> not sure: were you just trying to remove the ICE, or actually support this
> use?
The intent was to actually support this use properly. I'll have a look
but it's unlikely to be today.
Ramana
>
> #include <x86intrin.h>
> int main(){
> constexpr __m128d x={1.,2.};
> constexpr __m128i y={1,0};
> constexpr __m128d z=__builtin_shuffle(x,y);
> }
>
> $ g++ -std=gnu++11 m.cc
> m.cc: In function 'int main()':
> m.cc:5:23: error: '#'vec_perm_expr' not supported by dump_expr#<expression
> error>' is not a constant expression
> constexpr __m128d z=__builtin_shuffle(x,y);
> ^
>
> --
> Marc Glisse