[Bug target/66144] New: vector element operator produces very bad code

mkg at us dot ibm.com gcc-bugzilla@gcc.gnu.org
Thu May 14 15:43:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66144

            Bug ID: 66144
           Summary: vector element operator produces very bad code
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mkg at us dot ibm.com
  Target Milestone: ---

Compiling the following input
#include <altivec.h>

vector char
test( vector char a, vector char b)
{
        return a == b;
}

generates the following output with gcc from from trunk/head with -O3 


test:
        vcmpequb 2,2,3
        xxlxor 32,32,32
        vspltisw 1,-1
        xxsel 34,32,33,34
        blr

The original first instruction already has the right answer, then it's
recomputed!

The inverted condition
#include <altivec.h>

vector char
test( vector char a, vector char b)
{
        return a != b;
}


produces
test:
        vcmpequb 2,2,3
        xxlxor 33,33,33
        vspltisw 0,-1
        xxsel 34,32,33,34
        blr



More information about the Gcc-bugs mailing list