public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/51033] New: Partial vector extension support
@ 2011-11-08 16:39 marc.glisse at normalesup dot org
  2011-11-08 17:10 ` [Bug c++/51033] " rguenth at gcc dot gnu.org
                   ` (31 more replies)
  0 siblings, 32 replies; 33+ messages in thread
From: marc.glisse at normalesup dot org @ 2011-11-08 16:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

             Bug #: 51033
           Summary: Partial vector extension support
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: marc.glisse@normalesup.org


Hello,

gcc's vector extension, primarily developed for C, is only partially available
in C++. It is missing the very useful subscript operator and __builtin_shuffle
(and possibly other things). It would be great if C++ could catch up.

(then I don't know if there is any plan to map some libstdc++ types to those,
probably hard for ABI reasons)


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] Partial vector extension support
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
@ 2011-11-08 17:10 ` rguenth at gcc dot gnu.org
  2011-11-08 17:21 ` marc.glisse at normalesup dot org
                   ` (30 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-11-08 17:10 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-11-08 16:42:25 UTC ---
Hmm, I thought we did the C++ extension mainly for the SPU stuff and think
that C++ language features are powerful enough to implement those extensions
themselves.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] Partial vector extension support
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
  2011-11-08 17:10 ` [Bug c++/51033] " rguenth at gcc dot gnu.org
@ 2011-11-08 17:21 ` marc.glisse at normalesup dot org
  2011-11-08 22:18 ` pinskia at gcc dot gnu.org
                   ` (29 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: marc.glisse at normalesup dot org @ 2011-11-08 17:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #2 from Marc Glisse <marc.glisse at normalesup dot org> 2011-11-08 17:13:39 UTC ---
It's probably doable, but it sounds like you have to duplicate all the logic
that is currently in the various backends (and some in the C front-end and the
middle-end I guess). The shuffle function has a different implementation for
all versions of all architectures that provide vectorization. I am not sure how
good an idea it is to decide that all this logic has to be coded twice, once
for the C vector extension and one for the C++ library, where the 2 codes would
be extremely different.

Or I probably didn't quite get what you meant. Would you mind giving a few more
details on how one would go about implementing it?


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] Partial vector extension support
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
  2011-11-08 17:10 ` [Bug c++/51033] " rguenth at gcc dot gnu.org
  2011-11-08 17:21 ` marc.glisse at normalesup dot org
@ 2011-11-08 22:18 ` pinskia at gcc dot gnu.org
  2011-11-08 22:19 ` marc.glisse at normalesup dot org
                   ` (28 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-11-08 22:18 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-11-08 22:03:12 UTC ---
All vector support should also be in the C++ front-end.  Can you give an
example of something which does not work?  Templates with vectors work already
too.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] Partial vector extension support
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (2 preceding siblings ...)
  2011-11-08 22:18 ` pinskia at gcc dot gnu.org
@ 2011-11-08 22:19 ` marc.glisse at normalesup dot org
  2011-11-08 22:31 ` [Bug c++/51033] [4.7 Regression] recent vector support was not added to C++ pinskia at gcc dot gnu.org
                   ` (27 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: marc.glisse at normalesup dot org @ 2011-11-08 22:19 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #4 from Marc Glisse <marc.glisse at normalesup dot org> 2011-11-08 22:18:33 UTC ---
(In reply to comment #3)
> All vector support should also be in the C++ front-end.  Can you give an
> example of something which does not work?  Templates with vectors work already
> too.

#include <x86intrin.h>
double f(){
        __m256d x={1,2,3,4};
        __m256i m={1,2,3,0};
        return __builtin_shuffle(x,m)[0];
}

error: ‘__builtin_shuffle’ was not declared in this scope

If I just return x[0], I get:
error: invalid types ‘__m256d {aka __vector(4) double}[int]’ for array
subscript


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] [4.7 Regression] recent vector support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (3 preceding siblings ...)
  2011-11-08 22:19 ` marc.glisse at normalesup dot org
@ 2011-11-08 22:31 ` pinskia at gcc dot gnu.org
  2011-11-08 22:34 ` marc.glisse at normalesup dot org
                   ` (26 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-11-08 22:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-11-08
   Target Milestone|---                         |4.7.0
            Summary|Partial vector extension    |[4.7 Regression] recent
                   |support                     |vector support was not
                   |                            |added to C++
     Ever Confirmed|0                           |1

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-11-08 22:23:28 UTC ---
I am going to mark this as a regression because before both the C++ front-end
and C front-ends were working with all vector extensions.  This is really bad
news if only the C front-end got an improvement and the C++ front-end did not.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] [4.7 Regression] recent vector support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (4 preceding siblings ...)
  2011-11-08 22:31 ` [Bug c++/51033] [4.7 Regression] recent vector support was not added to C++ pinskia at gcc dot gnu.org
@ 2011-11-08 22:34 ` marc.glisse at normalesup dot org
  2011-11-09  9:41 ` [Bug c++/51033] generic vector subscript and shuffle " rguenth at gcc dot gnu.org
                   ` (25 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: marc.glisse at normalesup dot org @ 2011-11-08 22:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #6 from Marc Glisse <marc.glisse at normalesup dot org> 2011-11-08 22:33:51 UTC ---
(In reply to comment #5)
> I am going to mark this as a regression because before both the C++ front-end
> and C front-ends were working with all vector extensions.  This is really bad
> news if only the C front-end got an improvement and the C++ front-end did not.

Note that at least the documentation is honest about it:
http://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html
"In C it is possible [...]"
"For the convenience in C [...]"
"In GNU C [...]"


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (5 preceding siblings ...)
  2011-11-08 22:34 ` marc.glisse at normalesup dot org
@ 2011-11-09  9:41 ` rguenth at gcc dot gnu.org
  2011-11-09 10:42 ` jakub at gcc dot gnu.org
                   ` (24 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-11-09  9:41 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.7.0                       |---
            Summary|[4.7 Regression] recent     |generic vector subscript
                   |vector support was not      |and shuffle support was not
                   |added to C++                |added to C++
           Severity|normal                      |enhancement

--- Comment #7 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-11-09 09:25:27 UTC ---
It's clearly not a regression - it's an enhancement request (and language
extensions in C++ are so much more fragile because of the power of C++ and
possible interaction with other language features).


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (6 preceding siblings ...)
  2011-11-09  9:41 ` [Bug c++/51033] generic vector subscript and shuffle " rguenth at gcc dot gnu.org
@ 2011-11-09 10:42 ` jakub at gcc dot gnu.org
  2011-12-29 10:32 ` paolo.carlini at oracle dot com
                   ` (23 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-11-09 10:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-11-09 10:40:10 UTC ---
At least __builtin_shuffle is hardly going to clash with any language feature,
it is an overloaded set of builtins for vector types, nothing else.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (7 preceding siblings ...)
  2011-11-09 10:42 ` jakub at gcc dot gnu.org
@ 2011-12-29 10:32 ` paolo.carlini at oracle dot com
  2012-04-17 10:23 ` marc.glisse at normalesup dot org
                   ` (22 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-12-29 10:32 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nicholasbishop at gmail dot
                   |                            |com

--- Comment #9 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-12-29 10:31:30 UTC ---
*** Bug 51700 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (8 preceding siblings ...)
  2011-12-29 10:32 ` paolo.carlini at oracle dot com
@ 2012-04-17 10:23 ` marc.glisse at normalesup dot org
  2012-04-17 10:56 ` manu at gcc dot gnu.org
                   ` (21 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: marc.glisse at normalesup dot org @ 2012-04-17 10:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #10 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-17 10:22:07 UTC ---
Created attachment 27176
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27176
subscript

This patch (a simple copy of a paragraph from the C front-end) seems sufficient
to add vector subscript support to the C++ front-end. At least, on the related
testcases I could find in the testsuite (vector-init-2.c,
vector-subscript-[123].c), g++ produces the same results as gcc (some error
messages have different content, but the same meaning, and the carets point to
'[' in C and ']' in C++).

I don't know if any of the functions called have more idiomatic counterparts in
the C++ front-end.

__builtin_shuffle seems a bit harder to move for someone not familiar with the
code.

Note that in C++ operator[] can only be a member function, which means we don't
need to worry about overloading or anything like that.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (9 preceding siblings ...)
  2012-04-17 10:23 ` marc.glisse at normalesup dot org
@ 2012-04-17 10:56 ` manu at gcc dot gnu.org
  2012-04-17 12:01 ` marc.glisse at normalesup dot org
                   ` (20 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: manu at gcc dot gnu.org @ 2012-04-17 10:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #11 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-17 10:54:58 UTC ---
(In reply to comment #10)
> Created attachment 27176 [details]
> subscript
> 
> This patch (a simple copy of a paragraph from the C front-end) seems sufficient
> to add vector subscript support to the C++ front-end. At least, on the related
> testcases I could find in the testsuite (vector-init-2.c,
> vector-subscript-[123].c), g++ produces the same results as gcc (some error
> messages have different content, but the same meaning, and the carets point to
> '[' in C and ']' in C++).

If it is indeed a copy, you should move the code c-common.c and share it. The
C-family FEs should share as much code as possible.

Also, testcases that work on both languages, should move to
testsuite/c-c++-common/


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (10 preceding siblings ...)
  2012-04-17 10:56 ` manu at gcc dot gnu.org
@ 2012-04-17 12:01 ` marc.glisse at normalesup dot org
  2012-04-17 12:16 ` manu at gcc dot gnu.org
                   ` (19 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: marc.glisse at normalesup dot org @ 2012-04-17 12:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #12 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-17 11:59:12 UTC ---
(In reply to comment #11)
> If it is indeed a copy, you should move the code c-common.c and share it. The
> C-family FEs should share as much code as possible.

I agree on the principle. If more code was shared, C++ would already support
this feature ;-)

On the other hand, here I am copying a small block of code in the middle of a
function. Making just that paragraph common wouldn't make much sense imho.
Factoring most of (cp_)build_array_ref might make sense, but requires someone
with a better understanding of the FEs, because there are slight differences
that may or may not be relevant.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (11 preceding siblings ...)
  2012-04-17 12:01 ` marc.glisse at normalesup dot org
@ 2012-04-17 12:16 ` manu at gcc dot gnu.org
  2012-04-17 13:10 ` marc.glisse at normalesup dot org
                   ` (18 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: manu at gcc dot gnu.org @ 2012-04-17 12:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #13 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-17 12:13:02 UTC ---
(In reply to comment #12)
> On the other hand, here I am copying a small block of code in the middle of a
> function. Making just that paragraph common wouldn't make much sense imho.
> Factoring most of (cp_)build_array_ref might make sense, but requires someone
> with a better understanding of the FEs, because there are slight differences
> that may or may not be relevant.

Something is better than nothing. I respectfully disagree, there are more than
10 lines of code there. If some change is ever required in those and the code
is not shared, only one version will be changed. You can call the function
vector_to_underlying_pointer_type() or something like that. Then you don't even
need a comment.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (12 preceding siblings ...)
  2012-04-17 12:16 ` manu at gcc dot gnu.org
@ 2012-04-17 13:10 ` marc.glisse at normalesup dot org
  2012-04-17 13:26 ` manu at gcc dot gnu.org
                   ` (17 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: marc.glisse at normalesup dot org @ 2012-04-17 13:10 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #14 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-17 13:06:40 UTC ---
Created attachment 27178
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27178
subscript 2 (Manuel-compliant)


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (13 preceding siblings ...)
  2012-04-17 13:10 ` marc.glisse at normalesup dot org
@ 2012-04-17 13:26 ` manu at gcc dot gnu.org
  2012-04-17 14:01 ` marc.glisse at normalesup dot org
                   ` (16 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: manu at gcc dot gnu.org @ 2012-04-17 13:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #15 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-17 13:23:11 UTC ---
:) Thanks for making me happy and sorry for being a PITA.

Are you planning to send it to gcc-patches for approval or are you not happy
with it yet?


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (14 preceding siblings ...)
  2012-04-17 13:26 ` manu at gcc dot gnu.org
@ 2012-04-17 14:01 ` marc.glisse at normalesup dot org
  2012-04-17 14:20 ` manu at gcc dot gnu.org
                   ` (15 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: marc.glisse at normalesup dot org @ 2012-04-17 14:01 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #16 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-17 13:57:05 UTC ---
(In reply to comment #15)
> Are you planning to send it to gcc-patches for approval or are you not happy
> with it yet?

There is the problem of moving the testcases. What svn diff prints is nonsense,
so I guess I should just write the Changelog and let whoever commits do the
moves?

The following can move to c-c++-common:
       gcc.dg/vector-2.c
       gcc.dg/vector-subscript-2.c
       gcc.dg/vector-3.c
       gcc.dg/vector-subscript-3.c
       gcc.dg/vector-init-1.c
       gcc.dg/vector-4.c
       gcc.dg/vector-init-2.c
       gcc.dg/vector-1.c
       gcc.dg/vector-subscript-1.c

with these minor modifications:

Index: c-c++-common/vector-subscript-1.c
===================================================================
--- c-c++-common/vector-subscript-1.c    (revision 186523)
+++ c-c++-common/vector-subscript-1.c    (working copy)
@@ -6,7 +6,7 @@

 float vf(vector float a)
 {
-  return 0[a]; /* { dg-error "subscripted value is neither array nor pointer
nor vector" } */
+  return 0[a]; /* { dg-error "subscripted value is neither array nor pointer
nor vector|invalid types .* for array subscript" } */
 }


Index: c-c++-common/vector-3.c
===================================================================
--- c-c++-common/vector-3.c    (revision 186523)
+++ c-c++-common/vector-3.c    (working copy)
@@ -2,4 +2,7 @@

 /* Check that we error out when using vector_size on the bool type. */

+#ifdef __cplusplus
+#define _Bool bool
+#endif
 __attribute__((vector_size(16) )) _Bool a; /* { dg-error "" } */


And now I should actually bootstrap and run the testsuite ;-)


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (15 preceding siblings ...)
  2012-04-17 14:01 ` marc.glisse at normalesup dot org
@ 2012-04-17 14:20 ` manu at gcc dot gnu.org
  2012-04-17 16:47 ` marc.glisse at normalesup dot org
                   ` (14 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: manu at gcc dot gnu.org @ 2012-04-17 14:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #17 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-17 14:11:03 UTC ---
(In reply to comment #16)
> (In reply to comment #15)
> > Are you planning to send it to gcc-patches for approval or are you not happy
> > with it yet?
> 
> There is the problem of moving the testcases. What svn diff prints is nonsense,
> so I guess I should just write the Changelog and let whoever commits do the
> moves?

Yep, just mention the moves in the changelog, and only show the diffs of the
modifications (like you did above).

> And now I should actually bootstrap and run the testsuite ;-)

Good luck! BTW, it may be handy to get an account in the GCC compile farm:
http://gcc.gnu.org/wiki/CompileFarm

and I have a script that makes very easy to bootstrap+regtest:

$ gccfarming bootstrap; PATCH=~/mypatch.diff gccfarming bootstrap

you get two directories revsion/ and revisionM-mypatch/,
then you do contrib/compare_tests revision/ revisionM-mypatch/ and check for
problems.

Let me know if you are interested.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (16 preceding siblings ...)
  2012-04-17 14:20 ` manu at gcc dot gnu.org
@ 2012-04-17 16:47 ` marc.glisse at normalesup dot org
  2012-04-22 10:32 ` marc.glisse at normalesup dot org
                   ` (13 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: marc.glisse at normalesup dot org @ 2012-04-17 16:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #18 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-17 16:41:58 UTC ---
(In reply to comment #17)
> > And now I should actually bootstrap and run the testsuite ;-)
> Good luck!

It worked fine, same failures as I got the other day for another patch.

> BTW, it may be handy to get an account in the GCC compile farm:
> http://gcc.gnu.org/wiki/CompileFarm

Thanks for the advice. I looked into it once, but don't currently need it: make
-j check leaves my 3 year old desktop at least 60% idle, and the few
architectures that could tempt me are not available in the farm (an x64 with
AVX? a sparc with VIS3?).


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (17 preceding siblings ...)
  2012-04-17 16:47 ` marc.glisse at normalesup dot org
@ 2012-04-22 10:32 ` marc.glisse at normalesup dot org
  2012-04-22 13:22 ` marc.glisse at normalesup dot org
                   ` (12 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: marc.glisse at normalesup dot org @ 2012-04-22 10:32 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #19 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-22 10:31:33 UTC ---
Created attachment 27217
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27217
shuffle

With this patch, g++ passes the few __builtin_shuffle tests I tried, and
generates generic code for non-constant indexes and special code for constant
indexes. I don't really know what to do about the testsuite. The tests exercise
the backend a lot, and it probably doesn't make sense to run everything with
both gcc and g++. But we still want to test that g++ accepts the syntax, and
maybe even that it handles constants well.

Content of the patch:
- move c_build_vec_perm_expr to c-common and condition the maybe_const stuff to
the dialect
- adapt the C RID_BUILTIN_SHUFFLE parser code to the C++ FE (the 2 are
different enough that it isn't easy to share)
- remove the C_ONLY tag from __builtin_shuffle

As usual, my limited knowledge of the compiler means I may have missed
fundamental things.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (18 preceding siblings ...)
  2012-04-22 10:32 ` marc.glisse at normalesup dot org
@ 2012-04-22 13:22 ` marc.glisse at normalesup dot org
  2012-04-22 14:57 ` manu at gcc dot gnu.org
                   ` (11 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: marc.glisse at normalesup dot org @ 2012-04-22 13:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #20 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-22 13:21:14 UTC ---
(In reply to comment #19)
> Created attachment 27217 [details]
> shuffle

Doesn't work with -std=c++11, which requires:

--- semantics.c    (revision 186667)
+++ semantics.c    (working copy)
@@ -5603,11 +5603,12 @@ float_const_decimal64_p (void)

 bool
 literal_type_p (tree t)
 {
   if (SCALAR_TYPE_P (t)
-      || TREE_CODE (t) == REFERENCE_TYPE)
+      || TREE_CODE (t) == REFERENCE_TYPE
+      || TREE_CODE (t) == VECTOR_TYPE)
     return true;
   if (CLASS_TYPE_P (t))
     {
       t = complete_type (t);
       gcc_assert (COMPLETE_TYPE_P (t) || errorcount);
@@ -8487,10 +8488,11 @@ potential_constant_expression_1 (tree t,
                           want_rval, flags))
       return false;
       return true;

     case FMA_EXPR:
+    case VEC_PERM_EXPR:
      for (i = 0; i < 3; ++i)
       if (!potential_constant_expression_1 (TREE_OPERAND (t, i),
                         true, flags))
     return false;
      return true;


And then I still need to write a cxx_eval_vec_perm function so the result of
__builtin_shuffle can be constexpr. I haven't seen how the C front-end handles
shuffles of constants. Maybe a "sorry" would do for now.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (19 preceding siblings ...)
  2012-04-22 13:22 ` marc.glisse at normalesup dot org
@ 2012-04-22 14:57 ` manu at gcc dot gnu.org
  2012-04-22 15:10 ` marc.glisse at normalesup dot org
                   ` (10 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: manu at gcc dot gnu.org @ 2012-04-22 14:57 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #21 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-22 14:56:28 UTC ---
(In reply to comment #19)
> With this patch, g++ passes the few __builtin_shuffle tests I tried, and
> generates generic code for non-constant indexes and special code for constant
> indexes. I don't really know what to do about the testsuite. The tests exercise
> the backend a lot, and it probably doesn't make sense to run everything with
> both gcc and g++. But we still want to test that g++ accepts the syntax, and
> maybe even that it handles constants well.

What does it mean "exercise the backend a lot"? Do you mean it takes a lot of
time? I haven't looked at the tests, but I think it is not a problem to run
compile-only tests with both gcc and g++. 

> As usual, my limited knowledge of the compiler means I may have missed
> fundamental things.

It looks pretty good to me.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (20 preceding siblings ...)
  2012-04-22 14:57 ` manu at gcc dot gnu.org
@ 2012-04-22 15:10 ` marc.glisse at normalesup dot org
  2012-04-24 11:59 ` marc.glisse at normalesup dot org
                   ` (9 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: marc.glisse at normalesup dot org @ 2012-04-22 15:10 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #22 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-22 15:09:23 UTC ---
(In reply to comment #20)
> And then I still need to write a cxx_eval_vec_perm function so the result of
> __builtin_shuffle can be constexpr. I haven't seen how the C front-end handles
> shuffles of constants. Maybe a "sorry" would do for now.

Making vectors literals is too much for now, the following seems sufficient as
long as they are not.

--- cp/semantics.c    (revision 186667)
+++ cp/semantics.c    (working copy)
@@ -8262,10 +8262,11 @@ potential_constant_expression_1 (tree t,
     case TRANSACTION_EXPR:
     case IF_STMT:
     case DO_STMT:
     case FOR_STMT:
     case WHILE_STMT:
+    case VEC_PERM_EXPR:
       if (flags & tf_error)
         error ("expression %qE is not a constant-expression", t);
       return false;

     case TYPEID_EXPR:


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (21 preceding siblings ...)
  2012-04-22 15:10 ` marc.glisse at normalesup dot org
@ 2012-04-24 11:59 ` marc.glisse at normalesup dot org
  2012-04-30 17:23 ` jason at gcc dot gnu.org
                   ` (8 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: marc.glisse at normalesup dot org @ 2012-04-24 11:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #23 from Marc Glisse <marc.glisse at normalesup dot org> 2012-04-24 11:57:22 UTC ---
(In reply to comment #21)
> What does it mean "exercise the backend a lot"? Do you mean it takes a lot of
> time?

I think so.

> I haven't looked at the tests, but I think it is not a problem to run
> compile-only tests with both gcc and g++. 

compile-time tests are not always sufficient.

The __builtin_shuffle tests are spread in:
gcc.dg{,/torture}
gcc.target/{i386,powerpc}
gcc.c-torture/{compile,execute}

I assume the tests in gcc.dg can move to c-c++-common. The target tests should
stay in target. Not sure about gcc.c-torture.

But one interesting thing to test is if the front-end passes the arguments as
constants and thus the backend can use specialized code instead of the slow
generic one. And this kind of test seems necessarily target-specific. Bah, I
guess I shouldn't ask for too much and moving the gcc.dg tests would be enough.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (22 preceding siblings ...)
  2012-04-24 11:59 ` marc.glisse at normalesup dot org
@ 2012-04-30 17:23 ` jason at gcc dot gnu.org
  2012-06-13 15:15 ` ramana at gcc dot gnu.org
                   ` (7 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: jason at gcc dot gnu.org @ 2012-04-30 17:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #24 from Jason Merrill <jason at gcc dot gnu.org> 2012-04-30 17:23:34 UTC ---
Author: jason
Date: Mon Apr 30 17:23:28 2012
New Revision: 186994

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=186994
Log:
    PR c++/51033
gcc/
    * c-typeck.c (build_array_ref): Call
    convert_vector_to_pointer_for_subscript.
gcc/c-family
    * c-common.c (convert_vector_to_pointer_for_subscript): New function.
    * c-common.h (convert_vector_to_pointer_for_subscript): Declare it.
gcc/cp/
    * typeck.c (cp_build_array_ref): Handle VECTOR_TYPE.
    * decl2.c (grok_array_decl): Likewise.

Added:
    trunk/gcc/testsuite/c-c++-common/vector-1.c
      - copied, changed from r186993, trunk/gcc/testsuite/gcc.dg/vector-1.c
    trunk/gcc/testsuite/c-c++-common/vector-2.c
      - copied, changed from r186993, trunk/gcc/testsuite/gcc.dg/vector-2.c
    trunk/gcc/testsuite/c-c++-common/vector-3.c
      - copied, changed from r186993, trunk/gcc/testsuite/gcc.dg/vector-3.c
    trunk/gcc/testsuite/c-c++-common/vector-4.c
      - copied, changed from r186993, trunk/gcc/testsuite/gcc.dg/vector-4.c
    trunk/gcc/testsuite/c-c++-common/vector-init-1.c
      - copied, changed from r186993,
trunk/gcc/testsuite/gcc.dg/vector-init-1.c
    trunk/gcc/testsuite/c-c++-common/vector-init-2.c
      - copied, changed from r186993,
trunk/gcc/testsuite/gcc.dg/vector-init-2.c
    trunk/gcc/testsuite/c-c++-common/vector-subscript-1.c
      - copied, changed from r186993,
trunk/gcc/testsuite/gcc.dg/vector-subscript-1.c
    trunk/gcc/testsuite/c-c++-common/vector-subscript-2.c
      - copied, changed from r186993,
trunk/gcc/testsuite/gcc.dg/vector-subscript-2.c
    trunk/gcc/testsuite/c-c++-common/vector-subscript-3.c
      - copied, changed from r186993,
trunk/gcc/testsuite/gcc.dg/vector-subscript-3.c
    trunk/gcc/testsuite/g++.dg/cpp0x/vt-51314.C
Removed:
    trunk/gcc/testsuite/gcc.dg/vector-1.c
    trunk/gcc/testsuite/gcc.dg/vector-2.c
    trunk/gcc/testsuite/gcc.dg/vector-3.c
    trunk/gcc/testsuite/gcc.dg/vector-4.c
    trunk/gcc/testsuite/gcc.dg/vector-init-1.c
    trunk/gcc/testsuite/gcc.dg/vector-init-2.c
    trunk/gcc/testsuite/gcc.dg/vector-subscript-1.c
    trunk/gcc/testsuite/gcc.dg/vector-subscript-2.c
    trunk/gcc/testsuite/gcc.dg/vector-subscript-3.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/c-family/c-common.h
    trunk/gcc/c-typeck.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl2.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/doc/extend.texi
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (23 preceding siblings ...)
  2012-04-30 17:23 ` jason at gcc dot gnu.org
@ 2012-06-13 15:15 ` ramana at gcc dot gnu.org
  2012-06-14 11:23 ` ramana at gcc dot gnu.org
                   ` (6 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ramana at gcc dot gnu.org @ 2012-06-13 15:15 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ramana at gcc dot gnu.org

--- Comment #25 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> 2012-06-13 15:14:16 UTC ---
(In reply to comment #19)
> Created attachment 27217 [details]
> shuffle
> 
> With this patch, g++ passes the few __builtin_shuffle tests I tried, and
> generates generic code for non-constant indexes and special code for constant
> indexes. I don't really know what to do about the testsuite. The tests exercise
> the backend a lot, and it probably doesn't make sense to run everything with
> both gcc and g++. But we still want to test that g++ accepts the syntax, and
> maybe even that it handles constants well.
> 
> Content of the patch:
> - move c_build_vec_perm_expr to c-common and condition the maybe_const stuff to
> the dialect
> - adapt the C RID_BUILTIN_SHUFFLE parser code to the C++ FE (the 2 are
> different enough that it isn't easy to share)
> - remove the C_ONLY tag from __builtin_shuffle
> 
> As usual, my limited knowledge of the compiler means I may have missed
> fundamental things.

Are you planning on submitting the shuffle patch as well ?


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (24 preceding siblings ...)
  2012-06-13 15:15 ` ramana at gcc dot gnu.org
@ 2012-06-14 11:23 ` ramana at gcc dot gnu.org
  2012-06-15 16:44 ` ramana at gcc dot gnu.org
                   ` (5 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ramana at gcc dot gnu.org @ 2012-06-14 11:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #26 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> 2012-06-14 11:22:26 UTC ---
(In reply to comment #23)
> (In reply to comment #21)
> > What does it mean "exercise the backend a lot"? Do you mean it takes a lot of
> > time?
> 
> I think so.
> 
> > I haven't looked at the tests, but I think it is not a problem to run
> > compile-only tests with both gcc and g++. 
> 
> compile-time tests are not always sufficient.
> 
> The __builtin_shuffle tests are spread in:
> gcc.dg{,/torture}
> gcc.target/{i386,powerpc}
> gcc.c-torture/{compile,execute}
> 
> I assume the tests in gcc.dg can move to c-c++-common. The target tests should
> stay in target. Not sure about gcc.c-torture.
> 
> But one interesting thing to test is if the front-end passes the arguments as
> constants and thus the backend can use specialized code instead of the slow
> generic one. And this kind of test seems necessarily target-specific. Bah, I
> guess I shouldn't ask for too much and moving the gcc.dg tests would be enough.

Patch posted for comments here : 

http://gcc.gnu.org/ml/gcc-patches/2012-06/msg00903.html


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (25 preceding siblings ...)
  2012-06-14 11:23 ` ramana at gcc dot gnu.org
@ 2012-06-15 16:44 ` ramana at gcc dot gnu.org
  2012-06-27 14:20 ` ramana at gcc dot gnu.org
                   ` (4 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ramana at gcc dot gnu.org @ 2012-06-15 16:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #27 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> 2012-06-15 16:43:44 UTC ---
Author: ramana
Date: Fri Jun 15 16:43:36 2012
New Revision: 188671

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188671
Log:

2012-06-15  Marc Glisse  <marc.glisse@inria.fr>

    PR c++/51033
    * c-typeck.c (c_build_vec_perm_expr): Move to c-family/c-common.c.
        * c-tree.h (c_build_vec_perm_expr): Move to c-family/c-common.h.

cp/

2012-06-15  Marc Glisse  <marc.glisse@inria.fr>

    PR c++/51033
    * semantics.c (literal_type_p): Handle VECTOR_TYPE.
        (potential_constant_expression_1): Handle VEC_PERM_EXPR.
        * parser.c (cp_parser_postfix_expression): Handle RID_BUILTIN_SHUFFLE.

c-family
2012-06-15  Marc Glisse  <marc.glisse@inria.fr>

    PR c++/51033
    * c-common.h (c_build_vec_perm_expr): Move decl here.
    * c-common.c (c_build_vec_perm_expr): Move definition
    here.

2012-06-15  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>

    PR c++/51033
    * c-c++-common/torture/vshuf-16.inc: Move from gcc.c-torture/execute/.
    * c-c++-common/torture/vshuf-2.inc: Likewise.
    * c-c++-common/torture/vshuf-4.inc: Likewise.
    * c-c++-common/torture/vshuf-8.inc: Likewise.
    * c-c++-common/torture/vshuf-main.inc: Likewise.
    * c-c++-common/torture/vshuf-v16hi.c: Likewise.
    * c-c++-common/torture/vshuf-v16qi.c: Likewise.
    * c-c++-common/torture/vshuf-v2df.c: Likewise.
    * c-c++-common/torture/vshuf-v2di.c: Likewise.
    * c-c++-common/torture/vshuf-v2sf.c: Likewise.
    * c-c++-common/torture/vshuf-v2si.c: Likewise.
    * c-c++-common/torture/vshuf-v4df.c: Likewise.
    * c-c++-common/torture/vshuf-v4di.c: Likewise.
    * c-c++-common/torture/vshuf-v4hi.c: Likewise.
    * c-c++-common/torture/vshuf-v4sf.c: Likewise.
    * c-c++-common/torture/vshuf-v4si.c: Likewise.
    * c-c++-common/torture/vshuf-v8hi.c: Likewise.
    * c-c++-common/torture/vshuf-v8qi.c: Likewise.
    * c-c++-common/torture/vshuf-v8si.c: Likewise.





Added:
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-16.inc
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-16.inc
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-2.inc
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-2.inc
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-4.inc
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-4.inc
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-8.inc
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-8.inc
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-main.inc
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-main.inc
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-v16hi.c
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v16hi.c
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-v16qi.c
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v16qi.c
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-v2df.c
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v2df.c
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-v2di.c
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v2di.c
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-v2sf.c
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v2sf.c
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-v2si.c
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v2si.c
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-v4df.c
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v4df.c
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-v4di.c
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v4di.c
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-v4hi.c
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v4hi.c
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-v4sf.c
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v4sf.c
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-v4si.c
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v4si.c
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-v8hi.c
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v8hi.c
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-v8qi.c
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v8qi.c
    trunk/gcc/testsuite/c-c++-common/torture/vshuf-v8si.c
      - copied unchanged from r188659,
trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v8si.c
Removed:
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-16.inc
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-2.inc
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-4.inc
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-8.inc
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-main.inc
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v16hi.c
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v16qi.c
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v2df.c
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v2di.c
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v2sf.c
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v2si.c
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v4df.c
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v4di.c
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v4hi.c
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v4sf.c
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v4si.c
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v8hi.c
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v8qi.c
    trunk/gcc/testsuite/gcc.c-torture/execute/vshuf-v8si.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/c-family/c-common.h
    trunk/gcc/c-tree.h
    trunk/gcc/c-typeck.c
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (26 preceding siblings ...)
  2012-06-15 16:44 ` ramana at gcc dot gnu.org
@ 2012-06-27 14:20 ` ramana at gcc dot gnu.org
  2012-08-11 11:27 ` glisse at gcc dot gnu.org
                   ` (3 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ramana at gcc dot gnu.org @ 2012-06-27 14:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #28 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> 2012-06-27 14:19:25 UTC ---
Author: ramana
Date: Wed Jun 27 14:19:17 2012
New Revision: 189017

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189017
Log:

2012-06-27  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>

    PR C++/51033
    * semantics.c (constexpr_call): Fix typo in comment.
    (cxx_eval_vec_perm_expr): New.
    (cxx_eval_constant_expression): Fold VEC_PERM_EXPRs.

2012-06-27  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>

    PR c++/51033.
    * g++.dg/torture/vshuf-16.inc: New test.
    * g++.dg/torture/vshuf-2.inc: New test.
    * g++.dg/torture/vshuf-4.inc: New test.
    * g++.dg/torture/vshuf-8.inc: New test.
    * g++.dg/torture/vshuf-main.inc: New test.
    * g++.dg/torture/vshuf-v16hi.C: New test.
    * g++.dg/torture/vshuf-v16qi.C: New test.
    * g++.dg/torture/vshuf-v2df.C: New test.
    * g++.dg/torture/vshuf-v2di.C: New test.
    * g++.dg/torture/vshuf-v2sf.C: New test.
    * g++.dg/torture/vshuf-v2si.C: New test.
    * g++.dg/torture/vshuf-v4df.C: New test.
    * g++.dg/torture/vshuf-v4di.C: New test.
    * g++.dg/torture/vshuf-v4sf.C: New test.
    * g++.dg/torture/vshuf-v4si.C: New test.
    * g++.dg/torture/vshuf-v8hi.C: New test.
    * g++.dg/torture/vshuf-v8qi.C: New test.
    * g++.dg/torture/vshuf-v8si.C: New test.




Added:
    trunk/gcc/testsuite/g++.dg/torture/vshuf-16.inc
    trunk/gcc/testsuite/g++.dg/torture/vshuf-2.inc
    trunk/gcc/testsuite/g++.dg/torture/vshuf-4.inc
    trunk/gcc/testsuite/g++.dg/torture/vshuf-8.inc
    trunk/gcc/testsuite/g++.dg/torture/vshuf-main.inc
    trunk/gcc/testsuite/g++.dg/torture/vshuf-v16hi.C
    trunk/gcc/testsuite/g++.dg/torture/vshuf-v16qi.C
    trunk/gcc/testsuite/g++.dg/torture/vshuf-v2df.C
    trunk/gcc/testsuite/g++.dg/torture/vshuf-v2di.C
    trunk/gcc/testsuite/g++.dg/torture/vshuf-v2sf.C
    trunk/gcc/testsuite/g++.dg/torture/vshuf-v2si.C
    trunk/gcc/testsuite/g++.dg/torture/vshuf-v4df.C
    trunk/gcc/testsuite/g++.dg/torture/vshuf-v4di.C
    trunk/gcc/testsuite/g++.dg/torture/vshuf-v4sf.C
    trunk/gcc/testsuite/g++.dg/torture/vshuf-v4si.C
    trunk/gcc/testsuite/g++.dg/torture/vshuf-v8hi.C
    trunk/gcc/testsuite/g++.dg/torture/vshuf-v8qi.C
    trunk/gcc/testsuite/g++.dg/torture/vshuf-v8si.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (27 preceding siblings ...)
  2012-06-27 14:20 ` ramana at gcc dot gnu.org
@ 2012-08-11 11:27 ` glisse at gcc dot gnu.org
  2013-02-17 14:42 ` linux at carewolf dot com
                   ` (2 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: glisse at gcc dot gnu.org @ 2012-08-11 11:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |glisse at gcc dot gnu.org
         Resolution|                            |FIXED

--- Comment #29 from Marc Glisse <glisse at gcc dot gnu.org> 2012-08-11 11:26:40 UTC ---
I guess both subscript and shuffle are in, so I can close. There is already PR
53094 to track the constexpr issues.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (28 preceding siblings ...)
  2012-08-11 11:27 ` glisse at gcc dot gnu.org
@ 2013-02-17 14:42 ` linux at carewolf dot com
  2013-02-17 15:04 ` glisse at gcc dot gnu.org
  2013-02-17 15:24 ` linux at carewolf dot com
  31 siblings, 0 replies; 33+ messages in thread
From: linux at carewolf dot com @ 2013-02-17 14:42 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

Allan Jensen <linux at carewolf dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |linux at carewolf dot com

--- Comment #30 from Allan Jensen <linux at carewolf dot com> 2013-02-17 14:41:52 UTC ---
(In reply to comment #3)
> All vector support should also be in the C++ front-end.  Can you give an
> example of something which does not work?  Templates with vectors work already
> too.

Another example is binary operators between scalar and vectors. In C the scalar
is automatically treated as a vector, but in C++ it results in a type error.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (29 preceding siblings ...)
  2013-02-17 14:42 ` linux at carewolf dot com
@ 2013-02-17 15:04 ` glisse at gcc dot gnu.org
  2013-02-17 15:24 ` linux at carewolf dot com
  31 siblings, 0 replies; 33+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-02-17 15:04 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #31 from Marc Glisse <glisse at gcc dot gnu.org> 2013-02-17 15:04:15 UTC ---
(In reply to comment #30)
> Another example is binary operators between scalar and vectors. In C the scalar
> is automatically treated as a vector, but in C++ it results in a type error.

That's been fixed already. I think the C++ front-end currently (4.8) supports
_more_ operations on vectors than the C front-end (in particular ?: ).


^ permalink raw reply	[flat|nested] 33+ messages in thread

* [Bug c++/51033] generic vector subscript and shuffle support was not added to C++
  2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
                   ` (30 preceding siblings ...)
  2013-02-17 15:04 ` glisse at gcc dot gnu.org
@ 2013-02-17 15:24 ` linux at carewolf dot com
  31 siblings, 0 replies; 33+ messages in thread
From: linux at carewolf dot com @ 2013-02-17 15:24 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51033

--- Comment #32 from Allan Jensen <linux at carewolf dot com> 2013-02-17 15:23:49 UTC ---
(In reply to comment #31)
> (In reply to comment #30)
> > Another example is binary operators between scalar and vectors. In C the scalar
> > is automatically treated as a vector, but in C++ it results in a type error.
> 
> That's been fixed already. I think the C++ front-end currently (4.8) supports
> _more_ operations on vectors than the C front-end (in particular ?: ).

Ah, right. I was testing with the wrong compiler. For simplicity I will just
restrict our use of vector extensions to g++ >=4.8. Thanks for the great work.
Looking forward to 4.8.0.


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2013-02-17 15:24 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-08 16:39 [Bug c++/51033] New: Partial vector extension support marc.glisse at normalesup dot org
2011-11-08 17:10 ` [Bug c++/51033] " rguenth at gcc dot gnu.org
2011-11-08 17:21 ` marc.glisse at normalesup dot org
2011-11-08 22:18 ` pinskia at gcc dot gnu.org
2011-11-08 22:19 ` marc.glisse at normalesup dot org
2011-11-08 22:31 ` [Bug c++/51033] [4.7 Regression] recent vector support was not added to C++ pinskia at gcc dot gnu.org
2011-11-08 22:34 ` marc.glisse at normalesup dot org
2011-11-09  9:41 ` [Bug c++/51033] generic vector subscript and shuffle " rguenth at gcc dot gnu.org
2011-11-09 10:42 ` jakub at gcc dot gnu.org
2011-12-29 10:32 ` paolo.carlini at oracle dot com
2012-04-17 10:23 ` marc.glisse at normalesup dot org
2012-04-17 10:56 ` manu at gcc dot gnu.org
2012-04-17 12:01 ` marc.glisse at normalesup dot org
2012-04-17 12:16 ` manu at gcc dot gnu.org
2012-04-17 13:10 ` marc.glisse at normalesup dot org
2012-04-17 13:26 ` manu at gcc dot gnu.org
2012-04-17 14:01 ` marc.glisse at normalesup dot org
2012-04-17 14:20 ` manu at gcc dot gnu.org
2012-04-17 16:47 ` marc.glisse at normalesup dot org
2012-04-22 10:32 ` marc.glisse at normalesup dot org
2012-04-22 13:22 ` marc.glisse at normalesup dot org
2012-04-22 14:57 ` manu at gcc dot gnu.org
2012-04-22 15:10 ` marc.glisse at normalesup dot org
2012-04-24 11:59 ` marc.glisse at normalesup dot org
2012-04-30 17:23 ` jason at gcc dot gnu.org
2012-06-13 15:15 ` ramana at gcc dot gnu.org
2012-06-14 11:23 ` ramana at gcc dot gnu.org
2012-06-15 16:44 ` ramana at gcc dot gnu.org
2012-06-27 14:20 ` ramana at gcc dot gnu.org
2012-08-11 11:27 ` glisse at gcc dot gnu.org
2013-02-17 14:42 ` linux at carewolf dot com
2013-02-17 15:04 ` glisse at gcc dot gnu.org
2013-02-17 15:24 ` linux at carewolf dot com

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).