Re: Vector Comparison patch

2011-10-04 Thread Georg-Johann Lay
Jakub Jelinek schrieb: > On Tue, Oct 04, 2011 at 11:32:37AM +0200, Georg-Johann Lay wrote: >> The patch from >> http://gcc.gnu.org/ml/gcc-patches/2011-09/msg02060.html >> http://gcc.gnu.org/ml/gcc-patches/2011-09/txt00337.txt >> works for me. >> >> If it's ok from maintainer I can apply it for

Re: Vector Comparison patch

2011-10-04 Thread Jakub Jelinek
On Tue, Oct 04, 2011 at 11:32:37AM +0200, Georg-Johann Lay wrote: > The patch from > http://gcc.gnu.org/ml/gcc-patches/2011-09/msg02060.html > http://gcc.gnu.org/ml/gcc-patches/2011-09/txt00337.txt > works for me. > > If it's ok from maintainer I can apply it for you. It is fine with a suitab

Re: Vector Comparison patch

2011-10-04 Thread Georg-Johann Lay
Artem Shinkarov schrieb: > On Fri, Sep 30, 2011 at 4:54 PM, Jakub Jelinek wrote: >> On Fri, Sep 30, 2011 at 04:48:41PM +0100, Artem Shinkarov wrote: >>> Most likely we can. The question is what do we really want to check >>> with this test. My intention was to check that a programmer can >>> stati

Re: Vector Comparison patch

2011-09-30 Thread Georg-Johann Lay
Artem Shinkarov schrieb: On Fri, Sep 30, 2011 at 4:54 PM, Jakub Jelinek wrote: On Fri, Sep 30, 2011 at 04:48:41PM +0100, Artem Shinkarov wrote: Most likely we can. The question is what do we really want to check with this test. My intention was to check that a programmer can statically get c

Re: Vector Comparison patch

2011-09-30 Thread Artem Shinkarov
On Fri, Sep 30, 2011 at 4:54 PM, Jakub Jelinek wrote: > On Fri, Sep 30, 2011 at 04:48:41PM +0100, Artem Shinkarov wrote: >> Most likely we can. The question is what do we really want to check >> with this test. My intention was to check that a programmer can >> statically get correspondence of the

Re: Vector Comparison patch

2011-09-30 Thread Jakub Jelinek
On Fri, Sep 30, 2011 at 04:48:41PM +0100, Artem Shinkarov wrote: > Most likely we can. The question is what do we really want to check > with this test. My intention was to check that a programmer can > statically get correspondence of the types, in a sense that sizeof > (float) == sizeof (int) and

Re: Vector Comparison patch

2011-09-30 Thread Artem Shinkarov
On Fri, Sep 30, 2011 at 4:43 PM, Jakub Jelinek wrote: > On Fri, Sep 30, 2011 at 05:36:47PM +0200, Georg-Johann Lay wrote: >> >> The target has >> >> >> >> 2 = sizeof (short) >> >> 2 = sizeof (int) >> >> 4 = sizeof (long int) >> >> 8 = sizeof (long long int) >> >> >> >> Could you fix that? I.e. par

Re: Vector Comparison patch

2011-09-30 Thread Jakub Jelinek
On Fri, Sep 30, 2011 at 05:36:47PM +0200, Georg-Johann Lay wrote: > >> The target has > >> > >> 2 = sizeof (short) > >> 2 = sizeof (int) > >> 4 = sizeof (long int) > >> 8 = sizeof (long long int) > >> > >> Could you fix that? I.e. parametrize sizeof(int) out or skip the test by > >> means of > >>

Re: Vector Comparison patch

2011-09-30 Thread Georg-Johann Lay
Artem Shinkarov schrieb: > On Fri, Sep 30, 2011 at 4:01 PM, Georg-Johann Lay wrote: >> Artem Shinkarov schrieb: >>> Here is a new version of the patch which considers the changes from >>> 2011-09-02 Richard Guenther >>> >>> >>> ChangeLog >>> >>> 20011-09-06 Artjoms Sinkarovs >>> >>>gcc/

Re: Vector Comparison patch

2011-09-30 Thread Artem Shinkarov
On Fri, Sep 30, 2011 at 4:01 PM, Georg-Johann Lay wrote: > Artem Shinkarov schrieb: >> Here is a new version of the patch which considers the changes from >> 2011-09-02  Richard Guenther >> >> >> ChangeLog >> >> 20011-09-06 Artjoms Sinkarovs >> >>        gcc/ >>        * fold-const.c (constant_bo

Re: Vector Comparison patch

2011-09-30 Thread Georg-Johann Lay
Artem Shinkarov schrieb: > Here is a new version of the patch which considers the changes from > 2011-09-02 Richard Guenther > > > ChangeLog > > 20011-09-06 Artjoms Sinkarovs > >gcc/ >* fold-const.c (constant_boolean_node): Adjust the meaning >of boolean for vector typ

Re: Vector Comparison patch

2011-09-30 Thread Matthew Gretton-Dann
On 29/09/11 12:27, Richard Guenther wrote: On Thu, Sep 29, 2011 at 12:00 PM, Richard Guenther wrote: On Wed, Sep 28, 2011 at 4:23 PM, Richard Guenther wrote: On Mon, Sep 26, 2011 at 5:43 PM, Richard Guenther wrote: On Mon, Sep 26, 2011 at 4:25 PM, Richard Guenther wrote: On Wed, Sep 7

Re: Vector Comparison patch

2011-09-29 Thread Richard Guenther
On Thu, Sep 29, 2011 at 12:00 PM, Richard Guenther wrote: > On Wed, Sep 28, 2011 at 4:23 PM, Richard Guenther > wrote: >> On Mon, Sep 26, 2011 at 5:43 PM, Richard Guenther >> wrote: >>> On Mon, Sep 26, 2011 at 4:25 PM, Richard Guenther >>> wrote: On Wed, Sep 7, 2011 at 5:06 PM, Joseph S. M

Re: Vector Comparison patch

2011-09-29 Thread Richard Guenther
On Wed, Sep 28, 2011 at 4:23 PM, Richard Guenther wrote: > On Mon, Sep 26, 2011 at 5:43 PM, Richard Guenther > wrote: >> On Mon, Sep 26, 2011 at 4:25 PM, Richard Guenther >> wrote: >>> On Wed, Sep 7, 2011 at 5:06 PM, Joseph S. Myers >>> wrote: This looks like it has the same issue with ma

Re: Vector Comparison patch

2011-09-28 Thread Richard Guenther
On Mon, Sep 26, 2011 at 5:43 PM, Richard Guenther wrote: > On Mon, Sep 26, 2011 at 4:25 PM, Richard Guenther > wrote: >> On Wed, Sep 7, 2011 at 5:06 PM, Joseph S. Myers >> wrote: >>> This looks like it has the same issue with maybe needing to use >>> TYPE_MAIN_VARIANT in type comparisons as the

Re: Vector Comparison patch

2011-09-26 Thread Richard Guenther
On Mon, Sep 26, 2011 at 4:25 PM, Richard Guenther wrote: > On Wed, Sep 7, 2011 at 5:06 PM, Joseph S. Myers > wrote: >> This looks like it has the same issue with maybe needing to use >> TYPE_MAIN_VARIANT in type comparisons as the shuffle patch. > > I don't think so, we move qualifiers to the ve

Re: Vector Comparison patch

2011-09-26 Thread Richard Guenther
On Wed, Sep 7, 2011 at 5:06 PM, Joseph S. Myers wrote: > This looks like it has the same issue with maybe needing to use > TYPE_MAIN_VARIANT in type comparisons as the shuffle patch. I don't think so, we move qualifiers to the vector type from the element type in make_vector_type and the tests on

Re: Vector Comparison patch

2011-09-16 Thread Richard Henderson
On 08/29/2011 04:41 AM, Paolo Bonzini wrote: > The definition in OpenCL makes zero sense to me. For byte operands > it is custom-tailored after the SSE PMOVMSKB instruction, but there > is no PMOVMSKW/PMOVMSKD instruction so you would need very slow bit > shift operations before PMOVMSK. On the o

Re: Vector Comparison patch

2011-09-08 Thread Uros Bizjak
On Thu, Sep 8, 2011 at 2:41 PM, Richard Guenther wrote: >> All the rest is adjusted in the new version of the patch you can find >> in the attachment. >> >> ChangLog >> >> >> 20011-09-06 Artjoms Sinkarovs >> >>      gcc/ >>      * expr.c (do_store_flag): Expand vector comparison by >>      build

Re: Vector Comparison patch

2011-09-08 Thread Richard Guenther
On Thu, Sep 8, 2011 at 2:41 PM, Richard Guenther wrote: > On Wed, Sep 7, 2011 at 3:15 PM, Artem Shinkarov > wrote: >> On Tue, Sep 6, 2011 at 3:56 PM, Richard Guenther >> wrote: >>> On Tue, Sep 6, 2011 at 4:50 PM, Artem Shinkarov >>> wrote: Here is a new version of the patch which considers

Re: Vector Comparison patch

2011-09-08 Thread Richard Guenther
On Wed, Sep 7, 2011 at 3:15 PM, Artem Shinkarov wrote: > On Tue, Sep 6, 2011 at 3:56 PM, Richard Guenther > wrote: >> On Tue, Sep 6, 2011 at 4:50 PM, Artem Shinkarov >> wrote: >>> Here is a new version of the patch which considers the changes from >>> 2011-09-02  Richard Guenther >>> >>> >>> Cha

Re: Vector Comparison patch

2011-09-07 Thread Joseph S. Myers
This looks like it has the same issue with maybe needing to use TYPE_MAIN_VARIANT in type comparisons as the shuffle patch. -- Joseph S. Myers jos...@codesourcery.com

Re: Vector Comparison patch

2011-09-07 Thread Artem Shinkarov
On Tue, Sep 6, 2011 at 3:56 PM, Richard Guenther wrote: > On Tue, Sep 6, 2011 at 4:50 PM, Artem Shinkarov > wrote: >> Here is a new version of the patch which considers the changes from >> 2011-09-02  Richard Guenther >> >> >> ChangeLog >> >> 20011-09-06 Artjoms Sinkarovs >> >>       gcc/ >>    

Re: Vector Comparison patch

2011-09-06 Thread Richard Guenther
On Tue, Sep 6, 2011 at 4:50 PM, Artem Shinkarov wrote: > Here is a new version of the patch which considers the changes from > 2011-09-02  Richard Guenther > > > ChangeLog > > 20011-09-06 Artjoms Sinkarovs > >       gcc/ >       * fold-const.c (constant_boolean_node): Adjust the meaning >       o

Re: Vector Comparison patch

2011-09-06 Thread Artem Shinkarov
Here is a new version of the patch which considers the changes from 2011-09-02 Richard Guenther ChangeLog 20011-09-06 Artjoms Sinkarovs gcc/ * fold-const.c (constant_boolean_node): Adjust the meaning of boolean for vector types: true = {-1,..}, false = {0,..}. (fol

Re: Vector Comparison patch

2011-08-29 Thread Richard Guenther
On Mon, Aug 29, 2011 at 2:09 PM, Richard Guenther wrote: > On Mon, Aug 22, 2011 at 9:50 PM, Uros Bizjak wrote: >> On Mon, Aug 22, 2011 at 5:34 PM, Richard Guenther >> wrote: >> In this case it is simple to analyse that a is a comparison, but you cannot embed the operations of a into VE

Re: Vector Comparison patch

2011-08-29 Thread Richard Guenther
On Mon, Aug 22, 2011 at 9:50 PM, Uros Bizjak wrote: > On Mon, Aug 22, 2011 at 5:34 PM, Richard Guenther > wrote: > >>> In this case it is simple to analyse that a is a comparison, but you >>> cannot embed the operations of a into VEC_COND_EXPR. >> >> Sure, but if the above is C source the fronten

Re: Vector Comparison patch

2011-08-29 Thread Paolo Bonzini
On 08/18/2011 11:23 AM, Richard Guenther wrote: Yeah, well. That's really a question for language lawyers;) I agree that it would be nice to have mask ? val0 : val1 behave "the same" for scalars and vectors. The question is whether for vectors you define it on the bit-level (which makes it eq

Re: Vector Comparison patch

2011-08-29 Thread Richard Guenther
On Sat, Aug 27, 2011 at 3:39 AM, Artem Shinkarov wrote: > Hi > > Here is a patch with vector comparison only. > Comparison is expanded using VEC_COND_EXPR, conversions between the > different types inside the VEC_COND_EXPR are happening in optabs.c. I have split out the middle-end infrastructure

Re: Vector Comparison patch

2011-08-26 Thread Artem Shinkarov
Hi Here is a patch with vector comparison only. Comparison is expanded using VEC_COND_EXPR, conversions between the different types inside the VEC_COND_EXPR are happening in optabs.c. The comparison generally works, however, the x86 backend does not recognize vectors of all 1s of type float and d

Re: Vector Comparison patch

2011-08-25 Thread Richard Guenther
On Thu, Aug 25, 2011 at 3:15 PM, Artem Shinkarov wrote: > On Thu, Aug 25, 2011 at 2:00 PM, Richard Guenther > wrote: >> On Thu, Aug 25, 2011 at 2:45 PM, Artem Shinkarov >> wrote: >>> On Thu, Aug 25, 2011 at 12:39 PM, Richard Guenther >>> wrote: On Thu, Aug 25, 2011 at 1:07 PM, Artem Shinka

Re: Vector Comparison patch

2011-08-25 Thread Artem Shinkarov
On Thu, Aug 25, 2011 at 2:00 PM, Richard Guenther wrote: > On Thu, Aug 25, 2011 at 2:45 PM, Artem Shinkarov > wrote: >> On Thu, Aug 25, 2011 at 12:39 PM, Richard Guenther >> wrote: >>> On Thu, Aug 25, 2011 at 1:07 PM, Artem Shinkarov >>> wrote: On Thu, Aug 25, 2011 at 11:09 AM, Richard Gue

Re: Vector Comparison patch

2011-08-25 Thread Richard Guenther
On Thu, Aug 25, 2011 at 2:45 PM, Artem Shinkarov wrote: > On Thu, Aug 25, 2011 at 12:39 PM, Richard Guenther > wrote: >> On Thu, Aug 25, 2011 at 1:07 PM, Artem Shinkarov >> wrote: >>> On Thu, Aug 25, 2011 at 11:09 AM, Richard Guenther >>> wrote: On Thu, Aug 25, 2011 at 8:20 AM, Artem Shink

Re: Vector Comparison patch

2011-08-25 Thread Artem Shinkarov
On Thu, Aug 25, 2011 at 12:39 PM, Richard Guenther wrote: > On Thu, Aug 25, 2011 at 1:07 PM, Artem Shinkarov > wrote: >> On Thu, Aug 25, 2011 at 11:09 AM, Richard Guenther >> wrote: >>> On Thu, Aug 25, 2011 at 8:20 AM, Artem Shinkarov >>> wrote: Here is a cleaned-up patch without the hook.

Re: Vector Comparison patch

2011-08-25 Thread Richard Guenther
On Thu, Aug 25, 2011 at 1:07 PM, Artem Shinkarov wrote: > On Thu, Aug 25, 2011 at 11:09 AM, Richard Guenther > wrote: >> On Thu, Aug 25, 2011 at 8:20 AM, Artem Shinkarov >> wrote: >>> Here is a cleaned-up patch without the hook. Mostly it works in a way >>> we discussed. >>> >>> So I think it is

Re: Vector Comparison patch

2011-08-25 Thread Artem Shinkarov
On Thu, Aug 25, 2011 at 11:09 AM, Richard Guenther wrote: > On Thu, Aug 25, 2011 at 8:20 AM, Artem Shinkarov > wrote: >> Here is a cleaned-up patch without the hook. Mostly it works in a way >> we discussed. >> >> So I think it is a right time to do something about vcond patterns, >> which would

Re: Vector Comparison patch

2011-08-25 Thread Richard Guenther
On Thu, Aug 25, 2011 at 8:20 AM, Artem Shinkarov wrote: > Here is a cleaned-up patch without the hook. Mostly it works in a way > we discussed. > > So I think it is a right time to do something about vcond patterns, > which would allow me to get rid of conversions that I need to put all > over the

Re: Vector Comparison patch

2011-08-25 Thread Artem Shinkarov
On Thu, Aug 25, 2011 at 8:34 AM, Richard Guenther wrote: > On Thu, Aug 25, 2011 at 8:20 AM, Artem Shinkarov > wrote: >> Here is a cleaned-up patch without the hook. Mostly it works in a way >> we discussed. >> >> So I think it is a right time to do something about vcond patterns, >> which would a

Re: Vector Comparison patch

2011-08-25 Thread Richard Guenther
On Thu, Aug 25, 2011 at 8:20 AM, Artem Shinkarov wrote: > Here is a cleaned-up patch without the hook. Mostly it works in a way > we discussed. > > So I think it is a right time to do something about vcond patterns, > which would allow me to get rid of conversions that I need to put all > over the

Re: Vector Comparison patch

2011-08-23 Thread Artem Shinkarov
On Tue, Aug 23, 2011 at 12:23 PM, Richard Guenther wrote: > On Tue, Aug 23, 2011 at 1:11 PM, Artem Shinkarov > wrote: >> On Tue, Aug 23, 2011 at 11:56 AM, Richard Guenther >> wrote: >>> On Tue, Aug 23, 2011 at 12:45 PM, Artem Shinkarov >>> wrote: I'm confused. There is a set of proble

Re: Vector Comparison patch

2011-08-23 Thread Richard Guenther
On Tue, Aug 23, 2011 at 1:11 PM, Artem Shinkarov wrote: > On Tue, Aug 23, 2011 at 11:56 AM, Richard Guenther > wrote: >> On Tue, Aug 23, 2011 at 12:45 PM, Artem Shinkarov >> wrote: >>> I'm confused. >>> There is a set of problems which are tightly connected and you address >>> only one one of th

Re: Vector Comparison patch

2011-08-23 Thread Artem Shinkarov
Sorry, not rhs = gimplify_build3 (gsi, VEC_COND_EXPR, a, b, {-1}, {0}> but rather rhs = gimplify_build3 (gsi, VEC_COND_EXPR, build2 (GT_EXPR, type, a, b), {-1}, {0}> Artem.

Re: Vector Comparison patch

2011-08-23 Thread Artem Shinkarov
On Tue, Aug 23, 2011 at 11:56 AM, Richard Guenther wrote: > On Tue, Aug 23, 2011 at 12:45 PM, Artem Shinkarov > wrote: >> On Tue, Aug 23, 2011 at 11:33 AM, Richard Guenther >> wrote: >>> On Tue, Aug 23, 2011 at 12:24 PM, Artem Shinkarov >>> wrote: On Tue, Aug 23, 2011 at 11:08 AM, Richard

Re: Vector Comparison patch

2011-08-23 Thread Richard Guenther
On Tue, Aug 23, 2011 at 12:45 PM, Artem Shinkarov wrote: > On Tue, Aug 23, 2011 at 11:33 AM, Richard Guenther > wrote: >> On Tue, Aug 23, 2011 at 12:24 PM, Artem Shinkarov >> wrote: >>> On Tue, Aug 23, 2011 at 11:08 AM, Richard Guenther >>> wrote: On Tue, Aug 23, 2011 at 11:44 AM, Artem Sh

Re: Vector Comparison patch

2011-08-23 Thread Artem Shinkarov
On Tue, Aug 23, 2011 at 11:33 AM, Richard Guenther wrote: > On Tue, Aug 23, 2011 at 12:24 PM, Artem Shinkarov > wrote: >> On Tue, Aug 23, 2011 at 11:08 AM, Richard Guenther >> wrote: >>> On Tue, Aug 23, 2011 at 11:44 AM, Artem Shinkarov >>> wrote: On Tue, Aug 23, 2011 at 9:17 AM, Richard G

Re: Vector Comparison patch

2011-08-23 Thread Richard Guenther
On Tue, Aug 23, 2011 at 12:24 PM, Artem Shinkarov wrote: > On Tue, Aug 23, 2011 at 11:08 AM, Richard Guenther > wrote: >> On Tue, Aug 23, 2011 at 11:44 AM, Artem Shinkarov >> wrote: >>> On Tue, Aug 23, 2011 at 9:17 AM, Richard Guenther >>> wrote: On Mon, Aug 22, 2011 at 11:11 PM, Artem Shi

Re: Vector Comparison patch

2011-08-23 Thread Artem Shinkarov
On Tue, Aug 23, 2011 at 11:08 AM, Richard Guenther wrote: > On Tue, Aug 23, 2011 at 11:44 AM, Artem Shinkarov > wrote: >> On Tue, Aug 23, 2011 at 9:17 AM, Richard Guenther >> wrote: >>> On Mon, Aug 22, 2011 at 11:11 PM, Artem Shinkarov >>> wrote: I'll just send you my current version. I'll

Re: Vector Comparison patch

2011-08-23 Thread Richard Guenther
On Tue, Aug 23, 2011 at 11:44 AM, Artem Shinkarov wrote: > On Tue, Aug 23, 2011 at 9:17 AM, Richard Guenther > wrote: >> On Mon, Aug 22, 2011 at 11:11 PM, Artem Shinkarov >> wrote: >>> I'll just send you my current version. I'll be a little bit more specific. >>> >>> The problem starts when you

Re: Vector Comparison patch

2011-08-23 Thread Artem Shinkarov
On Tue, Aug 23, 2011 at 9:17 AM, Richard Guenther wrote: > On Mon, Aug 22, 2011 at 11:11 PM, Artem Shinkarov > wrote: >> I'll just send you my current version. I'll be a little bit more specific. >> >> The problem starts when you try to lower the following expression: >> >> x = a > b; >> x1 = vco

Re: Vector Comparison patch

2011-08-23 Thread Richard Guenther
On Mon, Aug 22, 2011 at 11:11 PM, Artem Shinkarov wrote: > I'll just send you my current version. I'll be a little bit more specific. > > The problem starts when you try to lower the following expression: > > x = a > b; > x1 = vcond > vcond > > Now, you go from the beginning to the end of the bl

Re: Vector Comparison patch

2011-08-22 Thread Richard Guenther
On Mon, Aug 22, 2011 at 10:49 PM, Artem Shinkarov wrote: > On Mon, Aug 22, 2011 at 9:42 PM, Richard Guenther > wrote: >> On Mon, Aug 22, 2011 at 5:58 PM, Artem Shinkarov >> wrote: >>> On Mon, Aug 22, 2011 at 4:50 PM, Richard Guenther >>> wrote: On Mon, Aug 22, 2011 at 5:43 PM, Artem Shinka

Re: Vector Comparison patch

2011-08-22 Thread Artem Shinkarov
On Mon, Aug 22, 2011 at 9:42 PM, Richard Guenther wrote: > On Mon, Aug 22, 2011 at 5:58 PM, Artem Shinkarov > wrote: >> On Mon, Aug 22, 2011 at 4:50 PM, Richard Guenther >> wrote: >>> On Mon, Aug 22, 2011 at 5:43 PM, Artem Shinkarov >>> wrote: On Mon, Aug 22, 2011 at 4:34 PM, Richard Guent

Re: Vector Comparison patch

2011-08-22 Thread Artem Shinkarov
On Mon, Aug 22, 2011 at 8:50 PM, Uros Bizjak wrote: > On Mon, Aug 22, 2011 at 5:34 PM, Richard Guenther > wrote: > >>> In this case it is simple to analyse that a is a comparison, but you >>> cannot embed the operations of a into VEC_COND_EXPR. >> >> Sure, but if the above is C source the fronten

Re: Vector Comparison patch

2011-08-22 Thread Richard Guenther
On Mon, Aug 22, 2011 at 5:58 PM, Artem Shinkarov wrote: > On Mon, Aug 22, 2011 at 4:50 PM, Richard Guenther > wrote: >> On Mon, Aug 22, 2011 at 5:43 PM, Artem Shinkarov >> wrote: >>> On Mon, Aug 22, 2011 at 4:34 PM, Richard Guenther >>> wrote: On Mon, Aug 22, 2011 at 5:21 PM, Artem Shinkar

Re: Vector Comparison patch

2011-08-22 Thread Richard Guenther
On Mon, Aug 22, 2011 at 9:50 PM, Uros Bizjak wrote: > On Mon, Aug 22, 2011 at 5:34 PM, Richard Guenther > wrote: > >>> In this case it is simple to analyse that a is a comparison, but you >>> cannot embed the operations of a into VEC_COND_EXPR. >> >> Sure, but if the above is C source the fronten

Re: Vector Comparison patch

2011-08-22 Thread Uros Bizjak
On Mon, Aug 22, 2011 at 5:34 PM, Richard Guenther wrote: >> In this case it is simple to analyse that a is a comparison, but you >> cannot embed the operations of a into VEC_COND_EXPR. > > Sure, but if the above is C source the frontend would generate > res = a != 0 ? v0 : v1; initially.  An opti

Re: Vector Comparison patch

2011-08-22 Thread Artem Shinkarov
On Mon, Aug 22, 2011 at 4:50 PM, Richard Guenther wrote: > On Mon, Aug 22, 2011 at 5:43 PM, Artem Shinkarov > wrote: >> On Mon, Aug 22, 2011 at 4:34 PM, Richard Guenther >> wrote: >>> On Mon, Aug 22, 2011 at 5:21 PM, Artem Shinkarov >>> wrote: On Mon, Aug 22, 2011 at 4:01 PM, Richard Guent

Re: Vector Comparison patch

2011-08-22 Thread Richard Guenther
On Mon, Aug 22, 2011 at 5:43 PM, Artem Shinkarov wrote: > On Mon, Aug 22, 2011 at 4:34 PM, Richard Guenther > wrote: >> On Mon, Aug 22, 2011 at 5:21 PM, Artem Shinkarov >> wrote: >>> On Mon, Aug 22, 2011 at 4:01 PM, Richard Guenther >>> wrote: On Mon, Aug 22, 2011 at 2:05 PM, Artem Shinkar

Re: Vector Comparison patch

2011-08-22 Thread Artem Shinkarov
On Mon, Aug 22, 2011 at 4:34 PM, Richard Guenther wrote: > On Mon, Aug 22, 2011 at 5:21 PM, Artem Shinkarov > wrote: >> On Mon, Aug 22, 2011 at 4:01 PM, Richard Guenther >> wrote: >>> On Mon, Aug 22, 2011 at 2:05 PM, Artem Shinkarov >>> wrote: On Mon, Aug 22, 2011 at 12:25 PM, Richard Guen

Re: Vector Comparison patch

2011-08-22 Thread Richard Guenther
On Mon, Aug 22, 2011 at 5:21 PM, Artem Shinkarov wrote: > On Mon, Aug 22, 2011 at 4:01 PM, Richard Guenther > wrote: >> On Mon, Aug 22, 2011 at 2:05 PM, Artem Shinkarov >> wrote: >>> On Mon, Aug 22, 2011 at 12:25 PM, Richard Guenther >>> wrote: On Mon, Aug 22, 2011 at 12:53 AM, Artem Shink

Re: Vector Comparison patch

2011-08-22 Thread Artem Shinkarov
On Mon, Aug 22, 2011 at 4:01 PM, Richard Guenther wrote: > On Mon, Aug 22, 2011 at 2:05 PM, Artem Shinkarov > wrote: >> On Mon, Aug 22, 2011 at 12:25 PM, Richard Guenther >> wrote: >>> On Mon, Aug 22, 2011 at 12:53 AM, Artem Shinkarov >>> wrote: Richard I formalized an approach a

Re: Vector Comparison patch

2011-08-22 Thread Richard Guenther
On Mon, Aug 22, 2011 at 2:05 PM, Artem Shinkarov wrote: > On Mon, Aug 22, 2011 at 12:25 PM, Richard Guenther > wrote: >> On Mon, Aug 22, 2011 at 12:53 AM, Artem Shinkarov >> wrote: >>> Richard >>> >>> I formalized an approach a little-bit, now it works without target >>> hooks, but some polishin

Re: Vector Comparison patch

2011-08-22 Thread Artem Shinkarov
On Mon, Aug 22, 2011 at 12:25 PM, Richard Guenther wrote: > On Mon, Aug 22, 2011 at 12:53 AM, Artem Shinkarov > wrote: >> Richard >> >> I formalized an approach a little-bit, now it works without target >> hooks, but some polishing is still required. I want you to comment on >> the several import

Re: Vector Comparison patch

2011-08-22 Thread Richard Guenther
On Mon, Aug 22, 2011 at 12:53 AM, Artem Shinkarov wrote: > Richard > > I formalized an approach a little-bit, now it works without target > hooks, but some polishing is still required. I want you to comment on > the several important approaches that I use in the patch. > > So how does it work. > 1

Re: Vector Comparison patch

2011-08-20 Thread Uros Bizjak
On Wed, Aug 17, 2011 at 11:49 AM, Richard Guenther wrote: >>> Hm, ok ... let's hope we can sort-out the backend issues before this >>> patch goes in so we can remove this converting stuff. >> >> Hm, I would hope that we could commit this patch even with this issue, >> because my feeling is that t

Re: Vector Comparison patch

2011-08-20 Thread Richard Guenther
On Fri, Aug 19, 2011 at 5:22 PM, Artem Shinkarov wrote: > On Fri, Aug 19, 2011 at 3:54 PM, Richard Guenther > wrote: >> On Fri, Aug 19, 2011 at 2:29 AM, Artem Shinkarov >> wrote: >>> Hi, I had the problem with passing information about single variable >>> from expand_vec_cond_expr optab into ix8

Re: Vector Comparison patch

2011-08-19 Thread Artem Shinkarov
On Fri, Aug 19, 2011 at 3:54 PM, Richard Guenther wrote: > On Fri, Aug 19, 2011 at 2:29 AM, Artem Shinkarov > wrote: >> Hi, I had the problem with passing information about single variable >> from expand_vec_cond_expr optab into ix86_expand_*_vcond. >> >> I looked into it this problem for quite a

Re: Vector Comparison patch

2011-08-19 Thread Richard Guenther
On Fri, Aug 19, 2011 at 2:29 AM, Artem Shinkarov wrote: > Hi, I had the problem with passing information about single variable > from expand_vec_cond_expr optab into ix86_expand_*_vcond. > > I looked into it this problem for quite a while and found a solution. > Now the question if it could be don

Re: Vector Comparison patch

2011-08-18 Thread Artem Shinkarov
Hi, I had the problem with passing information about single variable from expand_vec_cond_expr optab into ix86_expand_*_vcond. I looked into it this problem for quite a while and found a solution. Now the question if it could be done better. First of all the problem: If we represent any vector c

Re: Vector Comparison patch

2011-08-18 Thread Richard Henderson
On 08/18/2011 02:23 AM, Richard Guenther wrote: >>> >> The first one (inefficient) is vec0 > vec1 ? {-1,...} : {0,...} >>> >> The second is vec0 > vec1. expand_vec_cond_expr is stupid, which is >>> >> fine, but it means that we need to construct it carefully. >> > >> > This is still important. > Ye

Re: Vector Comparison patch

2011-08-18 Thread Artem Shinkarov
Richard, I am trying to make sure that when vcond has {-1} and {0} it does not trigger masking. Currently I am doing this: Index: config/i386/i386.c === --- config/i386/i386.c (revision 177665) +++ config/i386/i386.c (working copy)

Re: Vector Comparison patch

2011-08-18 Thread Joseph S. Myers
On Thu, 18 Aug 2011, Artem Shinkarov wrote: > >> +      /* Avoid C_MAYBE_CONST in VEC_COND_EXPR.  */ > >> +      sc = c_fully_fold (ifexp, false, &maybe_const); > >> +      sc = save_expr (sc); > >> +      if (!maybe_const) > >> +     ifexp = c_wrap_maybe_const (sc, true); > >> +      else > >> +

Re: Vector Comparison patch

2011-08-18 Thread Artem Shinkarov
On Wed, Aug 17, 2011 at 10:52 PM, Joseph S. Myers wrote: > On Wed, 17 Aug 2011, Artem Shinkarov wrote: > >> +For the convenience condition in the vector conditional can be just a >> +vector of signed integer type. In that case this vector is implicitly >> +compared with vectors of zeroes. Consider

Re: Vector Comparison patch

2011-08-18 Thread Artem Shinkarov
> Yes.  I think the backends need to handle optimizing this case, > esp. considering targets that do not have instructions to produce > a {-1,...}/{0,...} bitmask from a comparison but produce a vector > of condition codes.  With using vec0 > vec1 ? {-1...} : {0,...} for > mask = vec0 > vec1; we av

Re: Vector Comparison patch

2011-08-18 Thread Richard Guenther
On Wed, Aug 17, 2011 at 8:51 PM, Artem Shinkarov wrote: > On Wed, Aug 17, 2011 at 4:28 PM, Artem Shinkarov > wrote: >> On Wed, Aug 17, 2011 at 3:58 PM, Richard Guenther >> wrote: >>> On Wed, Aug 17, 2011 at 3:30 PM, Artem Shinkarov >>> wrote: Hi Several comments before the new ve

Re: Vector Comparison patch

2011-08-17 Thread Joseph S. Myers
On Wed, 17 Aug 2011, Artem Shinkarov wrote: > +For the convenience condition in the vector conditional can be just a > +vector of signed integer type. In that case this vector is implicitly > +compared with vectors of zeroes. Consider an example: Where is this bit tested in the testcases added?

Re: Vector Comparison patch

2011-08-17 Thread Artem Shinkarov
On Wed, Aug 17, 2011 at 3:58 PM, Richard Guenther wrote: > On Wed, Aug 17, 2011 at 3:30 PM, Artem Shinkarov > wrote: >> Hi >> >> Several comments before the new version of the patch. >> 1) x != x >> I am happy to adjust constant_boolean_node, but look at the code >> around line 9074 in fold-const

Re: Vector Comparison patch

2011-08-17 Thread Richard Guenther
On Wed, Aug 17, 2011 at 3:30 PM, Artem Shinkarov wrote: > Hi > > Several comments before the new version of the patch. > 1) x != x > I am happy to adjust constant_boolean_node, but look at the code > around line 9074 in fold-const.c, you will see that x x > elimination, even with adjusted constan

Re: Vector Comparison patch

2011-08-17 Thread Artem Shinkarov
Hi Several comments before the new version of the patch. 1) x != x I am happy to adjust constant_boolean_node, but look at the code around line 9074 in fold-const.c, you will see that x x elimination, even with adjusted constant_boolean_node, will look about the same as my code. Because I need to

Re: Vector Comparison patch

2011-08-17 Thread Richard Guenther
On Tue, Aug 16, 2011 at 11:12 PM, Artem Shinkarov wrote: > Hi, here is a new version of the patch with the adjustments. > > Two important comments. > 1) At the moment when I expand expression  mask ? vec0 : vec1, I > replace mask with (mask == {-1,-1,..}). The first reason is that > expand_vec_con

Re: Vector Comparison patch

2011-08-17 Thread Richard Guenther
On Tue, Aug 16, 2011 at 6:35 PM, Artem Shinkarov wrote: > On Tue, Aug 16, 2011 at 4:28 PM, Richard Guenther > wrote: Index: gcc/fold-const.c === --- gcc/fold-const.c    (revision 177665) +++ gcc/fold-const.c    (w

Re: Vector Comparison patch

2011-08-16 Thread Artem Shinkarov
> Hi >>>> >>>> Here is a completed version of the vector comparison patch we >>>> discussed a long time ago here: >>>> http://gcc.gnu.org/ml/gcc-patches/2010-08/msg01184.html >>>> >>>> The patch implements vector comparison a

Re: Vector Comparison patch

2011-08-16 Thread Richard Guenther
On Mon, Aug 15, 2011 at 6:58 PM, Artem Shinkarov wrote: > On Mon, Aug 15, 2011 at 3:24 PM, Richard Guenther > wrote: >> On Fri, Aug 12, 2011 at 4:03 AM, Artem Shinkarov >> wrote: >>> Hi >>> >>> Here is a completed version of the vector compariso

Re: Vector Comparison patch

2011-08-15 Thread Artem Shinkarov
On Mon, Aug 15, 2011 at 3:24 PM, Richard Guenther wrote: > On Fri, Aug 12, 2011 at 4:03 AM, Artem Shinkarov > wrote: >> Hi >> >> Here is a completed version of the vector comparison patch we >> discussed a long time ago here: >> http://gcc.gnu.org/ml/gcc-pat

Re: Vector Comparison patch

2011-08-15 Thread Richard Guenther
On Fri, Aug 12, 2011 at 4:03 AM, Artem Shinkarov wrote: > Hi > > Here is a completed version of the vector comparison patch we > discussed a long time ago here: > http://gcc.gnu.org/ml/gcc-patches/2010-08/msg01184.html > > The patch implements vector comparison according to