target-mips: optimize gen_arith()/gen_arith_imm()