This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
CGEN: Macro insns
- To: cgen at sources dot redhat dot com
- Subject: CGEN: Macro insns
- From: Dave Brolley <brolley at redhat dot com>
- Date: Thu, 05 Jul 2001 11:39:51 -0400
Hi,
I have a scenario in which I have a short form of an insns which I would
like to implement using a macro insn. The situationj is similar to the
following:
There exists an insn which has two operands:
insn reg1,reg2
If reg2 is not specified, it is assumed to be the same register as reg
1. So, I implement the insn as
(dni insn "an instruction" ()
"insn $dest-reg,$src-reg"
(+ OP_INSN dest-reg src-reg)
(nop)
)
and I tried to implemented the short form as
(dnmi insn-short "short form of insn" ()
"insn $dest-reg"
(emit insn dest-reg (src-reg dest-reg))
)
Unfortunately, when using the short form, the field associated with the
src-reg operand is assigned the value zero rather than the value of the
field associated with dest-reg, as I had expected. Is this supposed to
work? Any other suggestions?
Thanks,
Dave