This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
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) All the vector comparisons at the level of type-checker are introduced using VEC_COND_EXPR with constant selection operands being {-1} and {0}. For example v0 > v1 is transformed into VEC_COND_EXPR<v0 > v1, {-1}, {0}>. 2) When optabs expand VEC_COND_EXPR, two cases are considered: 2.a) first operand of VEC_COND_EXPR is comparison, in that case nothing changes. 2.b) first operand is something else, in that case, we specially mark this case, recognize it in the backend, and do not create a comparison, but use the mask as it was a result of some comparison. 3) In order to make sure that mask in VEC_COND_EXPR<mask, v0, v1> is a vector comparison we use is_vector_comparison function, if it returns false, then we replace mask with mask != {0}. So we end-up with the following functionality: VEC_COND_EXPR<mask, v0,v1> -- if we know that mask is a result of comparison of two vectors, we leave it as it is, otherwise change with mask != {0}. Plain vector comparison a <op> b is represented with VEC_COND_EXPR, which correctly expands, without creating useless masking. Basically for me there are two questions: 1) Can we perform information passing in optabs in a nicer way? 2) How is_vector_comparison could be improved? I have several ideas, like checking if constant vector all consists of 0 and -1, and so on. But first is it conceptually fine. P.S. I tired to put the functionality of is_vector_comparison in tree-ssa-forwprop, but the thing is that it is called only with -On, which I find inappropriate, and the functionality gets more complicated. Thanks, Artem.
Attachment:
vec-cond-no-hooks.diff
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |