From: Jeff Law <jeffreyalaw@gmail.com>
To: Roger Sayle <roger@nextmovesoftware.com>,
'GCC Patches' <gcc-patches@gcc.gnu.org>
Subject: Re: [xstormy16] Add extendhisi2 and zero_extendhisi2 patterns to stormy16.md
Date: Sat, 22 Apr 2023 16:08:06 -0600 [thread overview]
Message-ID: <bd25f142-fd04-822e-1e7c-064259bd7130@gmail.com> (raw)
In-Reply-To: <026001d9755d$19b30030$4d190090$@nextmovesoftware.com>
On 4/22/23 14:57, Roger Sayle wrote:
>
> This patch adds a pair of define_insn patterns to the xstormy16 machine
> description that provide extendhisi2 and zero_extendhisi2, i.e. 16-bit
> to 32-bit sign- and zero-extension respectively. This functionality is
> already synthesized during RTL expansion, but providing patterns allow
> the semantics to be exposed to the RTL optimizers. To simplify things,
> this patch introduces a new %h0 output format, for emitting the high_part
> register name of a double-word (SImode) register pair. The actual
> code generated is identical to before.
>
> Whilst there, I also fixed the instruction lengths and formatting of
> the zero_extendqihi2 pattern. Then, mostly for documentation purposes
> as the 'T' constraint isn't yet implemented, I've added a "and Rx,#255"
> alternative to zero_extendqihi2 that takes advantage of its efficient
> instruction encoding.
>
> This patch has been tested by building a cross-compiler to xstormy16-elf
> on x86_64-pc-linux-gnu, and confirming that the new test case passes with
> "make -k check-gcc". Ok for mainline?
>
>
> 2023-04-22 Roger Sayle <roger@nextmovesoftware.com>
>
> gcc/ChangeLog
> * config/stormy16/stormy16.cc (xstormy16_print_operand): Add %h
> format specifier to output high_part register name of SImode reg.
> * config/stormy16/stormy16.md (extendhisi2): New define_insn.
> (zero_extendqihi2): Fix lengths, consistent formatting and add
> "and Rx,#255" alternative, for documentation purposes.
> (zero_extendhisi2): New define_insn.
>
> gcc/testsuite/ChangeLog
> * gcc.target/xstormy16/extendhisi2.c: New test case.
> * gcc.target/xstormy16/zextendhisi2.c: Likewise.
Does the "T" alternative ever match? AFAICT its constraint check always
fails:
> (define_constraint "T"
> "@internal"
> ;; For Rx; not implemented yet.
> (match_test "0"))
No objections, but just not sure what's going on with that T constraint.
jeff
next prev parent reply other threads:[~2023-04-22 22:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-22 20:57 Roger Sayle
2023-04-22 22:08 ` Jeff Law [this message]
2023-04-23 10:38 ` Roger Sayle
2023-04-24 23:53 ` Jeff Law
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=bd25f142-fd04-822e-1e7c-064259bd7130@gmail.com \
--to=jeffreyalaw@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=roger@nextmovesoftware.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).