public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: "Takayuki 'January June' Suwa" <jjsuwa_sys3175@yahoo.co.jp>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 1/2 v2] xtensa: Recover constant synthesis for HImode after LRA transition
Date: Sun, 4 Feb 2024 13:28:34 -0800	[thread overview]
Message-ID: <CAMo8BfLeuQNsGFivSzD2qnm0_Cja0TjSX2=F_0nb4LaGaQkTAg@mail.gmail.com> (raw)
In-Reply-To: <2c6cd2b5-e436-4608-a0b7-ad8a57bc186b@yahoo.co.jp>

On Sun, Feb 4, 2024 at 2:20 AM Takayuki 'January June' Suwa
<jjsuwa_sys3175@yahoo.co.jp> wrote:
>
> After LRA transition, HImode constants that don't fit into signed 12 bits
> are no longer subject to constant synthesis:
>
>     /* example */
>     void test(void) {
>       short foo = 32767;
>       __asm__ ("" :: "r"(foo));
>     }
>
>     ;; before
>         .literal_position
>         .literal .LC0, 32767
>     test:
>         l32r    a9, .LC0
>         ret.n
>
> This patch fixes that:
>
>     ;; after
>     test:
>         movi.n  a9, -1
>         extui   a9, a9, 17, 15
>         ret.n
>
> gcc/ChangeLog:
>
>         * config/xtensa/xtensa.md (SHI): New mode iterator.
>         (2 split patterns related to constsynth):
>         Change to also accept HImode operands.
> ---
>  gcc/config/xtensa/xtensa.md | 22 ++++++++++++++--------
>  1 file changed, 14 insertions(+), 8 deletions(-)

Regtested for target=xtensa-linux-uclibc, no new regressions.
Committed to master.

-- 
Thanks.
-- Max

      reply	other threads:[~2024-02-04 21:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2c6cd2b5-e436-4608-a0b7-ad8a57bc186b.ref@yahoo.co.jp>
2024-02-04 10:20 ` Takayuki 'January June' Suwa
2024-02-04 21:28   ` Max Filippov [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='CAMo8BfLeuQNsGFivSzD2qnm0_Cja0TjSX2=F_0nb4LaGaQkTAg@mail.gmail.com' \
    --to=jcmvbkbc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jjsuwa_sys3175@yahoo.co.jp \
    /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).