public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@bigpond.net.au>
To: Zack Weinberg <zack@codesourcery.com>
Cc: hp@bitrange.com, schwab@suse.de, binutils@sources.redhat.com
Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
Date: Tue, 27 Apr 2004 02:35:00 -0000	[thread overview]
Message-ID: <20040427020222.GA2581@bubble.modra.org> (raw)
In-Reply-To: <873c6q6y5b.fsf@egil.codesourcery.com>

On Mon, Apr 26, 2004 at 05:51:44PM -0700, Zack Weinberg wrote:
> Uh, when I said "collapse the parsing logic together" I meant "think
> of a way to get rid of the machine-dependent parsers to the maximum
> extent possible."  While thinking very carefully about how to make the
> parser go blazingly fast *without* special tricks.  I'm quite
> confident this is possible.  Assembly syntax - with or without extra
> added whitespace - is not complicated, nor does it vary that much
> across architectures supported by GAS.

One thing that complicates do_scrub_chars in gas, for very little gain,
is trying to remove all unneeded whitespace.  For example,

	foo:	mov	%eax, $2 + 3 +   4

is turned into

	foo: mov %eax,$2+3+4

The aim being to render whitespace removal unnecessary in target
dependent code.  That's a good idea until you encounter constructs like:

	foo: addr16 mov %eax,0

where the "opcode" part of the instruction itself has whitespace.
Without various hacks, do_scrub_chars would turn the above into

	foo: addr16 mov%eax,0

Other architectures have similar assembly constructs.  So I think you
underestimate the complexity in a general parser design.  Just
separating an assembly line into label, opcode, operands isn't so easy!

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

  parent reply	other threads:[~2004-04-27  2:02 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-17 16:36 Nathan Sidwell
2004-03-17 16:43 ` Hans-Peter Nilsson
2004-03-17 16:49 ` Ian Lance Taylor
2004-03-18 10:29   ` Nathan Sidwell
2004-03-18 13:15     ` Ian Lance Taylor
2004-04-23 23:15     ` Andreas Schwab
2004-04-24 17:36       ` Hans-Peter Nilsson
2004-04-24 17:57         ` Andreas Schwab
2004-04-24 18:26           ` Hans-Peter Nilsson
2004-04-24 19:22             ` Andreas Schwab
2004-04-24 21:31               ` Hans-Peter Nilsson
2004-04-24 21:33                 ` Andreas Schwab
2004-04-24 23:25                   ` Hans-Peter Nilsson
2004-04-24 23:37                     ` Andreas Schwab
2004-04-25  0:03                     ` Zack Weinberg
2004-04-25  0:22                       ` Hans-Peter Nilsson
2004-04-26  0:28                         ` Zack Weinberg
2004-04-26  0:58                           ` Hans-Peter Nilsson
2004-04-26  2:14                             ` Hans-Peter Nilsson
2004-04-25 23:35                       ` Ian Lance Taylor
2004-04-26  0:51                         ` Zack Weinberg
2004-04-26  2:46                           ` Ian Lance Taylor
2004-04-26  3:13                             ` Zack Weinberg
2004-04-26 14:16                               ` Ian Lance Taylor
2004-04-26 14:22                                 ` Andreas Schwab
2004-04-26 14:34                                   ` Richard Earnshaw
2004-04-26 15:29                                     ` Ian Lance Taylor
2004-04-26 19:26                                       ` Hans-Peter Nilsson
2004-04-26 19:42                                 ` Kai Henningsen
2004-04-26 19:45                                   ` Ian Lance Taylor
2004-04-26 20:04                                     ` Ian Lance Taylor
2004-04-27  1:32                                 ` Zack Weinberg
2004-04-27  2:02                                   ` Hans-Peter Nilsson
2004-04-27  2:38                                     ` Zack Weinberg
2004-04-27  2:35                                   ` Alan Modra [this message]
2004-04-27  3:13                                     ` Zack Weinberg
2004-04-27  4:33                                       ` Ian Lance Taylor
2004-04-27  5:19                                         ` Zack Weinberg
2004-04-27  6:52                                           ` Ian Lance Taylor
2004-04-27 11:43                                         ` Richard Earnshaw
2004-04-27  2:47                                   ` Ian Lance Taylor

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=20040427020222.GA2581@bubble.modra.org \
    --to=amodra@bigpond.net.au \
    --cc=binutils@sources.redhat.com \
    --cc=hp@bitrange.com \
    --cc=schwab@suse.de \
    --cc=zack@codesourcery.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).