This is the mail archive of the
mailing list for the CGEN project.
ifield's value processing -- help is needed
- From: Lev Yudalevich <lyudalev at gmail dot com>
- To: cgen at sourceware dot org
- Date: Tue, 11 Jun 2013 12:58:25 +0300
- Subject: ifield's value processing -- help is needed
(I'm not 100% sure if this is a correct place to ask, but I'd very
appreciate any answer)
I'm wandering if there is a possibility to specify (either in a `.cpu'
file or in a corresponding `.opc' file) an additional processing
function for a value of an instruction's ifield. For example, I'd like
to define several isa sets. Suppose that these sets differ by opcode
values only. In this case, I may supply a simple lookup function that
picks the correct value depending on the isa. My problem is that I can
not find a way to pass such a function (nor in Scheme neither in C) as
a part of the format list of an
instruction definition. Having user-defined parse and print handlers
(as for operand definitions) would have solve the problem, but there
are none for ifields. Another workaround is to hardcode all opcodes
for all isas, but in this case I have no way to distinguish between
different isas inside cgen_dis_hash function, which only gets a buffer
and a value as arguments.
Any advice is highly welcome.