public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: i386 and asm jumping
@ 2002-05-07  5:49 Robert Dewar
  2002-05-07  6:48 ` Andreas Schwab
  2002-05-07  7:45 ` Michael Matz
  0 siblings, 2 replies; 13+ messages in thread
From: Robert Dewar @ 2002-05-07  5:49 UTC (permalink / raw)
  To: jh, jrydberg; +Cc: gcc

> It is not possible.  ASM statements may not jump.
> You may want to use computed goto GCC extension istead.

Seems a pity, this is quite a serious restriction in capability
compared with Asm inserts in other compilers.

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: i386 and asm jumping
@ 2002-05-07 16:33 Erik Schnetter
  2002-05-08  2:43 ` Andreas Schwab
  0 siblings, 1 reply; 13+ messages in thread
From: Erik Schnetter @ 2002-05-07 16:33 UTC (permalink / raw)
  To: gcc

Peter Barada wrote:

> Jumps in asm statements will create problems since the optimizers have
> no knowledge that there is a possible change in flow caused by the asm
> statement, and hence will not have an accurate flow diagram of the
> function.  From there its all downhill.

That is true.  However, the same could be said from asm code changing 
registers.  The solution is to tell the compiler about all possible branch 
destinations of a piece of asm code.  Possibly with branch probabilities...

The question remains whether someone will think this is worthwhile 
implementing, or whether this someone rather fixes the machine description in 
question.

Another approach is to postprocess the generated assembler code, before the 
assembler sees it.

-erik

-- 
Erik Schnetter <schnetter@uni-tuebingen.de>
Web: http://www.tat.physik.uni-tuebingen.de/~schnette/

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: i386 and asm jumping
@ 2002-05-07  7:30 Robert Dewar
  2002-05-07  9:03 ` Peter Barada
  0 siblings, 1 reply; 13+ messages in thread
From: Robert Dewar @ 2002-05-07  7:30 UTC (permalink / raw)
  To: dewar, schwab; +Cc: gcc, jh, jrydberg

>>What's wrong with computed goto in this situation?

Lots of machines have interesting branch instructions which you may want
to generate for some particular reason. After all if you take the above
attitude, *any* inserted asm can always be replaced by C code :-)

^ permalink raw reply	[flat|nested] 13+ messages in thread
* i386 and asm jumping
@ 2002-05-07  5:06 Johan Rydberg
  2002-05-07  5:15 ` Jan Hubicka
  0 siblings, 1 reply; 13+ messages in thread
From: Johan Rydberg @ 2002-05-07  5:06 UTC (permalink / raw)
  To: gcc


Hi!

I would like to hard optimize a special case in my 
code.  And what I would like to do is really just
the following:

     the_label:
	...
	__asm___ ("jmp %0" :: "?" (&& the_label));

What I wanna know is if this is possible?  What
constrain should I use?  `m' doesn't work, neither
do `p'.  Any ideas?

regards
johan

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2002-05-09 15:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-07  5:49 i386 and asm jumping Robert Dewar
2002-05-07  6:48 ` Andreas Schwab
2002-05-07 10:31   ` Johan Rydberg
2002-05-07 15:23     ` Richard Henderson
2002-05-08  4:15     ` Bernd Jendrissek
2002-05-07  7:45 ` Michael Matz
  -- strict thread matches above, loose matches on Subject: below --
2002-05-07 16:33 Erik Schnetter
2002-05-08  2:43 ` Andreas Schwab
2002-05-09  9:01   ` Erik Schnetter
2002-05-07  7:30 Robert Dewar
2002-05-07  9:03 ` Peter Barada
2002-05-07  5:06 Johan Rydberg
2002-05-07  5:15 ` Jan Hubicka

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).