public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Johan Rydberg <jrydberg@rtmk.org>
To: Andreas Schwab <schwab@suse.de>
Cc: Robert Dewar <dewar@gnat.com>, jh@suse.cz, gcc@gcc.gnu.org
Subject: Re: i386 and asm jumping
Date: Tue, 07 May 2002 10:31:00 -0000	[thread overview]
Message-ID: <20020507193239.G25172@cockmaster.bredbandsbolaget.se> (raw)
In-Reply-To: <jehelkaxep.fsf@sykes.suse.de>; from schwab@suse.de on Tue, May 07, 2002 at 15:40:46 +0200


On 2002.05.07 15:40 Andreas Schwab wrote:
: dewar@gnat.com (Robert Dewar) writes:
: 
: |> > 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.
: 
: What's wrong with computed goto in this situation?

What I would like to do is to replace the following code
with inline assembler:

	if (--cnt == 0)
	  goto HANDLER;
        goto NEXT;

The code above will generate; load cnt into register,
decrement register, store register and jump to HANDLER
if zero flag is set.  I would like to replace this with
the following assembler code:

	decl	cnt
	jz	HANDLER
	jmp	NEXT

Speed is everything :)

regards
johan

  reply	other threads:[~2002-05-07 17:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-07  5:49 Robert Dewar
2002-05-07  6:48 ` Andreas Schwab
2002-05-07 10:31   ` Johan Rydberg [this message]
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

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=20020507193239.G25172@cockmaster.bredbandsbolaget.se \
    --to=jrydberg@rtmk.org \
    --cc=dewar@gnat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jh@suse.cz \
    --cc=schwab@suse.de \
    /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).