On 04/08/2010 09:32 AM, Richard Henderson wrote: >>> +static void tcg_out_ori(TCGContext *s, int ret, int arg, tcg_target_ulong >>> m) >>> +{ >>> + if (m == 0) { >>> + tcg_out_mov(s, ret, arg); >>> + } else if (m == -1) { >>> + tcg_out_movi(s, TCG_TYPE_I32, ret, -1); >> >> Those cases are already eliminated in tcg/tcg-op.h. This code looks >> redundant. > > The cases eliminated in tcg-op.h are with immediate constants. > There is no generic code in tcg.c to eliminate these cases > after constant propagation. However, I can remove them with...
For the record, a real case that appears in linux-test-0.3 sparc: 0x435e8ac4: andcc %g0, %g0, %o4 ---- 0x435e8ac4 movi_i32 tmp19,$0x0 movi_i32 tmp20,$0x0 and_i32 loc4,tmp19,tmp20 mov_i32 cc_dst,loc4 movi_i32 cc_op,$0xb st_i32 loc4,regwptr,$0x10 The and_i32 there is "loc4 = 0 & 0". I've no idea why the original sparc code uses this instruction. r~