public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: fche@redhat.com (Frank Ch. Eigler)
To: cgen@sources.redhat.com
Subject: Re: escaping in syntax strings
Date: Mon, 26 Mar 2001 08:49:00 -0000	[thread overview]
Message-ID: <o5snk01nnf.fsf@toenail.toronto.redhat.com> (raw)
In-Reply-To: <o5wv9c1ojl.fsf.cygnus.local.cgen@toenail.toronto.redhat.com>

I wrote:

: [...]
: By the way, why do you need a "$" in the syntax string?  Are you
: confusing register name keywords or hexadecimal constants with
: the markers that actually belong into the syntax strings?

I just found what Ben was talking about.  It seems that some
instructions in the assembly language for his target includes dummy
operands that make explicit the implicit (not-encoded) operands.  For
example, given a register keyword set such as "$0 .. $7", there are
some instructions which are hard-wired to use only $0 as an input or
output, in addition to other inputs/outputs.  Rather than leave the $0
implicit, this assembly language expects the programmer to specify it.
Say,
        compare $0,$2,$3
instead of
        compare $2,$3

So, Ben is trying to implement this in the assembler by including the
literal string "$0" in the syntax bytes of the instruction.  This is
not too bad, though a possibly better way would be to associate a
synthetic cgen operand with that slot, and to give it a parser that
accepts only "$0", and emits a helpful error message for anything
else.

- FChE

  parent reply	other threads:[~2001-03-26  8:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-25 20:16 Ben Elliston
2001-03-26  5:10 ` Frank Ch. Eigler
2001-03-26  5:22   ` Ben Elliston
     [not found]   ` <15039.17056.78350.71117.cygnus.local.cgen@scooby.apac.redhat.com>
2001-03-26  8:30     ` Frank Ch. Eigler
     [not found]   ` <o5wv9c1ojl.fsf.cygnus.local.cgen@toenail.toronto.redhat.com>
2001-03-26  8:49     ` Frank Ch. Eigler [this message]
2001-03-26  9:11       ` Dave Brolley
2001-03-26 14:08         ` Ben Elliston
2001-03-26 14:15           ` Dave Brolley
2001-03-26 14:21             ` Frank Ch. Eigler

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=o5snk01nnf.fsf@toenail.toronto.redhat.com \
    --to=fche@redhat.com \
    --cc=cgen@sources.redhat.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).