On 09/26/2013 05:48 PM, Alexander Graf wrote:
> + if (is_k) {
> + tcg_imm = tcg_const_i64(imm);
> + tcg_gen_deposit_i64(cpu_reg(reg), cpu_reg(reg), tcg_imm, pos, 16);
> + tcg_temp_free_i64(tcg_imm);
> + } else {
> + tcg_gen_movi_i64(cpu_reg(reg), imm << pos);
> + }
> +
> + if (is_n) {
> + tcg_gen_not_i64(cpu_reg(reg), cpu_reg(reg));
> + }
> +
> + if (is_32bit) {
> + tcg_gen_ext32u_i64(cpu_reg(reg), cpu_reg(reg));
> + }
You've a constant input. This should be done in one tcg op:
if (is_k) {
...
} else {
imm <<= pos;
if (is_n) {
imm = ~imm;
}
if (is_32bit) {
imm &= 0xffffffffu;
}
tcg_gen_movi_i64(cpu_reg(reg), imm);
}
r~