This is the mail archive of the cgen@sources.redhat.com mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

CGEN: Macro insns


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]