ifield's value processing -- help is needed
Lev Yudalevich <[email protected]>
| Newsgroups | gmane.comp.tools.cgen.devel |
|---|---|
| Message-ID | <CA+zUDe3_5DFAvGJKFAQfC+euXqQhi4WAj_9RDqCVAsJe_heQ9A@mail.gmail.com> |
Hello, (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. Sincerely, Lev.