This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
emiting insn with changed value
- To: cgen at sources dot redhat dot com
- Subject: emiting insn with changed value
- From: Johan Rydberg <johan dot rydberg at netinsight dot se>
- Date: Tue, 09 Jan 2001 07:16:48 +0100
- Organization: Net Insight AB
Hi!
Is is possible to change a value in a macro insn? See the example
below:
(dni addi "addi" ()
"addi $rd,$ra,$simm"
(+ OP_1 rd rr simm)
(set rd (add ra simm))
()
)
(dnmi subi "subi" ()
"subi $rd,$ra,$simm"
(emit addi rd ra (simm -simm))
) ^^^^^
Note: I have "tested" this and CGEN doesn't complain about it, but
I have not yet hade the chans to try to assemble such an insn.
Looking at the generated code I see nothing that indicates
that "simm" will switch sign.
(maybe it's more suitable to use the "minus" RTX instead of "-simm")
Regards,
Johan.
--
Johan Rydberg, Net Insight AB, Sweden, +46-8-685 04 00
$ ON F$ERROR("LANGUAGE","ENGLISH","IN_MESSAGE").GT.F$ERROR("NORMAL") -
THEN EXCUSE/OBJECT=ME