diff options
author | Philippe Mathieu-Daudé <f4bug@amsat.org> | 2019-03-10 01:34:27 +0100 |
---|---|---|
committer | Laurent Vivier <laurent@vivier.eu> | 2019-05-17 00:30:47 +0200 |
commit | 60d3d0cfeb1658d2827d6a4f0df27252bb36baba (patch) | |
tree | 0365a11d4b7face484b59ab998f8305d84218231 /target/m68k | |
parent | 44c64e90950adf9efe7f4235a32eb868d1290ebb (diff) | |
download | qemu-60d3d0cfeb1658d2827d6a4f0df27252bb36baba.zip qemu-60d3d0cfeb1658d2827d6a4f0df27252bb36baba.tar.gz qemu-60d3d0cfeb1658d2827d6a4f0df27252bb36baba.tar.bz2 |
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().
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20190310003428.11723-6-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'target/m68k')
-rw-r--r-- | target/m68k/translate.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/target/m68k/translate.c b/target/m68k/translate.c index bf700c0..f0534a4 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -3693,6 +3693,7 @@ static TCGv rotate_x(TCGv reg, TCGv shift, int left, int size) tcg_gen_sub_i32(shl, shl, shift); /* shl = size + 1 - shift */ tcg_gen_sub_i32(shx, sz, shift); /* shx = size - shift */ } + tcg_temp_free_i32(sz); /* reg = (reg << shl) | (reg >> shr) | (x << shx); */ @@ -3708,9 +3709,7 @@ static TCGv rotate_x(TCGv reg, TCGv shift, int left, int size) /* X = (reg >> size) & 1 */ X = tcg_temp_new(); - tcg_gen_shr_i32(X, reg, sz); - tcg_gen_andi_i32(X, X, 1); - tcg_temp_free(sz); + tcg_gen_extract_i32(X, reg, size, 1); return X; } |