public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marc Glisse <marc.glisse@inria.fr>
To: Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	Patch Tracking <patches@linaro.org>,
	    Jason Merrill <jason@redhat.com>
Subject: Re: [RFC C++ / PR51033 ] Handle __builtin_shuffle in constexpr properly in the C++ frontend.
Date: Fri, 03 Aug 2012 22:08:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.02.1208032348230.3285@laptop-mg.saclay.inria.fr> (raw)
In-Reply-To: <alpine.DEB.2.02.1207281114420.3227@laptop-mg.saclay.inria.fr>

On Sat, 28 Jul 2012, Marc Glisse 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?
>
> #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);
>                       ^

The issue seems to be that we call fold_ternary_loc with a last argument 
that is a CONSTRUCTOR whereas the VEC_PERM_EXPR case expects a VECTOR_CST.

-- 
Marc Glisse

      parent reply	other threads:[~2012-08-03 22:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-18 13:32 Ramana Radhakrishnan
2012-06-22  9:23 ` Ramana Radhakrishnan
2012-06-25  5:56 ` Jason Merrill
2012-06-27 14:45   ` Ramana Radhakrishnan
2012-07-28 14:44 ` Marc Glisse
2012-07-30 11:41   ` Ramana Radhakrishnan
2012-08-03 22:08   ` Marc Glisse [this message]

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=alpine.DEB.2.02.1208032348230.3285@laptop-mg.saclay.inria.fr \
    --to=marc.glisse@inria.fr \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=patches@linaro.org \
    --cc=ramana.radhakrishnan@linaro.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).