On 1/28/21 5:39 AM, Stefan Weil wrote: >> - case INDEX_op_div2_i32: /* Optional (TCG_TARGET_HAS_div2_i32). */ >> - case INDEX_op_divu2_i32: /* Optional (TCG_TARGET_HAS_div2_i32). */ >> - TODO(); >> - break; >> #if TCG_TARGET_REG_BITS == 32 >> case INDEX_op_add2_i32: >> case INDEX_op_sub2_i32: > > > One of the ideas for TCI is that it should ideally support any subset of TCG > opcodes which is used by an existing TCG backend or a newly written backend. > > This only requires copying the TCG_TARGET_HAS... defines. > > So this patch should keep the preprocessor conditionals, and the TODO > statements have to be replaced by code (or #error for the moment).
If that's what you are after, easily configure different setups, you still don't need the ifdefs. Just change the TCG_TARGET_HAS_* definition in the header file. The ifdefs are not necessary. They will be unreachable code if you zero out the HAS, but they'll still compile. As for div2, there is no code for it in tci.c and therefore there should be no code for it in tcg-target.c.inc. Those bits of code are a pair and must to be added together. r~