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

            Bug ID: 106562
           Summary: PRU: Inefficient code for zero check of 64-bit AND
                    result
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dimitar at gcc dot gnu.org
  Target Milestone: ---

GCC generates inefficient code for the following C snippet:

char test(uint64_t a, uint64_t b)
{
        return a && b;
}

test:
        or      r0.b0, r14.b0, r14.b1
        or      r0.b0, r0.b0, r14.b2
        or      r0.b0, r0.b0, r14.b3
        or      r0.b0, r0.b0, r15.b0
        or      r0.b0, r0.b0, r15.b1
        or      r0.b0, r0.b0, r15.b2
        or      r0.b0, r0.b0, r15.b3
        qbeq    .L4, r0.b0, 0
        mov     r14, r16
        mov     r15, r17
        sub     r2, r2, 2
        rsb     r0, r16, 0
        rsc     r1, r17, 0
        mov     r17, r14
        mov     r18, r15
        sbbo    r3.b2, r2, 0, 2
        ldi     r16.b0, (63) & 0xffff
        or      r14, r0, r17
        or      r15, r1, r18
        call    %label(__pruabi_lsrll)
        lbbo    r3.b2, r2, 0, 2
        add     r2, r2, 2
        ret

Reply via email to