This is the mail archive of the
cgen@sourceware.org
mailing list for the CGEN project.
Re: Simulator: base_insn and insn in decode.c
I've been on vacation....
Ronald Hecht wrote:
The test around the goto is intended to make sure that the untested
base_insn bits are as expected. It needs to be there, otherwise,
invalid insns get recognized as valid ones. However, it would seem
that the test should be against base_insn and not against
entire_insn. I'll have a look at some other cgen simulators,
including those which use SID to make sure that this assertion holds
water. It probably hasn't come up until now, since most sims I have
seen are able to pass the same value for base_insn and entire_insn.
Dave
I agreee. The test should be against base_insn. But then it still
seems to be double-checking against the same, or not?
No it's not a redundant test. The decoder only tests enough bits in the
switch to uniquely separate the valid insns. There may be invalid bit
patterns (i.e. unused opcodes) that still match. The secondary test
makes sure that *all* of the opcode bits in the insn are tested.
Dave