public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Vineet Gupta <vineetg@rivosinc.com>
To: Jeff Law <jeffreyalaw@gmail.com>, gcc-patches@gcc.gnu.org
Cc: kito.cheng@gmail.com, Palmer Dabbelt <palmer@rivosinc.com>,
	Christoph Mullner <christoph.muellner@vrull.eu>,
	gnu-toolchain@rivosinc.com
Subject: [Committed] RISC-V: improve codegen for large constants with same 32-bit lo and hi parts [2]
Date: Fri, 19 May 2023 10:21:49 -0700	[thread overview]
Message-ID: <490dbd83-e0a9-50d1-719c-ab2dab275653@rivosinc.com> (raw)
In-Reply-To: <df620128-2956-5976-c368-903cf1ef8e48@gmail.com>

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


      parent reply	other threads:[~2023-05-19 17:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18 20:57 [PATCH] " Vineet Gupta
2023-05-19 16:33 ` Jeff Law
2023-05-19 16:36   ` Palmer Dabbelt
2023-05-19 17:21     ` Vineet Gupta
2023-05-19 17:21   ` Vineet Gupta [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=490dbd83-e0a9-50d1-719c-ab2dab275653@rivosinc.com \
    --to=vineetg@rivosinc.com \
    --cc=christoph.muellner@vrull.eu \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gnu-toolchain@rivosinc.com \
    --cc=jeffreyalaw@gmail.com \
    --cc=kito.cheng@gmail.com \
    --cc=palmer@rivosinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).