[Apologies if you receive this twice, but my messages from work
haven't been going through, so I'm resending everything now that I
have my home net connection back.]

On Sat, Feb 08, 2003 at 12:19:35PM +0100, Leopold Toetsch wrote:
> Steve Fink wrote:
> 
> >     bsr $I0
> >
> >It will complain that it can't fixup the label '$I0'.
> 
> I can't imagine, how to get a correct CFG with these kind of register 
> jump instructions. They are too low level, lacking any hint where they 
> might jump to.
> 
> When we want these kind of branches, then they must be more high level, 
> defining all possible branch targets, e.g. like a switch statement.

My specific use is in implementing regexes (I guess I should say
"rules"). It is now possible to store anonymous rules or references to
named rules in variables, and invoke the rules within a regex. If
you're qualifying those invocations with * or + or whatever, then the
setup/teardown code is going to be called many, many times, so it
would be nice to minimize it. But because it's not constant, it will
boil down to either "bsr $I0" or "invoke". I would like to be able to
put the code implementing those anonymous rules into the "current
compilation unit" (they'll be acting like closures and referring to
local vars, but I'd rather avoid a full-blown closure when possible.)

I think all that means that I *can* specify a set of labels that the
instruction might jump to, and guarantee that if it jumps to anywhere
else that it won't affect any registers. For now, I'm prototyping
using a heavyweight mechanism. If that gets to be too unwieldy, maybe
I'll take a look at implementing something like

  bsr $I0 = _label1 | _label2 | @REGISTER_PRESERVING_LOCATION@

(Ignore the syntax!). It's only needed for imcc, right? (I wouldn't
need to propagate it through to the JIT or anything, would I?)

I'm not really sure whether I'll end up needing any of this anway. It
may be just too unpredictable where things can go to, and I'll have to
suffer with the heavyweight approach.

How is invoke handled? Is it assumed to always use the full PDD06
calling conventions?

Reply via email to