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]

Re: [autovect] [patch] Improve generated vector comparisons


On 5/22/06, Victor Kaplansky <VICTORK@il.ibm.com> wrote:
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.

You should really do this at expand time.


Richard.


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