[Qemu-devel] [PATCH 2/3] target/riscv: optimize indirect branches

Emilio G. Cota posted 3 patches 7 years, 2 months ago
There is a newer version of this series
[Qemu-devel] [PATCH 2/3] target/riscv: optimize indirect branches
Posted by Emilio G. Cota 7 years, 2 months ago
Signed-off-by: Emilio G. Cota <cota@braap.org>
---
 target/riscv/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/riscv/translate.c b/target/riscv/translate.c
index ec2988b4f6..66a80ca772 100644
--- a/target/riscv/translate.c
+++ b/target/riscv/translate.c
@@ -548,7 +548,7 @@ static void gen_jalr(CPURISCVState *env, DisasContext *ctx, uint32_t opc,
         if (rd != 0) {
             tcg_gen_movi_tl(cpu_gpr[rd], ctx->pc_succ_insn);
         }
-        tcg_gen_exit_tb(NULL, 0);
+        tcg_gen_lookup_and_goto_ptr();
 
         if (misaligned) {
             gen_set_label(misaligned);
-- 
2.17.1


Re: [Qemu-devel] [PATCH 2/3] target/riscv: optimize indirect branches
Posted by Richard Henderson 7 years, 2 months ago
On 08/09/2018 02:43 PM, Emilio G. Cota wrote:
> Signed-off-by: Emilio G. Cota <cota@braap.org>
> ---
>  target/riscv/translate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target/riscv/translate.c b/target/riscv/translate.c
> index ec2988b4f6..66a80ca772 100644
> --- a/target/riscv/translate.c
> +++ b/target/riscv/translate.c
> @@ -548,7 +548,7 @@ static void gen_jalr(CPURISCVState *env, DisasContext *ctx, uint32_t opc,
>          if (rd != 0) {
>              tcg_gen_movi_tl(cpu_gpr[rd], ctx->pc_succ_insn);
>          }
> -        tcg_gen_exit_tb(NULL, 0);
> +        tcg_gen_lookup_and_goto_ptr();
>  
>          if (misaligned) {
>              gen_set_label(misaligned);
> 


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~