Here's the idea:
(defmacro inst (&whole whole instruction &rest args &environment env)
"Emit the specified instruction to the current segment. INSTRUCTION
can either be a symbol naming the instruction, or a list of two element,
first naming a prefix, the second naming the instruction."
(if (consp instruction)
(destructuring-bind (prefix name) instruction
(aver (and (symbolp prefix) (symbolp name)))
(inst ,(symbolicate prefix "-PREFIX"))
(inst ,name ,@args)))
(let ((inst (gethash (symbol-name instruction) *assem-instructions*)))
(cond ((null inst)
(error "unknown instruction: ~S" instruction))
(funcall inst (cdr whole) env))
`(,inst (%%current-segment%%) (%%current-vop%%) ,@args))))))
and renaming FS-SEGMENT-PREFIX to FS-PREFIX.
So that you can use
(inst (fs <instruction>) ...args...)
(inst <instruction> ...args...)
which in turn allows you to get by with just one #!+whatever #!-whatever.
With luck it may also make it easier to replace some of the scattered
#!+whatevers with something like
(defmacro frob (&rest args)
-- but even if not, this is still be worth doing, IMO.
I could do this -- the DEFMACRO hack above and the associated changes,
that is -- maybe over the weekend, but since it is going to create
conflicts all over the EBX patch, it might be better if Elliot did it
first in his tree?
In any case, iff the EBX patch is working I think merging it to the
mainline would be good sooner than later. It seems something that is
especially prone to needing constant updating, but (assuming this
simplification) probably not too hard to maintain in CVS.
Can you post the current EBX patch in its entirety for review, without
other changes? (No rush, but rather something to do when you need a
break from debugging EXCEPTION_ACCESS_VIOLATION...)