public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: greg@mcgary.org
Cc: dje@transmeta.com, cgen@sourceware.cygnus.com,
	binutils@sourceware.cygnus.com
Subject: Re: how to implement general macro-insn expansion?
Date: Wed, 27 Dec 2000 10:39:00 -0000	[thread overview]
Message-ID: <200012271839.KAA19845@elmo.cygnus.com> (raw)

Hi Greg,

: I see no way around the need to change the md_assemble() interface.
: Somehow md_assemble() needs to return a `sb' (string block)
: representing the expansion of a macro-insn so that read_a_source_file()
: can push it as a nested input source and continue assembling.  A
: sneaky way to do this that doesn't require changing any of the
: zillions of instances of md_assemble is to pass a zeroed sb as a
: second argument, then detect macro-insn by whether or not the sb's
: fields come back filled-in.  However, I don't like sneakiness and gas
: is sourceware, so I'm content to hack all instances of md_assmeble to
: take the second argument and return a boolean to indicate what we did.
: md_assmble() should return nonzero if it assembled an insn, and should
: return 0 if a macro expansion was deposited into `sb'.
: 
: Sound reasonable?

Alternatively you could create a new target macro, say
MD_MACRO_ASSEMBLE.  If this is defined, then read_a_source_file()
would invoke this macro, which is expected to return a string block,
and if it is not defined then read_a_source_file() would invoke
md_assemble() as normal.  That way you do not have to modify hundreds
of ports, and you only need to define for those ports that really need
this feature.

Cheers
	Nick


             reply	other threads:[~2000-12-27 10:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-27 10:39 Nick Clifton [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-12-18 12:02 multi-insn expansions for macro insns? Greg McGary
2000-12-18 13:09 ` Doug Evans
2000-12-19 22:54   ` how to implement general macro-insn expansion? Greg McGary
2000-12-20  0:48     ` Greg McGary
2000-12-20  7:39       ` Doug Evans
2000-12-26 17:43         ` Greg McGary
2000-12-27 11:28           ` Doug Evans
2000-12-27 12:09             ` Greg McGary
2000-12-27 14:21               ` Doug Evans
2001-01-09 15:23                 ` Greg McGary

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=200012271839.KAA19845@elmo.cygnus.com \
    --to=nickc@redhat.com \
    --cc=binutils@sourceware.cygnus.com \
    --cc=cgen@sourceware.cygnus.com \
    --cc=dje@transmeta.com \
    --cc=greg@mcgary.org \
    /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).