public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/106602] New: riscv: suboptimal codegen for shift left, right, left
@ 2022-08-12 20:34 vineetg at rivosinc dot com
  2022-08-12 20:39 ` [Bug target/106602] " pinskia at gcc dot gnu.org
                   ` (30 more replies)
  0 siblings, 31 replies; 32+ messages in thread
From: vineetg at rivosinc dot com @ 2022-08-12 20:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106602
           Summary: riscv: suboptimal codegen for shift left, right, left
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vineetg at rivosinc dot com
                CC: christophm30 at gmail dot com, kito at gcc dot gnu.org
  Target Milestone: ---

This came up when investigating
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106545. The test to supposedly
induce the peephole doesn't, but generates far inferior code.

unsigned long foo2(unsigned long a)
{
        return (unsigned long)(unsigned int)a << 6;
}

-march=rv64gc -O2   # no bitmanip

foo2:
        li      a5,1
        slli    a5,a5,38
        addi    a5,a5,-64
        slli    a0,a0,6
        and     a0,a0,a5
        ret

llvm generates expected

foo:
        slli    a0, a0, 32
        srli    a0, a0, 26
        ret

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

end of thread, other threads:[~2023-04-19  2:41 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-12 20:34 [Bug target/106602] New: riscv: suboptimal codegen for shift left, right, left vineetg at rivosinc dot com
2022-08-12 20:39 ` [Bug target/106602] " pinskia at gcc dot gnu.org
2022-08-12 20:40 ` vineetg at rivosinc dot com
2022-11-01  0:12 ` [Bug target/106602] riscv: suboptimal codegen for zero_extendsidi2_shifted w/o bitmanip vineetg at rivosinc dot com
2022-11-01  0:18 ` pinskia at gcc dot gnu.org
2022-11-01  0:29 ` vineetg at rivosinc dot com
2022-11-01  0:32 ` vineetg at rivosinc dot com
2022-11-01 19:56 ` law at gcc dot gnu.org
2022-11-01 19:58 ` law at gcc dot gnu.org
2022-11-01 20:15 ` palmer at gcc dot gnu.org
2022-11-01 20:31 ` vineetg at rivosinc dot com
2022-11-01 23:39 ` vineetg at rivosinc dot com
2022-11-02  0:38 ` vineetg at rivosinc dot com
2022-11-02  0:46 ` law at gcc dot gnu.org
2022-11-02  1:03 ` law at gcc dot gnu.org
2022-11-02  1:24 ` vineetg at rivosinc dot com
2022-11-02  1:31 ` law at gcc dot gnu.org
2022-11-02  1:35 ` pinskia at gcc dot gnu.org
2022-11-02  1:35 ` pinskia at gcc dot gnu.org
2022-11-02 15:11 ` law at gcc dot gnu.org
2022-11-02 17:02 ` vineetg at rivosinc dot com
2022-11-02 17:05 ` vineetg at rivosinc dot com
2022-11-02 17:16 ` law at gcc dot gnu.org
2022-11-03  4:15 ` vineetg at rivosinc dot com
2022-11-03 20:41 ` vineetg at rivosinc dot com
2022-11-03 21:21 ` vineetg at rivosinc dot com
2022-11-16 17:55 ` law at gcc dot gnu.org
2022-11-16 18:47 ` law at gcc dot gnu.org
2022-12-27 23:31 ` cvs-commit at gcc dot gnu.org
2022-12-27 23:33 ` law at gcc dot gnu.org
2023-04-17 18:14 ` cvs-commit at gcc dot gnu.org
2023-04-19  2:41 ` cvs-commit 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).