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]

[autovect] [patch] Improve generated vector comparisons


This improves vector comparisons generated by vectorizer fro ALTIVEC.
As ALTIVEC has only GT and EQ vector instructions for short and char
integers,
we replace

      x = (a <= b) ? y : z;
by
      x = (a > b) ? z : y;

and
      x = (a >= b) ? y : z;
is replaced by
      x = (b > a) ? z : y;

Without this change, back-end generates 3 instructions ((a > b) || (a ==
b))
for (a >= b) vector comparison.


Bootstrapped and tested on linux-powerpc.
Committed to autovect branch.

-- Victor

2006-05-22  Victor Kaplansky   <victork@il.ibm.com>
            Vladimir Yanovsky  <yanov@il.ibm.com>

        * gcc/tree-vect-transform.c (vectorizable_condition):
        Replace GE and LE comparisons by GT for altivec.
        (vect_create_cond_for_alias_checks): change indentation.

(see attached file autovect.vect_comparison_swap.patch.txt)

(See attached file: autovect.vect_comparison_swap.patch.txt)

Attachment: autovect.vect_comparison_swap.patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]