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

            Bug ID: 100868
           Summary: PPC: Inefficient code for vec_reve(vector double)
           Product: gcc
           Version: 8.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jens.seifert at de dot ibm.com
  Target Milestone: ---

Input:

vector double reve(vector double a)
{
   return vec_reve(a);
}

creates:

_Z4reveDv2_d:
.LFB3:
        .cfi_startproc
.LCF3:
0:      addis 2,12,.TOC.-.LCF3@ha
        addi 2,2,.TOC.-.LCF3@l
        .localentry     _Z4reveDv2_d,.-_Z4reveDv2_d
        addis 9,2,.LC2@toc@ha
        addi 9,9,.LC2@toc@l
        lvx 0,0,9
        xxlnor 32,32,32
        vperm 2,2,2,0
        blr

Optimal sequence would be:

vector double reve_pwr7(vector double a)
{
   return vec_xxpermdi(a,a,2);
}

which creates:

_Z9reve_pwr7Dv2_d:
.LFB4:
        .cfi_startproc
        xxpermdi 34,34,34,2
        blr
  • [Bug target/100868] New: PPC: ... jens.seifert at de dot ibm.com via Gcc-bugs

Reply via email to