public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Jonah" <gccmail@whalesolutions.ca>
To: "Richard Henderson" <rth@redhat.com>,
	"James Buchanan" <jamesbuch@iprimus.com.au>,
	"Joseph D. Wagner" <wagnerjd@prodigy.net>
Cc: <gcc@gcc.gnu.org>
Subject: Re: Generated unique labels
Date: Fri, 03 Jan 2003 12:28:00 -0000	[thread overview]
Message-ID: <00e801c2b323$87d02e70$dbd428d9@altera.priv.altera.com> (raw)
In-Reply-To: <5.1.0.14.0.20030103114214.009e9640@pop.iprimus.com.au>

I am a bit confused by where this conversation is going. Isn't the Projects
list item referring to having labels in inline assembler. I will give you
the problem I was having which I thought was the same problem as the
projects file item.

int simple_func (int b, int c)
{
    int x;
asm (
"simple_func_loop_start:\n\t"
"    Do Assebly Stuff    \n\t"
"    LOOP to simple_func_loop_start"
: [x] "=r" (x)
: [b] "r" (b), [c] "r" (c)
: "r0", "r1", "memory" );

    return x;
}

int bigger_func ()
{
    ...
    simple_func (1, 2);
    ...
    simple_func (4, 1);
}

If I compile the above I get simple_func inlined in bigger_func twice,
casuing the same label "simple_func_loop_start" to exist twice in the
assembly for function bigger_func. If there was a way to generate a unique
label in the asm block, the inlining could then give me two different
labels.

For example if the asm statement were extended to have a fifth field which
was the number of unique labels needed in the asm block, or a list of the
names of the unqiue labels like this:

asm (
"%[simple_func_loop_start]:\n\t"
"    Do Assembly Stuff    \n\t"
"    Loop to %[simple_func_loop_start]"
: [x] "=r" (x)
: [b] "r" (b), [c] "r" (c)
: "r0", "r1", "memory"
: "simple_func_loop_start" );

Is what I have described above the project described in the projects file?
Maybe we could have a little discussion about the best syntax for this
extension?

Jonah

In the Projects file:

===
Generated unique labels. Have some way of generating distinct
labels for use in extended asm statements. I don't know what a
good syntax would be.
===

----- Original Message -----
From: "James Buchanan" <jamesbuch@iprimus.com.au>
To: "Richard Henderson" <rth@redhat.com>
Cc: <gcc@gcc.gnu.org>
Sent: Friday, January 03, 2003 12:43 AM
Subject: Re: Generated unique labels


> This means a different label syntax for different assembler languages
> doesn't it?  So the function needs to know an "assembly context"
> depending on what the target CPU is for the program.
>
> At 04:25 PM 1/2/2003 -0800, Richard Henderson wrote:
> >On Mon, Dec 30, 2002 at 03:31:30AM +1100, James Buchanan wrote:
> > > Has this been done yet?  If not has anyone been assigned to it?
> >
> >No and no.  Best option is to use assembler local labels.
> >
> >
> >r~

  reply	other threads:[~2003-01-03 12:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-29 11:47 James Buchanan
2003-01-02  7:42 ` Joseph D. Wagner
2003-01-03  0:43   ` James Buchanan
2003-01-03  0:25 ` Richard Henderson
2003-01-03  0:44   ` James Buchanan
2003-01-03 12:28     ` Jonah [this message]
2003-01-03 17:34       ` Richard Henderson
2003-01-03 18:16         ` Jonah
2003-01-03 19:37           ` Joseph S. Myers
2003-01-07 16:29 Joern Rennecke

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='00e801c2b323$87d02e70$dbd428d9@altera.priv.altera.com' \
    --to=gccmail@whalesolutions.ca \
    --cc=gcc@gcc.gnu.org \
    --cc=jamesbuch@iprimus.com.au \
    --cc=rth@redhat.com \
    --cc=wagnerjd@prodigy.net \
    /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).