target/m68k: Optimize rotate_x() using extract_i32()

Optimize rotate_x() using tcg_gen_extract_i32(). We can now free the
'sz' tcg_temp earlier. Since it is allocated with tcg_const_i32(),
free it with tcg_temp_free_i32().

Backports commit 60d3d0cfeb1658d2827d6a4f0df27252bb36baba from qemu
This commit is contained in:
Philippe Mathieu-Daudé 2019-05-17 12:07:05 -04:00 committed by Lioncash
parent 3c6cb445a0
commit 4a1b8d64bd
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -3860,6 +3860,7 @@ static TCGv rotate_x(DisasContext *s, TCGv reg, TCGv shift, int left, int size)
tcg_gen_sub_i32(tcg_ctx, shl, shl, shift); /* shl = size + 1 - shift */
tcg_gen_sub_i32(tcg_ctx, shx, sz, shift); /* shx = size - shift */
}
tcg_temp_free_i32(tcg_ctx, sz);
/* reg = (reg << shl) | (reg >> shr) | (x << shx); */
@ -3875,9 +3876,7 @@ static TCGv rotate_x(DisasContext *s, TCGv reg, TCGv shift, int left, int size)
/* X = (reg >> size) & 1 */
X = tcg_temp_new(tcg_ctx);
tcg_gen_shr_i32(tcg_ctx, X, reg, sz);
tcg_gen_andi_i32(tcg_ctx, X, X, 1);
tcg_temp_free(tcg_ctx, sz);
tcg_gen_extract_i32(tcg_ctx, X, reg, size, 1);
return X;
}