On 5/19/23 09:33, Jeff Law wrote:


On 5/18/23 14:57, Vineet Gupta wrote:
[part #2 of PR/109279]

SPEC2017 deepsjeng uses large constants which currently generates less than
ideal code. This fix improves codegen for large constants which have
same low and hi parts: e.g.

    long long f(void) { return 0x0101010101010101ull; }

Before
         li      a5,0x1010000
         addi    a5,a5,0x101
         mv      a0,a5
         slli    a5,a5,32
         add     a0,a5,a0
         ret

With patch
    li    a5,0x1010000
    addi    a5,a5,0x101
    slli    a0,a5,32
    add    a0,a0,a5
    ret

This is testsuite clean.

gcc/ChangeLog:

    * config/riscv/riscv.cc (riscv_split_integer): if loval is equal
      to hival, ASHIFT the corresponding regs.
LGTM.  Please install.  Thanks for taking care of this!  The updated sequence looks good.

Jeff

Reply via email to