From: Paul Koning <paulkoning@comcast.net>
To: Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] Hard register asm constraint
Date: Tue, 25 Jun 2024 10:03:34 -0400 [thread overview]
Message-ID: <FBA24FF3-ED11-4DDA-A0F9-8E15B00CB320@comcast.net> (raw)
In-Reply-To: <ZnkJNrapkFomeTxD@li-819a89cc-2401-11b2-a85c-cca1ce6aa768.ibm.com>
> On Jun 24, 2024, at 1:50 AM, Stefan Schulze Frielinghaus <stefansf@linux.ibm.com> wrote:
>
> Ping.
>
> On Mon, Jun 10, 2024 at 07:19:19AM +0200, Stefan Schulze Frielinghaus wrote:
>> Ping.
>>
>> On Fri, May 24, 2024 at 11:13:12AM +0200, Stefan Schulze Frielinghaus wrote:
>>> This implements hard register constraints for inline asm. A hard register
>>> constraint is of the form {regname} where regname is any valid register. This
>>> basically renders register asm superfluous. For example, the snippet
>>>
>>> int test (int x, int y)
>>> {
>>> register int r4 asm ("r4") = x;
>>> register int r5 asm ("r5") = y;
>>> unsigned int copy = y;
>>> asm ("foo %0,%1,%2" : "+d" (r4) : "d" (r5), "d" (copy));
>>> return r4;
>>> }
>>>
>>> could be rewritten into
>>>
>>> int test (int x, int y)
>>> {
>>> asm ("foo %0,%1,%2" : "+{r4}" (x) : "{r5}" (y), "d" (y));
>>> return x;
>>> }
I like this idea but I'm wondering: regular constraints specify what sort of value is needed, for example an int vs. a short int vs. a float. The notation you've shown doesn't seem to have that aspect.
The other comment is that I didn't see documentation updates to reflect this new feature.
paul
next prev parent reply other threads:[~2024-06-25 14:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-24 9:13 Stefan Schulze Frielinghaus
2024-06-10 5:19 ` Stefan Schulze Frielinghaus
2024-06-24 5:50 ` Stefan Schulze Frielinghaus
2024-06-25 14:03 ` Paul Koning [this message]
2024-06-25 14:35 ` Maciej W. Rozycki
2024-06-25 16:04 ` Stefan Schulze Frielinghaus
2024-06-25 17:02 ` Paul Koning
2024-06-26 12:54 ` Stefan Schulze Frielinghaus
2024-06-26 15:10 ` Paul Koning
2024-06-27 6:25 ` Stefan Schulze Frielinghaus
2024-06-27 7:45 ` Georg-Johann Lay
2024-06-27 8:51 ` Stefan Schulze Frielinghaus
2024-06-28 9:46 ` Georg-Johann Lay
2024-06-28 12:20 ` Stefan Schulze Frielinghaus
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=FBA24FF3-ED11-4DDA-A0F9-8E15B00CB320@comcast.net \
--to=paulkoning@comcast.net \
--cc=gcc-patches@gcc.gnu.org \
--cc=stefansf@linux.ibm.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).