diff mbox

Vector shuffling

Message ID CABYV9SV3ErQr=dE0tRTN+M__NiX7YLzE+c6XEhu-eHU8SaNr4Q@mail.gmail.com
State New
Headers show

Commit Message

Artem Shinkarov Oct. 3, 2011, 4:43 p.m. UTC
Hi, Richard

There is a problem with the testcases of the patch you have committed
for me. The code in every test-case is doubled. Could you please,
apply the following patch, otherwise it would fail all the tests from
the vector-shuffle-patch would fail.

Also, if it is possible, could you change my name from in the
ChangeLog from "Artem Shinkarov" to "Artjoms Sinkarovs". The last
version is the way I am spelled in the passport, and the name I use in
the ChangeLog.



Thanks,
Artem.


On Mon, Oct 3, 2011 at 4:13 PM, Richard Henderson <rth@redhat.com> wrote:
> On 10/03/2011 05:14 AM, Artem Shinkarov wrote:
>> Hi, can anyone commit it please?
>>
>> Richard?
>> Or may be Richard?
>
> Committed.
>
>
> r~
>

Comments

Richard Henderson Oct. 3, 2011, 5:12 p.m. UTC | #1
On 10/03/2011 09:43 AM, Artem Shinkarov wrote:
> Hi, Richard
> 
> There is a problem with the testcases of the patch you have committed
> for me. The code in every test-case is doubled. Could you please,
> apply the following patch, otherwise it would fail all the tests from
> the vector-shuffle-patch would fail.

Huh.  Dunno what happened there.  Fixed.

> Also, if it is possible, could you change my name from in the
> ChangeLog from "Artem Shinkarov" to "Artjoms Sinkarovs". The last
> version is the way I am spelled in the passport, and the name I use in
> the ChangeLog.

Fixed.


r~
Artem Shinkarov Oct. 3, 2011, 5:21 p.m. UTC | #2
On Mon, Oct 3, 2011 at 6:12 PM, Richard Henderson <rth@redhat.com> wrote:
> On 10/03/2011 09:43 AM, Artem Shinkarov wrote:
>> Hi, Richard
>>
>> There is a problem with the testcases of the patch you have committed
>> for me. The code in every test-case is doubled. Could you please,
>> apply the following patch, otherwise it would fail all the tests from
>> the vector-shuffle-patch would fail.
>
> Huh.  Dunno what happened there.  Fixed.
>

This is a common pattern, when the patch adds new files and you apply
the same patch to the code-base second time. In that case the content
of the files is doubled. This is an annoying feature of svn. May be
there is a solution to the problem, but I never managed to find one.

>> Also, if it is possible, could you change my name from in the
>> ChangeLog from "Artem Shinkarov" to "Artjoms Sinkarovs". The last
>> version is the way I am spelled in the passport, and the name I use in
>> the ChangeLog.
>
> Fixed.

Thank you very much.


Artem.
>
>
> r~
>
diff mbox

Patch

Index: gcc/testsuite/gcc.c-torture/execute/vect-shuffle-1.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/vect-shuffle-1.c	(revision 179464)
+++ gcc/testsuite/gcc.c-torture/execute/vect-shuffle-1.c	(working copy)
@@ -17,55 +17,9 @@  int main (int argc, char *argv[]) {
     /*vector (8, short) v0 = {argc, 1,2,3,4,5,6,7};
     vector (8, short) v1 = {argc, 1,argc,3,4,5,argc,7};
     vector (8, short) v2;
-   
-    vector (8, short) smask = {0,0,1,2,3,4,5,6};
-    
-    v2 = __builtin_shuffle (v0,  smask);
-    shufcompare (short, 8, v2, v0, smask);
-    v2 = __builtin_shuffle (v0, v1);
-    shufcompare (short, 8, v2, v0, v1);
-    v2 = __builtin_shuffle (smask, v0);
-    shufcompare (short, 8, v2, smask, v0);*/
-
-    vector (4, int) i0 = {argc, 1,2,3};
-    vector (4, int) i1 = {argc, 1, argc, 3};
-    vector (4, int) i2;
-
-    vector (4, int) imask = {0,3,2,1};
-
-    /*i2 = __builtin_shuffle (i0, imask);
-    shufcompare (int, 4, i2, i0, imask);*/
-    i2 = __builtin_shuffle (i0, i1);
-    shufcompare (int, 4, i2, i0, i1);
-    
-    i2 = __builtin_shuffle (imask, i0);
-    shufcompare (int, 4, i2, imask, i0);
-    
-    return 0;
-}
-
-#define vector(elcount, type)  \
-__attribute__((vector_size((elcount)*sizeof(type)))) type
-
-#define vidx(type, vec, idx) (*(((type *) &(vec)) + idx))
 
-#define shufcompare(type, count, vres, v0, mask) \
-do { \
-    int __i; \
-    for (__i = 0; __i < count; __i++) { \
-        if (vidx(type, vres, __i) != vidx(type, v0, vidx(type, mask, __i))) \
-            __builtin_abort (); \
-    } \
-} while (0)
-
-
-int main (int argc, char *argv[]) {
-    /*vector (8, short) v0 = {argc, 1,2,3,4,5,6,7};
-    vector (8, short) v1 = {argc, 1,argc,3,4,5,argc,7};
-    vector (8, short) v2;
-   
     vector (8, short) smask = {0,0,1,2,3,4,5,6};
-    
+
     v2 = __builtin_shuffle (v0,  smask);
     shufcompare (short, 8, v2, v0, smask);
     v2 = __builtin_shuffle (v0, v1);
@@ -83,10 +37,10 @@  int main (int argc, char *argv[]) {
     shufcompare (int, 4, i2, i0, imask);*/
     i2 = __builtin_shuffle (i0, i1);
     shufcompare (int, 4, i2, i0, i1);
-    
+
     i2 = __builtin_shuffle (imask, i0);
     shufcompare (int, 4, i2, imask, i0);
-    
+
     return 0;
 }
 
Index: gcc/testsuite/gcc.c-torture/execute/vect-shuffle-2.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/vect-shuffle-2.c	(revision 179464)
+++ gcc/testsuite/gcc.c-torture/execute/vect-shuffle-2.c	(working copy)
@@ -42,47 +42,3 @@  int main (int argc, char *argv[]) {
     return 0;
 }
 
-#define vector(elcount, type)  \
-__attribute__((vector_size((elcount)*sizeof(type)))) type
-
-#define vidx(type, vec, idx) (*(((type *) &(vec)) + idx))
-
-#define shuf2compare(type, count, vres, v0, v1, mask) \
-do { \
-    int __i; \
-    for (__i = 0; __i < count; __i++) { \
-        if (vidx(type, vres, __i) != ((vidx(type, mask, __i) < count) ? \
-                          vidx(type, v0, vidx(type, mask, __i)) :  \
-                          vidx(type, v1, (vidx(type, mask, __i) - count)))) \
-            __builtin_abort (); \
-        } \
-} while (0)
-
-
-int main (int argc, char *argv[]) {
-    vector (8, short) v0 = {5, 5,5,5,5,5,argc,7};
-    vector (8, short) v1 = {argc, 1,8,8,4,9,argc,4};
-    vector (8, short) v2;
-
-    //vector (8, short) mask = {1,2,5,4,3,6,7};
-
-    vector (8, short) mask0 = {0,2,3,1,4,5,6,7};
-    vector (8, short) mask1 = {0,12,3,4,3,0,10,9};
-
-    vector (8, short) mask2 = {0,8,1,9,2,10,3,11};
-
-    v2 = __builtin_shuffle (v0, v1,  mask0);
-    shuf2compare (short, 8, v2, v0, v1, mask0);
-
-    v2 = __builtin_shuffle (v0, v1,  mask1);
-    shuf2compare (short, 8, v2, v0, v1, mask1);
-
-    v2 = __builtin_shuffle (v0, v1,  mask2);
-    shuf2compare (short, 8, v2, v0, v1, mask2);
-
-    v2 = __builtin_shuffle (mask0, mask0,  v0);
-    shuf2compare (short, 8, v2, mask0, mask0, v0);
-
-    return 0;
-}
-
Index: gcc/testsuite/gcc.c-torture/execute/vect-shuffle-3.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/vect-shuffle-3.c	(revision 179464)
+++ gcc/testsuite/gcc.c-torture/execute/vect-shuffle-3.c	(working copy)
@@ -24,43 +24,7 @@  int main (int argc, char *argv[]) {
     vector (8, short) v2;
 
     vector (8, short) mask = {0,0,1,2,3,4,5,6};
-    
-    v2 = f (v0,  mask);
-    shufcompare (short, 8, v2, v0, mask);
-
-    v2 = f (v0, v1);
-    shufcompare (short, 8, v2, v0, v1);
-
-    return 0;
-}
-
-#define vector(elcount, type)  \
-__attribute__((vector_size((elcount)*sizeof(type)))) type
-
-#define vidx(type, vec, idx) (*(((type *) &(vec)) + idx))
 
-#define shufcompare(type, count, vres, v0, mask) \
-do { \
-    int __i; \
-    for (__i = 0; __i < count; __i++) { \
-        if (vidx(type, vres, __i) != vidx(type, v0, vidx(type, mask, __i))) \
-            __builtin_abort (); \
-    } \
-} while (0)
-
-vector (8, short) __attribute__ ((noinline))
-f (vector (8, short) x, vector (8, short) mask) {
-    return __builtin_shuffle (x, mask);
-}
-
-
-int main (int argc, char *argv[]) {
-    vector (8, short) v0 = {argc, 1,2,3,4,5,6,7};
-    vector (8, short) v1 = {argc, 1,argc,3,4,5,argc,7};
-    vector (8, short) v2;
-
-    vector (8, short) mask = {0,0,1,2,3,4,5,6};
-    
     v2 = f (v0,  mask);
     shufcompare (short, 8, v2, v0, mask);
 
Index: gcc/testsuite/gcc.c-torture/execute/vect-shuffle-4.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/vect-shuffle-4.c	(revision 179464)
+++ gcc/testsuite/gcc.c-torture/execute/vect-shuffle-4.c	(working copy)
@@ -28,64 +28,14 @@  int main (int argc, char *argv[]) {
     vector (8, short) v2;
 
     //vector (8, short) mask = {1,2,5,4,3,6,7};
-    
-    vector (8, short) mask0 = {0,2,3,1,4,5,6,7};
-    vector (8, short) mask1 = {0,12,3,4,3,0,10,9};
-    vector (8, short) mask2 = {0,8,1,9,2,10,3,11};
-
-    v2 = f (v0, v1,  mask0);
-    shuf2compare (short, 8, v2, v0, v1, mask0);
- 
-    v2 = f (v0, v1,  mask1);
-    shuf2compare (short, 8, v2, v0, v1, mask1);
-
-    v2 = f (v0, v1,  mask2);
-    shuf2compare (short, 8, v2, v0, v1, mask2);
-
-    v2 = f (mask0, mask0,  v0);
-    shuf2compare (short, 8, v2, mask0, mask0, v0);
-
-    return 0; 
-}
-
-#define vector(elcount, type)  \
-__attribute__((vector_size((elcount)*sizeof(type)))) type
-
-#define vidx(type, vec, idx) (*(((type *) &(vec)) + idx))
-
-#define shuf2compare(type, count, vres, v0, v1, mask) \
-do { \
-    int __i; \
-    for (__i = 0; __i < count; __i++) { \
-        if (vidx(type, vres, __i) != ((vidx(type, mask, __i) < count) ? \
-                          vidx(type, v0, vidx(type, mask, __i)) :  \
-                          vidx(type, v1, (vidx(type, mask, __i) - count)))) \
-            __builtin_abort (); \
-        } \
-} while (0)
-
-
-vector (8, short) __attribute__ ((noinline))
-f (vector (8, short) x, vector (8, short) y, vector (8, short) mask) {
-    return __builtin_shuffle (x, y, mask);
-}
 
-
-
-int main (int argc, char *argv[]) {
-    vector (8, short) v0 = {argc, 1,2,3,4,5,6,7};
-    vector (8, short) v1 = {argc, 1,argc,3,4,5,argc,7};
-    vector (8, short) v2;
-
-    //vector (8, short) mask = {1,2,5,4,3,6,7};
-    
     vector (8, short) mask0 = {0,2,3,1,4,5,6,7};
     vector (8, short) mask1 = {0,12,3,4,3,0,10,9};
     vector (8, short) mask2 = {0,8,1,9,2,10,3,11};
 
     v2 = f (v0, v1,  mask0);
     shuf2compare (short, 8, v2, v0, v1, mask0);
- 
+
     v2 = f (v0, v1,  mask1);
     shuf2compare (short, 8, v2, v0, v1, mask1);
 
@@ -95,6 +45,6 @@  int main (int argc, char *argv[]) {
     v2 = f (mask0, mask0,  v0);
     shuf2compare (short, 8, v2, mask0, mask0, v0);
 
-    return 0; 
+    return 0;
 }
 
Index: gcc/testsuite/gcc.c-torture/execute/vect-shuffle-5.c
===================================================================
--- gcc/testsuite/gcc.c-torture/execute/vect-shuffle-5.c	(revision 179464)
+++ gcc/testsuite/gcc.c-torture/execute/vect-shuffle-5.c	(working copy)
@@ -30,7 +30,7 @@  do { \
   test_compat_mask (res, c ## vec, mask); \
   test_compat_mask (res, r ## vec, mask); \
   test_compat_mask (res, d ## vec, mask); \
-  test_compat_mask (res, dc ## vec, mask); 
+  test_compat_mask (res, dc ## vec, mask);
 
 #define test_compat(res, vec, mask) \
   test_compat_vec (res, vec, mask); \
@@ -46,72 +46,8 @@  int main (int argc, char *argv[]) {
     register vector (4, int) rvec = {argc, 1,2,3};
     v4si dvec = {argc, 1,2,3};
     v4sicst dcvec = {argc, 1,2,3};
-    
-    vector (4, int) res; 
-    v4si dres;
-    register vector (4, int) rres;
-
-    vector (4, int) mask = {0,3,2,1};
-    const vector (4, int) cmask = {0,3,2,1};
-    register vector (4, int) rmask = {0,3,2,1};
-    v4si dmask = {0,3,2,1};
-    v4sicst dcmask = {0,3,2,1};
-
-    test_compat (res, vec, mask);
-
-    return 0;
-}
-
-/* Test that different type variants are compatible within
-   vector shuffling.  */
 
-#define vector(elcount, type)  \
-__attribute__((vector_size((elcount)*sizeof(type)))) type
-
-#define shufcompare(count, vres, v0, mask) \
-do { \
-    int __i; \
-    for (__i = 0; __i < count; __i++) { \
-        if (vres[__i] != v0[mask[__i]]) \
-            __builtin_abort (); \
-    } \
-} while (0)
-
-#define test_compat_mask(res, vec, mask) \
-  res = __builtin_shuffle (vec, mask); \
-  shufcompare(4, res, vec, mask); \
-  res = __builtin_shuffle (vec, c ## mask); \
-  shufcompare(4, res, vec, c ##  mask); \
-  res = __builtin_shuffle (vec, r ## mask); \
-  shufcompare(4, res, vec, r ##  mask); \
-  res = __builtin_shuffle (vec, d ## mask); \
-  shufcompare(4, res, vec, d ##  mask); \
-  res = __builtin_shuffle (vec, dc ## mask); \
-  shufcompare(4, res, vec, dc ##  mask); \
-
-#define test_compat_vec(res, vec, mask) \
-  test_compat_mask (res, vec, mask); \
-  test_compat_mask (res, c ## vec, mask); \
-  test_compat_mask (res, r ## vec, mask); \
-  test_compat_mask (res, d ## vec, mask); \
-  test_compat_mask (res, dc ## vec, mask); 
-
-#define test_compat(res, vec, mask) \
-  test_compat_vec (res, vec, mask); \
-  test_compat_vec (d ## res, vec, mask); \
-  test_compat_vec (r ## res, vec, mask);
-
-typedef vector (4, int) v4si;
-typedef const vector (4, int) v4sicst;
-
-int main (int argc, char *argv[]) {
-    vector (4, int) vec = {argc, 1,2,3};
-    const vector (4, int) cvec = {argc, 1,2,3};
-    register vector (4, int) rvec = {argc, 1,2,3};
-    v4si dvec = {argc, 1,2,3};
-    v4sicst dcvec = {argc, 1,2,3};
-    
-    vector (4, int) res; 
+    vector (4, int) res;
     v4si dres;
     register vector (4, int) rres;
 
@@ -126,3 +62,4 @@  int main (int argc, char *argv[]) {
     return 0;
 }
 
+