public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "palmer at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/115687] RISC-V optimization when "lui" instructions can be merged
Date: Thu, 27 Jun 2024 21:57:10 +0000	[thread overview]
Message-ID: <bug-115687-4-LZEChLMh5x@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-115687-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Palmer Dabbelt <palmer at gcc dot gnu.org> ---
(In reply to Andrew Waterman from comment #6)
> I note MIPS sets TARGET_CONST_ANCHOR to 0x8000, and that architecture's
> ADDIU instruction has a 16-bit immediate.  RISC-V's ADDI instruction has a
> 12-bit immediate, so presumably we should be setting it to 0x800.

Ya, sorry, I wasn't paying attention -- regardless I think Vineet's on the
right track here with the splitter messing with us here, the incoming code has
a constant anchor already so dealing with those is sort of a different problem.

If removing that splitter is on the TODO list that seems reasonable, though I'd
taken a very different approach and just hacked up a post-split CSE as it seems
like we could end up in more situations like this.  I have no idea if that's a
sane idea, I sent an RFC to the lists to see what people think...

      parent reply	other threads:[~2024-06-27 21:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27 17:51 [Bug other/115687] New: " Explorer09 at gmail dot com
2024-06-27 18:17 ` [Bug target/115687] " palmer at gcc dot gnu.org
2024-06-27 18:30 ` pinskia at gcc dot gnu.org
2024-06-27 18:32 ` pinskia at gcc dot gnu.org
2024-06-27 18:49 ` palmer at gcc dot gnu.org
2024-06-27 18:54 ` palmer at gcc dot gnu.org
2024-06-27 20:39 ` andrew at sifive dot com
2024-06-27 21:02 ` vineetg at gcc dot gnu.org
2024-06-27 21:57 ` palmer at gcc dot gnu.org [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=bug-115687-4-LZEChLMh5x@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).