On 21 April 2015 at 22:23, Chen Gang <xili_gchen_5...@hotmail.com> wrote: > On 4/22/15 05:15, Peter Maydell wrote: >> will work in place of both of the above (and does this CPU >> really only have two kinds of compare-immediate? Some of the >> case labels suggest not, so it would be better to just implement >> all the compare-immediates together in one patch.) >> >> You can probably use a function to do the sub-opcode-to-TCGCond >> lookup too. >> >> Having dozens of two line functions that all look incredibly >> similar is a really strong sign that you haven't taken >> advantage of the commonality between them. CPU instruction >> sets are usually pretty regular if they're well designed and >> the resulting translate.c should also look pretty regular. >> > > I guess what you said is correct, but at present, I did not think of all > gen_cmp* (but it should really be done at last). > > So for me, at present, we can leave it as current implementation (Add > FIXME comment). And at last (when almost finish all opcode decoding), I > shall rewrite it again.
If you rewrite it all at the end then we get twice the code review work to do. Please just do it right the first time. -- PMM