This is the mail archive of the cgen@sourceware.org mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: generated decoder code question


Hi -

> In the utils-sim.scm file, the "-gen-decode-insn-entry" function has
> the following lines:
> 		     ; Generate code to check that all of the opcode bits 
> 		     for this insn match
> [...]
> It generates an IF-statement to check the opcode again inside the case
> statement before doing the real extraction. This seems really
> redundant 


I believe that this check is done because the switch statement by
itself is not necessarily sufficient.  The switch may simply
disambiguate the instructions (so no two candidate instructions fall
into the same switch case), but that could leave some additional
decodeable bits.  Those bits would need to be tested to tell apart the
remaining candidate instruction from illegal opcodes.

> and make the decoder inefficient.

Do you have a sense of how frequently such a test is completely
redundant, and how much additional time this test takes?

- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]