Re: ifield's value processing -- help is needed

Lev Yudalevich <[email protected]>
Newsgroups gmane.comp.tools.cgen.devel
Message-ID <CA+zUDe2GQtLW4uE0hZdsPY6bisCFzrwNERv3XyV+R_dhY-j_AA@mail.gmail.com>
Thank you very much for the reply, Frank!

Right, I can write instruction definitions using macros. But then I'd
have to deal with this full cartesian product of instruction X isa,
which is exactly what I'm trying to avoid, as it creates much more
headache (for example, I'd have to know the currently active isa
inside the cgen_dis_hash function and I couldn't find a guide or an
example of using CGEN_COMPUTE_ISA, except for a mention of its
existence in the CGEN documentation). On the contrary, by using a
run-time function I'd be able to converge (i.e. to map) all isas into
a singe virtual one, on which I can perform any processing or analysis
I might need later. Do you think it is a correct and a possible
approach? If not, would you be so kind to give me a hint of how to
write CGEN_COMPUTE_ISA please?

Sincerely,
Lev.

On Tue, Jun 11, 2013 at 5:20 PM, Frank Ch. Eigler <[email protected]> wrote:
> Hi -
>
>> (I'm not 100% sure if this is a correct place to ask, [...]
>
> It is.
>
>> 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. [...]
>
> Have you considered using macros to expand to explicit isa-specific
> instructions (basically generating the cartesian product of
> instruction X isa in the cgen model), as opposed to trying to do this
> selection based upon a run-time function call?
>
> - FChE
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.