public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/106562] New: PRU: Inefficient code for zero check of 64-bit AND result
@ 2022-08-08 19:41 dimitar at gcc dot gnu.org
  2022-08-08 19:42 ` [Bug target/106562] " dimitar at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: dimitar at gcc dot gnu.org @ 2022-08-08 19:41 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-08-30 20:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-08 19:41 [Bug target/106562] New: PRU: Inefficient code for zero check of 64-bit AND result dimitar at gcc dot gnu.org
2022-08-08 19:42 ` [Bug target/106562] " dimitar at gcc dot gnu.org
2022-09-18 18:04 ` [Bug target/106562] PRU: Inefficient code for zero check of 64-bit (boolean) " dimitar at gcc dot gnu.org
2022-10-05 18:11 ` dimitar at gcc dot gnu.org
2022-10-09 11:39 ` cvs-commit at gcc dot gnu.org
2023-06-07 19:02 ` dimitar at gcc dot gnu.org
2023-06-07 19:26 ` pinskia at gcc dot gnu.org
2023-08-29 19:38 ` dimitar at gcc dot gnu.org
2023-08-30 19:05 ` cvs-commit at gcc dot gnu.org
2023-08-30 20:13 ` dimitar at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).