From patchwork Sun Jun 20 04:21:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464312 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1356326jao; Sat, 19 Jun 2021 21:22:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwe4rd45urMzyIeIeicJe89y81JElikMq0SskFOJ2H6w+T8c3FEhqXevpkimuBee2b8/vWq X-Received: by 2002:a6b:6813:: with SMTP id d19mr499640ioc.35.1624162943054; Sat, 19 Jun 2021 21:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624162943; cv=none; d=google.com; s=arc-20160816; b=0dIAkSwyDztUs9WUFjwQ86Uu2GBwkkug2IAELJglGFbve3gVasNNr5x1tVSRGph179 wyf1dfIdyMWpydJnjYvsg8DBiEvDpxlsfhn71syyLZqkCkrYT5tpH43W7mtLC80Vhk/V EQgd1Coz1VDgN+rNQ7/JaHoXWLUSqirgNGs5f93qVcDSi1fRYIXb1oMw+2RzY7qJFRGn j815aq+asiIcCkc5E1aWEgNhyM8T1/fNAAFId+WCGyXu8z4T5e/KzcopMhURP2EKxG38 KnrXvoRrTbvV8Xhq8F27nTecr9hJ3frCBrdDY2vHpbYRPv9OrfIswwBXpQy4pE/0y7NW 3RwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=IZqsDG39a6RHRH2b5Sr2GJhmurivUBKrieIfGWTmK84=; b=EXWEhYqe3/G5yysC3PKqJVz3QCJdIF6eJ0RrFtHoCOdqlpGxRolzcIYRc1IPn2QPd2 Rv8oLQMphDiiZZD2A40cJR2k5IU+W6JHS5wUF+KInOVP9gXYd0WdVPIL6Gxh3k7fw4Vm fVR7asCsNnKPbGrZ/Tqwv9/fAa5CDVBfaX4xOI/IEUkJEHNwg0pBMuSP5sOvXqCKOIAA cnznu4eWOMPmsAkXlgDnqMmbUGLFP8B+TqAHRuADWFRXCueEPgrJY9m2/L2Y1DTJEZsZ 9iUANJk2uosKje0lHy/uvApStJsHIr5GA3BZSgknpakQNRrvHbLGXDjWHRh2KVF6+IfJ mtVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pVCT87TE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id t18si5004595jan.32.2021.06.19.21.22.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Jun 2021 21:22:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pVCT87TE; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1luoyU-0005KJ-Fb for patch@linaro.org; Sun, 20 Jun 2021 00:22:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoxv-0005JH-R1 for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:49 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:45609) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxt-0007wh-KH for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:47 -0400 Received: by mail-pj1-x102d.google.com with SMTP id z3-20020a17090a3983b029016bc232e40bso8201946pjb.4 for ; Sat, 19 Jun 2021 21:21:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IZqsDG39a6RHRH2b5Sr2GJhmurivUBKrieIfGWTmK84=; b=pVCT87TE9S4M9yQd73oboYgxnps1F6q+x7Zg4HtC1OhXDBoFf0eZy3lg1L8n/+JiS+ yEtQs+JbakYXRSfwoPoLscTcxJxGRa0y22qqskTnJioPeHq2HiRp+dAm+5oOAupgu+Sc Z8ZxAG3L0Dp0KwPZdmrMWT70neyz6Uqhg0Lnvgm15vOqajPwDjSkImYrpgPypAYswiOs JaBQ/GnDlCWiFtr4Iel76Ftw3IcfuX/woUxqvSMqRxUW+T/oTKQrRk51hKbM+bvgMGdO c2GdhTDnm+v5fXI7rJrj971Oa6lBnLU5JdIr2b9bPVkGkoaGYosgR8DSAz86N3dhrLW/ Sl5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IZqsDG39a6RHRH2b5Sr2GJhmurivUBKrieIfGWTmK84=; b=RuuMl2kuk7caJUP3osoGJxbNhKSQ7diCPXyvOdlmLzatBXXr59fjSdIbSGRmwggLo1 pBaniOCGsLVp9jJFIOWENa2OUxstKQCx2qENDfyQXucUNOwHt3iD6h4nB+iIS4OMvhhQ brl39z74898gy5s3M8f5w0T4zkyEp4Nh3+fKnumeku3vO4sYWkwCIJAkYXeu/wlKwzyJ 7SMR9Q58w33VJ3EIFwvMxT6noEovshHqVhhNtMDeE5q02PTaO2+Xa+maxXGYMGf9OTm+ 3EEeKU81OurfviMhXvVoXAMEC8XhvGiquRtS3GtlG1hNkRkzm/pan0pD/JNJncS8nByL pN7A== X-Gm-Message-State: AOAM531te2CWgJy3kidgTcxmKyI05kA2IoYzcuOjy0I2K75VcfbaWu4Q DGnn0LTlngYunyaFK7nfukfFA4XQVoS/6w== X-Received: by 2002:a17:90a:9f81:: with SMTP id o1mr29578610pjp.96.1624162904230; Sat, 19 Jun 2021 21:21:44 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/9] target/cris: Add DisasContextBase to DisasContext Date: Sat, 19 Jun 2021 21:21:33 -0700 Message-Id: <20210620042141.1235541-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Migrate the is_jmp, tb and singlestep_enabled fields from DisasContext into the base. Signed-off-by: Richard Henderson --- target/cris/translate.c | 49 +++++++++++++++++---------------- target/cris/translate_v10.c.inc | 4 +-- 2 files changed, 27 insertions(+), 26 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index 6dd5a267a6..bed7a7ed10 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -85,6 +85,8 @@ static TCGv env_pc; /* This is the state at translation time. */ typedef struct DisasContext { + DisasContextBase base; + CRISCPU *cpu; target_ulong pc, ppc; @@ -121,7 +123,6 @@ typedef struct DisasContext { int clear_locked_irq; /* Clear the irq lockout. */ int cpustate_changed; unsigned int tb_flags; /* tb dependent flags. */ - int is_jmp; #define JMP_NOJMP 0 #define JMP_DIRECT 1 @@ -131,9 +132,6 @@ typedef struct DisasContext { uint32_t jmp_pc; int delayed_branch; - - TranslationBlock *tb; - int singlestep_enabled; } DisasContext; static void gen_BUG(DisasContext *dc, const char *file, int line) @@ -531,7 +529,7 @@ static void t_gen_cc_jmp(TCGv pc_true, TCGv pc_false) static inline bool use_goto_tb(DisasContext *dc, target_ulong dest) { #ifndef CONFIG_USER_ONLY - return (dc->tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK) || + return (dc->base.pc_first & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK) || (dc->ppc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); #else return true; @@ -543,7 +541,7 @@ static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest) if (use_goto_tb(dc, dest)) { tcg_gen_goto_tb(n); tcg_gen_movi_tl(env_pc, dest); - tcg_gen_exit_tb(dc->tb, n); + tcg_gen_exit_tb(dc->base.tb, n); } else { tcg_gen_movi_tl(env_pc, dest); tcg_gen_exit_tb(NULL, 0); @@ -2037,14 +2035,14 @@ static int dec_setclrf(CPUCRISState *env, DisasContext *dc) /* Break the TB if any of the SPI flag changes. */ if (flags & (P_FLAG | S_FLAG)) { tcg_gen_movi_tl(env_pc, dc->pc + 2); - dc->is_jmp = DISAS_UPDATE; + dc->base.is_jmp = DISAS_UPDATE; dc->cpustate_changed = 1; } /* For the I flag, only act on posedge. */ if ((flags & I_FLAG)) { tcg_gen_movi_tl(env_pc, dc->pc + 2); - dc->is_jmp = DISAS_UPDATE; + dc->base.is_jmp = DISAS_UPDATE; dc->cpustate_changed = 1; } @@ -2886,14 +2884,14 @@ static int dec_rfe_etc(CPUCRISState *env, DisasContext *dc) LOG_DIS("rfe\n"); cris_evaluate_flags(dc); gen_helper_rfe(cpu_env); - dc->is_jmp = DISAS_UPDATE; + dc->base.is_jmp = DISAS_UPDATE; break; case 5: /* rfn. */ LOG_DIS("rfn\n"); cris_evaluate_flags(dc); gen_helper_rfn(cpu_env); - dc->is_jmp = DISAS_UPDATE; + dc->base.is_jmp = DISAS_UPDATE; break; case 6: LOG_DIS("break %d\n", dc->op1); @@ -2904,7 +2902,7 @@ static int dec_rfe_etc(CPUCRISState *env, DisasContext *dc) /* Breaks start at 16 in the exception vector. */ t_gen_movi_env_TN(trap_vector, dc->op1 + 16); t_gen_raise_exception(EXCP_BREAK); - dc->is_jmp = DISAS_UPDATE; + dc->base.is_jmp = DISAS_UPDATE; break; default: printf("op2=%x\n", dc->op2); @@ -3146,13 +3144,16 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) * delayslot, like in real hw. */ pc_start = tb->pc & ~1; - dc->cpu = env_archcpu(env); - dc->tb = tb; - dc->is_jmp = DISAS_NEXT; + dc->base.tb = tb; + dc->base.pc_first = pc_start; + dc->base.pc_next = pc_start; + dc->base.is_jmp = DISAS_NEXT; + dc->base.singlestep_enabled = cs->singlestep_enabled; + + dc->cpu = env_archcpu(env); dc->ppc = pc_start; dc->pc = pc_start; - dc->singlestep_enabled = cs->singlestep_enabled; dc->flags_uptodate = 1; dc->flagx_known = 1; dc->flags_x = tb->flags & X_FLAG; @@ -3189,7 +3190,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) cris_evaluate_flags(dc); tcg_gen_movi_tl(env_pc, dc->pc); t_gen_raise_exception(EXCP_DEBUG); - dc->is_jmp = DISAS_UPDATE; + dc->base.is_jmp = DISAS_UPDATE; /* The address covered by the breakpoint must be included in [tb->pc, tb->pc + tb->size) in order to for it to be properly cleared -- thus we increment the PC here so that @@ -3242,18 +3243,18 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) gen_goto_tb(dc, 1, dc->jmp_pc); gen_set_label(l1); gen_goto_tb(dc, 0, dc->pc); - dc->is_jmp = DISAS_TB_JUMP; + dc->base.is_jmp = DISAS_TB_JUMP; dc->jmp = JMP_NOJMP; } else if (dc->jmp == JMP_DIRECT) { cris_evaluate_flags(dc); gen_goto_tb(dc, 0, dc->jmp_pc); - dc->is_jmp = DISAS_TB_JUMP; + dc->base.is_jmp = DISAS_TB_JUMP; dc->jmp = JMP_NOJMP; } else { TCGv c = tcg_const_tl(dc->pc); t_gen_cc_jmp(env_btarget, c); tcg_temp_free(c); - dc->is_jmp = DISAS_JUMP; + dc->base.is_jmp = DISAS_JUMP; } break; } @@ -3264,7 +3265,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) if (!(tb->pc & 1) && cs->singlestep_enabled) { break; } - } while (!dc->is_jmp && !dc->cpustate_changed + } while (!dc->base.is_jmp && !dc->cpustate_changed && !tcg_op_buf_full() && !singlestep && (dc->pc - page_start < TARGET_PAGE_SIZE) @@ -3277,10 +3278,10 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) npc = dc->pc; /* Force an update if the per-tb cpu state has changed. */ - if (dc->is_jmp == DISAS_NEXT + if (dc->base.is_jmp == DISAS_NEXT && (dc->cpustate_changed || !dc->flagx_known || (dc->flags_x != (tb->flags & X_FLAG)))) { - dc->is_jmp = DISAS_UPDATE; + dc->base.is_jmp = DISAS_UPDATE; tcg_gen_movi_tl(env_pc, npc); } /* Broken branch+delayslot sequence. */ @@ -3293,12 +3294,12 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) cris_evaluate_flags(dc); if (unlikely(cs->singlestep_enabled)) { - if (dc->is_jmp == DISAS_NEXT) { + if (dc->base.is_jmp == DISAS_NEXT) { tcg_gen_movi_tl(env_pc, npc); } t_gen_raise_exception(EXCP_DEBUG); } else { - switch (dc->is_jmp) { + switch (dc->base.is_jmp) { case DISAS_NEXT: gen_goto_tb(dc, 1, npc); break; diff --git a/target/cris/translate_v10.c.inc b/target/cris/translate_v10.c.inc index f7cd67be37..dd44a7eb97 100644 --- a/target/cris/translate_v10.c.inc +++ b/target/cris/translate_v10.c.inc @@ -1169,7 +1169,7 @@ static unsigned int dec10_ind(CPUCRISState *env, DisasContext *dc) t_gen_mov_env_TN(trap_vector, c); tcg_temp_free(c); t_gen_raise_exception(EXCP_BREAK); - dc->is_jmp = DISAS_UPDATE; + dc->base.is_jmp = DISAS_UPDATE; return insn_len; } LOG_DIS("%d: jump.%d %d r%d r%d\n", __LINE__, size, @@ -1277,7 +1277,7 @@ static unsigned int crisv10_decoder(CPUCRISState *env, DisasContext *dc) if (dc->clear_prefix && dc->tb_flags & PFIX_FLAG) { dc->tb_flags &= ~PFIX_FLAG; tcg_gen_andi_tl(cpu_PR[PR_CCS], cpu_PR[PR_CCS], ~PFIX_FLAG); - if (dc->tb_flags != dc->tb->flags) { + if (dc->tb_flags != dc->base.tb->flags) { dc->cpustate_changed = 1; } } From patchwork Sun Jun 20 04:21:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464318 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1357558jao; Sat, 19 Jun 2021 21:24:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcTHhN+QOfe9tI61IoppXdUbdYvPhBnMI/LOhzO+B3q7KrFqhGfQlCUhvBIeVvFMpfJGUu X-Received: by 2002:a25:9b08:: with SMTP id y8mr23697639ybn.417.1624163081516; Sat, 19 Jun 2021 21:24:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624163081; cv=none; d=google.com; s=arc-20160816; b=v7J9VS7yUD4K0Pt9LmWI7UsT4VLSZLtYALz0VkMKlRyDlpG3dBd4MlhIrCg8w4hgJ2 mLTpcGEFrShkcXox+HvAQMfqDvbwAJTcJFimcpwxLrMqUf+viFGBkQG/7AgOFCnVJ+8R 9ZlPYPLNgtGx3Wa6RxJPvbg4vvnYqbiyYK5jXXnO0nOKyY5bQnxU/VfH3wjj9LDjBr4O koUOP5xjfgHJtuLIHPzjKO4kORiFu4ifIFaAOzdGFJEjKMktrPVI0e5KnW7KfHUzIa2h MG27eMmRs+4ARxyyoJ9G+PvY/EbftoBZ261XN+0hoD1FgDhem8XBRCrW1PhUi5uKzu3v uLrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ktgo4xWUwEPLcu/uB4HSWazqzoEfJMOHsnknfFL5vLg=; b=ECX5x+nMRS7G6iPMyVfct1REK7OkBc0pmCsrjuXdJAZwCs8qXQEQ9I8s7M5Y3rKR+e /r0d/HOZ0tM3CL8auJGHnyeqzzZMEgtrdn+9XUK4ZvdHzEFnb9dyhqe/NMRNJWVLracF jMUVBF0zHiCmsD1+JnJpjp1gNviLfe5RvnQasCVwh/h3HN1YMISZJ5vFcYHEbRiMc0Gn dnmfC6otJJn/MqwVrf2rclfDRX0/1d/+XLW+tw1i7Oz3rxEMFfV78sMxDQSbNLalUMQJ wOFDSis+8TTner4WahUZ2ysuB83fOIwFxLZhVTKdXjxs4EJe5AVaQNyxO1eBQaqVUs8M iing== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c2brptxg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y2si7124002ybk.52.2021.06.19.21.24.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Jun 2021 21:24:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c2brptxg; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lup0i-0002TS-W0 for patch@linaro.org; Sun, 20 Jun 2021 00:24:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoxw-0005JI-RC for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:50 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:46943) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxu-0007x6-2d for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:48 -0400 Received: by mail-pf1-x431.google.com with SMTP id x16so10978592pfa.13 for ; Sat, 19 Jun 2021 21:21:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ktgo4xWUwEPLcu/uB4HSWazqzoEfJMOHsnknfFL5vLg=; b=c2brptxgdv6EOmz8vTGY5YLkwDzhXqq3s79sfvVO3gYB8KuWIJaOo5RhAffFnTmaEp sr4I6FWTlFyOhVmvkHkto7GP30Ri+hAC1vX29GI3xN76QHfbVCLUyJhYO6OarhcOUZWY 0DJgWdtifQNqyYdPdZ7Ry/KjLwaxY0H7jMa+Z6iO4XAhawlbaMQ/XxP+kXMBeKE8xKAU dNESrARWgw6uSLwtZ++A4mj0JSNxLNHcytZhcSIjVwZnYpQgGGDl0tWP804i7UsQpqf5 cQK4/UOu9bh2uG8QBlwQAs8K/eBUH6sZV0qGLndRpyAufhtz5FgdL95Es/2lE2ZNnLMd Mcsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ktgo4xWUwEPLcu/uB4HSWazqzoEfJMOHsnknfFL5vLg=; b=Z6crMwvlGUY69ZE5svjlxTm5mjqIkWB4/3ksZps7vrdnSEi/0oeLFjRpDpgZsLCdqs nYABH0iQiYChozV8HerfEzXiR6vZURoRoTZQJbdn/kvssgWSB8ZewhvakbQQpNxVcBXJ HKzyNKK/3K16HH3mswgrg9CrpfgzpS6hGCevuR7WnB4z9KigY5/GAHgAvfmWLTg8LwoK tZ7cdRKFGp2jUroR5Ul56uay+EhkBOFJsFwQQUdbOr9EguMZnrmjunwf5lS06xcPpsXS dOSCCWkgRD9XXE390UdtI+lh2KvRCgr8w+q85W2V8hjQvynm1d9Hit/QCFmNRMvmCYzD P0+g== X-Gm-Message-State: AOAM532XWiy0obLJnxlnxaxaMeheTPuhHqBS/WSyyLNilYEja1y+U5Rw md7yOfYTQUA4BQgBzN1VJrcCzK4eBb+olA== X-Received: by 2002:a65:6a52:: with SMTP id o18mr17601325pgu.177.1624162904719; Sat, 19 Jun 2021 21:21:44 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/9] target/cris: Replace DISAS_TB_JUMP with DISAS_NORETURN Date: Sat, 19 Jun 2021 21:21:34 -0700 Message-Id: <20210620042141.1235541-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The only semantic of DISAS_TB_JUMP is that we've done goto_tb, which is the same as DISAS_NORETURN -- we've exited the tb. Signed-off-by: Richard Henderson --- target/cris/translate.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index bed7a7ed10..2ff4319dd1 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -55,7 +55,6 @@ /* is_jmp field values */ #define DISAS_JUMP DISAS_TARGET_0 /* only pc was modified dynamically */ #define DISAS_UPDATE DISAS_TARGET_1 /* cpu state was modified dynamically */ -#define DISAS_TB_JUMP DISAS_TARGET_2 /* only pc was modified statically */ #define DISAS_SWI DISAS_TARGET_3 /* Used by the decoder. */ @@ -3243,12 +3242,12 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) gen_goto_tb(dc, 1, dc->jmp_pc); gen_set_label(l1); gen_goto_tb(dc, 0, dc->pc); - dc->base.is_jmp = DISAS_TB_JUMP; + dc->base.is_jmp = DISAS_NORETURN; dc->jmp = JMP_NOJMP; } else if (dc->jmp == JMP_DIRECT) { cris_evaluate_flags(dc); gen_goto_tb(dc, 0, dc->jmp_pc); - dc->base.is_jmp = DISAS_TB_JUMP; + dc->base.is_jmp = DISAS_NORETURN; dc->jmp = JMP_NOJMP; } else { TCGv c = tcg_const_tl(dc->pc); @@ -3311,7 +3310,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) tcg_gen_exit_tb(NULL, 0); break; case DISAS_SWI: - case DISAS_TB_JUMP: + case DISAS_NORETURN: /* nothing more to generate */ break; } From patchwork Sun Jun 20 04:21:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464317 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1357557jao; Sat, 19 Jun 2021 21:24:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwORVGOXmBrV08b6M6rjlSQNln0eWpPP/nEtejeerrmOxXXybGuE6C7Vd1B9TuPcZ8TZpq6 X-Received: by 2002:a02:7348:: with SMTP id a8mr11017281jae.116.1624163081501; Sat, 19 Jun 2021 21:24:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624163081; cv=none; d=google.com; s=arc-20160816; b=XrwzFmCy5xA4nsfdWnIQuZ2EjpVCLvv3vk7yjP7ZzDp+O4ijWgnKm/d7EBpe5WZFdP bTLK/crIa88S2Y56lQVHoxFEm2mYhs51ljaev4B8ejCbHvf+2jKQAqhlrhCbDHDGfj6D 1u825OHHSRzADPruGz4Es14oblPjvo6yKGOxydD6Bk9rVs06rnUEl5rtK7KvovAVhUY4 VbuXpkcdekVVGHENhXr/qHzBC8Zv5yGYy142Q+Ns4TiNedZg13IEmewUG0G2wxRCtoCn AC25dt1RvkcxeEcFUU4SONh8kGvUdTGJL5QyUZSt/5ZeTOnS+3H9UqDW2sGEoRAT+jC3 70/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=4qZYFgo5owfVk6zq1cDCv8vj7PKVInUCjUJb6z1w1uE=; b=mo3sdkuaMcMBSknTpSkUU8VT0/zKStN4TwXYnYav/TmOrp/62o0u3fjusg1i1VgRg3 MPUFBBSK2KtF7j20E7p57BMW3R0ai7/ViGRJuq7ueRWWsNrW3nz9jSt6H6qwURBPkBEx rAHx9FDE5w88tkZx7WFiPGeBgUje/oIsVHpR0zQTQuyI6q/3r0KSwxV9rLALo0kURlpF 6AV5aF78ZcvCOJRfTwKRy51x5Am1lh0rVUkHMBPVGSMzBlhFUUQ7gfz+jQIDqkPEx9yp CBTZMM7le35FSzSM3M8xjJXd0KlctSTagLaAP7G6y5DY/1sd+aTPAsNtByIWiNNY9+FN 1elw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MeGcgIkU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j25si11756858jaj.93.2021.06.19.21.24.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Jun 2021 21:24:41 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MeGcgIkU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:32888 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lup0i-0002av-T7 for patch@linaro.org; Sun, 20 Jun 2021 00:24:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoxw-0005JJ-Vt for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:50 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:39439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxu-0007xg-OS for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:48 -0400 Received: by mail-pg1-x532.google.com with SMTP id w31so11273019pga.6 for ; Sat, 19 Jun 2021 21:21:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4qZYFgo5owfVk6zq1cDCv8vj7PKVInUCjUJb6z1w1uE=; b=MeGcgIkUojPaUt2PUP5BJce9SYH/8P7z2BAImjnfAIUiIUsUJlhwNtP0ArJPb9excy 3w+TfpC6f2G3xF6k9f/UmCylTRqHh4ZAH1BlcW/iGdNIp/cTwXKzkNLSRUkyoduzXJud Xg5CmTrdJ3MkqPGs4ejxjXUTl94c9HBKNktqvZX4/rEaQB7tfEFRO0XJL41lDCHJ+IB5 gONDUZE0UetTC0RkHBHRv4FpGh3xl5Q176UzSl0/ejU8fitKbOZ2+PgtI4kR1tdindHR J8TVfni/iFiT/svg/K8rKIj9HnlixSTRj5nn3imR++oPhhR0GvHf3nxF317incriEdPc LdeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4qZYFgo5owfVk6zq1cDCv8vj7PKVInUCjUJb6z1w1uE=; b=mPyOJ2Sau+bhVCsbfblksT2wAw1GyqtMu9bi5UpAAQqOvlYPmGa0E4zJl0YqtslHiB EQcOOLxKUUWtfBii/USoA6ChTy3p2DsPnoorGOGUC4gFbfQ/4m72gZSs5UxC4Vp3o3zY fxRxz0fvHmKduD0bgERdbqLuexw3fX65nT2nGhVhaecSbr2CMMMeRhhmclC5ZMvza1DJ RIzdx9CSlFBttaOco0eG/1CmH72A+AUSjNg5uvSkTHqfB+qNnoZjADIQAzA0mWkE6v1n N/CGBUhV6kZjOZW2KRhHxypMgVLYRDwye5BsFcl/J1gGVI/Tt7kF/CJRTiWB9xeMH4SG fr/w== X-Gm-Message-State: AOAM531J7ezI/Y3VTYiLKhN52tmuuS9eyonPp4lbALJNKInjMwOAxQUx p5nYZ4I4YpU6ljgGjwoD/hScVs6RpVi7ZA== X-Received: by 2002:a65:638e:: with SMTP id h14mr17810222pgv.108.1624162905225; Sat, 19 Jun 2021 21:21:45 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 3/9] target/cris: Mark exceptions as DISAS_NORETURN Date: Sat, 19 Jun 2021 21:21:35 -0700 Message-Id: <20210620042141.1235541-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" After we've raised the exception, we have left the TB. Signed-off-by: Richard Henderson --- target/cris/translate.c | 5 +++-- target/cris/translate_v10.c.inc | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index 2ff4319dd1..f8b574b0b6 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -2874,6 +2874,7 @@ static int dec_rfe_etc(CPUCRISState *env, DisasContext *dc) -offsetof(CRISCPU, env) + offsetof(CPUState, halted)); tcg_gen_movi_tl(env_pc, dc->pc + 2); t_gen_raise_exception(EXCP_HLT); + dc->base.is_jmp = DISAS_NORETURN; return 2; } @@ -2901,7 +2902,7 @@ static int dec_rfe_etc(CPUCRISState *env, DisasContext *dc) /* Breaks start at 16 in the exception vector. */ t_gen_movi_env_TN(trap_vector, dc->op1 + 16); t_gen_raise_exception(EXCP_BREAK); - dc->base.is_jmp = DISAS_UPDATE; + dc->base.is_jmp = DISAS_NORETURN; break; default: printf("op2=%x\n", dc->op2); @@ -3189,7 +3190,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) cris_evaluate_flags(dc); tcg_gen_movi_tl(env_pc, dc->pc); t_gen_raise_exception(EXCP_DEBUG); - dc->base.is_jmp = DISAS_UPDATE; + dc->base.is_jmp = DISAS_NORETURN; /* The address covered by the breakpoint must be included in [tb->pc, tb->pc + tb->size) in order to for it to be properly cleared -- thus we increment the PC here so that diff --git a/target/cris/translate_v10.c.inc b/target/cris/translate_v10.c.inc index dd44a7eb97..0ba2aca96f 100644 --- a/target/cris/translate_v10.c.inc +++ b/target/cris/translate_v10.c.inc @@ -61,6 +61,7 @@ static inline void cris_illegal_insn(DisasContext *dc) { qemu_log_mask(LOG_GUEST_ERROR, "illegal insn at pc=%x\n", dc->pc); t_gen_raise_exception(EXCP_BREAK); + dc->base.is_jmp = DISAS_NORETURN; } static void gen_store_v10_conditional(DisasContext *dc, TCGv addr, TCGv val, @@ -1169,7 +1170,7 @@ static unsigned int dec10_ind(CPUCRISState *env, DisasContext *dc) t_gen_mov_env_TN(trap_vector, c); tcg_temp_free(c); t_gen_raise_exception(EXCP_BREAK); - dc->base.is_jmp = DISAS_UPDATE; + dc->base.is_jmp = DISAS_NORETURN; return insn_len; } LOG_DIS("%d: jump.%d %d r%d r%d\n", __LINE__, size, From patchwork Sun Jun 20 04:21:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464315 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1356543jao; Sat, 19 Jun 2021 21:22:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxygdGqsZG2cKg0xnVVsxqbawBxc+gAyOLXB6ljImYCPoKBsxkofNbMCGhXlldOTvLqOzqL X-Received: by 2002:a25:8506:: with SMTP id w6mr25155005ybk.379.1624162970401; Sat, 19 Jun 2021 21:22:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624162970; cv=none; d=google.com; s=arc-20160816; b=Tp3AeJGU21YG1+PSGRg4sxyrnMp9siKQ5GNeuaeTyWw30DNCme7EEZ9pqYxBbh1Fx1 c54Re+WDwRMAQQZ7BSH3YGyn8mfhrjsrd0vA5xIjuCfPGQvBAqn/lI75VFTKfsF74no8 oulnfpTDLR7Yt+1a/3io9Et6PLoD3kviD9eQL2hnepr3bNuBd/3nSiBdoLQ84pJxKd+k P1WqHCOYys/kw11OOyPXkWXOt3yrdtcVZfD0KeEC7Udy+YN5gnn5j1YMMl8mviLU66Xt Ctb7bmP6CTo4Yir+5p/ahFd8UGkFcOg8SsO6vIaJ7RrYx3WSF/EKAJVgObzyT6B55Qq/ VhGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=h38+yrqYLEF8Qg/+ccdM2Tcru/YIUG4nfpAARgqgxf4=; b=Q1KHaps02mgbJtZ2YwY/4F2g4wEQT2HVlQTkjiUadTmxpEOMC7DmAl48FHr9oWCiyh 1ZHXpQ8KgiwUKeRcOP19LuqDgxztv3VK55y/mgI74cbbh/9SpVuSF3Ha3NCLFIoXfAlG PEOMMlcXWLIxKWdeOTtcY6bz61YlLItmESkrwHwvdoYwPIdaRx/lzKnBFWHIo7+WwYCE ZHuaR7rXIwgwgW6GDQWJ3a6hgxm61XmGr3zZZfb1VMFrCezuWesOOcnYKwjaNBkRNyO3 owBIOTGyIBnWR074qcdYvoUAkl4hiH0w1WlkXaZcw1d7T1UudzNThHPmsHtAbEPBU2k4 xk7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AP0LLJU5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y13si6908996ybm.481.2021.06.19.21.22.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Jun 2021 21:22:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AP0LLJU5; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1luoyv-0005Ps-Pi for patch@linaro.org; Sun, 20 Jun 2021 00:22:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoy5-0005MI-Dv for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:57 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:41572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxv-0007xl-Bk for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:57 -0400 Received: by mail-pg1-x52a.google.com with SMTP id u190so7437885pgd.8 for ; Sat, 19 Jun 2021 21:21:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=h38+yrqYLEF8Qg/+ccdM2Tcru/YIUG4nfpAARgqgxf4=; b=AP0LLJU51LxHuc/m5L/E7Mg+gGEwsK2yIW6NfBRLfoOPq18EO8GinzG+epZmmLLpJR qJNbxe65lHW6hFAR4IGf6QtOUdBf9DwzS8wf2qaTfGjfb+99+1WXiDXhHv3gw6+Q1z7M 3ml5nbVS8UDKzzxdM/yIvyZdevhdbteCtiLb7qbEOIxCpyDPocvWz7hIXknC1nedWUHJ NZ6xu+D0pNtrNoCewMeWtfMpGQPY9fTQ8cukHO38+MVJW+EH7ifdtB7hd9Mf7IQHVtzl YLlgJaYctV5A/20MqtbD7qo5lSjs/UV5HvEnHZp1dNmJh+zS/HB2UUJmmhrv/j/H4mvg iSxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=h38+yrqYLEF8Qg/+ccdM2Tcru/YIUG4nfpAARgqgxf4=; b=nrqFLIB8VglGYRR6Wqyk09Eo+xLjSdrn8mlxRMyLhWMVtE0y2uwTxeLiyVV6oZu08+ 5E7IytBb6VtPTJsS8LZxmQgTs3oShuOgMsinNTs77jWtsDIsQvO+hvzi79FYdHnbMA3L 78eOcC9csrwzz/oTM4P2MNH9Bb6110ft9JEMFuFyljzDQ+aJaVl7m/MQ7gP2j1eT+sW+ 4x/ujcmGxa/mJVmxZ/5kdnQkfO8RY7hF31eIDDZrf+pXz4x6/27mNaRpCxaDSIV3/g7m Tbp2ibKZYA4Llhhg+sCwq2O2i1ef5x/bSMf2bwx0sUeZkf2cO2pULplzstgSI3D/4M77 jcNA== X-Gm-Message-State: AOAM531hIXAHpGL9IM9KFDeAEz+QTac9SiSBEDGqUz8ZUtWxd+NJw/xx 4923s0xmtR6tLhxN6n0CD+t+fjeCrKM7jg== X-Received: by 2002:a63:1848:: with SMTP id 8mr17820014pgy.392.1624162905841; Sat, 19 Jun 2021 21:21:45 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 4/9] target/cris: Remove DISAS_SWI Date: Sat, 19 Jun 2021 21:21:36 -0700 Message-Id: <20210620042141.1235541-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This value is unused. Signed-off-by: Richard Henderson --- target/cris/translate.c | 2 -- 1 file changed, 2 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index f8b574b0b6..24dbae6d58 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -55,7 +55,6 @@ /* is_jmp field values */ #define DISAS_JUMP DISAS_TARGET_0 /* only pc was modified dynamically */ #define DISAS_UPDATE DISAS_TARGET_1 /* cpu state was modified dynamically */ -#define DISAS_SWI DISAS_TARGET_3 /* Used by the decoder. */ #define EXTRACT_FIELD(src, start, end) \ @@ -3310,7 +3309,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) to find the next TB */ tcg_gen_exit_tb(NULL, 0); break; - case DISAS_SWI: case DISAS_NORETURN: /* nothing more to generate */ break; From patchwork Sun Jun 20 04:21:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464313 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1356331jao; Sat, 19 Jun 2021 21:22:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAmE1RVb6hcI9tZYTGuA2ih2n+as7rWo9+kIAneGkwkTthCvZJBqIyLgTqG1WDZz9QwoeI X-Received: by 2002:a5d:8242:: with SMTP id n2mr14707805ioo.198.1624162943401; Sat, 19 Jun 2021 21:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624162943; cv=none; d=google.com; s=arc-20160816; b=Klr+1AyJh5fnM/TgBor83FoQPQWWZaX4uj0LrUYiLa5d2SS/9Zn1hoKqgukZvs6G97 8ZRqHJdjQvCsMNW9fl6nm/+hGOk8Xg91m2pEo4/fX6CzVkk/3+odDs2S8aCHuJMB+vib ytbCXHpfZ++KXW86lbWsE/ND1Jc3kBriteT3AHFGsmV7cwQptuNdPTPJ6Z1Vv0VMhUN1 bNPLOR9HT2Yf2yShjmImJLoIxbW86cXAo4TXTgfrcI7S+cZp+RMLTcoXRmTVRYRsnRC+ 6UL1LSTSahY+bgOiGwN/7i63RxiELmaOhTnBjZ2DNT1XIrG2CbqTfbeurkQgJ2B3iMlz SNmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=dZADyMfffqsmp+0m+4yVAjA1tVQt/ONZZyrANqPtQYA=; b=VbI3TxanDXfFeNZ3oIlTTEK/+N1TneQa+753f2buIP7aWhbf/3HhfVFYIjxFYonBfZ VyQwFzpTKfcNx+sWQ0CT1G/QpC2WpS3PG59B3texqUDGoLC6X7VsOlJU4WAHrFNdeXG4 rqD4gcw6OMISB2AgXptQrQaapSVQnuEb5cexv5rgldVYkaKC8P5mZveiY46l13dtXPE7 95lDMViMx7XahAUX/SuqlqVvsnaPOhkBLpujbIgzcW3sqvoq8cpGSEYRAnT2Av9PgWHx ecUnS+0GDl7dTBTYIw0VY0E1e0ToRbAFTRlHRlU4bQf+CWUMOlEwJnpeGkMTGVL+Zt0w RBRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gA+kQVMU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k23si13911375iom.85.2021.06.19.21.22.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Jun 2021 21:22:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gA+kQVMU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:52564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1luoyU-0005Lv-O1 for patch@linaro.org; Sun, 20 Jun 2021 00:22:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoxz-0005JN-RB for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:53 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:42948) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxv-0007yB-RJ for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:51 -0400 Received: by mail-pj1-x1029.google.com with SMTP id 13-20020a17090a08cdb029016eed209ca4so8223891pjn.1 for ; Sat, 19 Jun 2021 21:21:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dZADyMfffqsmp+0m+4yVAjA1tVQt/ONZZyrANqPtQYA=; b=gA+kQVMUJvnbLEFrQcCp/8fjjRqGrUXBHHlyyTDbtktx8TxgqjBQnq2iJoCX0fP1Jt 6dN0RYBD9B2joHjsaHrHOlHil3K7OsnxCWLEKejapPTGVYpYeLtluiHmkiZ3kNTBDFZ5 v0oxl2U6HSGvNv9HEzzrZT1Qi+63nDAraen59yAqdvgrNP97E00FOpLpmuXY1Wx4qVix uqNWmBMX5A1rZtgPn9gtm8krytWmQVEzdS5jkJPU4LJxfiMYH8KP6x5ysf0/3SOOvxml hocpQ5Snfb1fbAC831NUDiVdXbufgwgliuqUG3fXxiOk6K8jX3GRpbVP5lfBmbfy5z+I Jukg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dZADyMfffqsmp+0m+4yVAjA1tVQt/ONZZyrANqPtQYA=; b=hgFPc3qa/y+hWsN2ZlRYQGSWU6SK+GdlBMM9QQuF1zNjX2MIUiD6o8ZIpoMNrNyF4T hBWyL2ieQhWEYx9CmGdL5dBZSSzRf7I3AB0tbRox/8yEG/hiCThDbptmKFiLvn7O4prA +Q+uhwNDvgDQKDs+pPRGO9ntmmL57B8c5mRHmvENutCiGTc5AjWGDjFjbzEjFBLw6EIU YH2aajqR+H7dgbe7AeYgpxOzFDKRWqXSjFqa9gPXC1XxMJb+TqN07M9jtxhN475Et1Fj OmEx0Hukw21lfc0dEYs/fEOdIurEWYReRFhZoDvQcPZQ6SUAvuCNKFzG5g9UUOT3YeRO nrlg== X-Gm-Message-State: AOAM5329MGeEWZc2go0CEh1ZLGe12potqdq2AhPv8DAxG/mTQPxHeTLG t753ytUaA8t7gGDNAwavjPSk9GjdaQBuZg== X-Received: by 2002:a17:90a:740a:: with SMTP id a10mr22476338pjg.162.1624162906478; Sat, 19 Jun 2021 21:21:46 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 5/9] target/cris: Convert to TranslatorOps Date: Sat, 19 Jun 2021 21:21:37 -0700 Message-Id: <20210620042141.1235541-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/cris/translate.c | 320 ++++++++++++++++++++++------------------ 1 file changed, 177 insertions(+), 143 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index 24dbae6d58..8c24053f5e 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -3119,17 +3119,11 @@ static unsigned int crisv32_decoder(CPUCRISState *env, DisasContext *dc) * */ -/* generate intermediate code for basic block 'tb'. */ -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) +static void cris_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) { + DisasContext *dc = container_of(dcbase, DisasContext, base); CPUCRISState *env = cs->env_ptr; - uint32_t pc_start; - unsigned int insn_len; - struct DisasContext ctx; - struct DisasContext *dc = &ctx; - uint32_t page_start; - target_ulong npc; - int num_insns; + uint32_t tb_flags; if (env->pregs[PR_VR] == 32) { dc->decoder = crisv32_decoder; @@ -3139,23 +3133,21 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) dc->clear_locked_irq = 1; } - /* Odd PC indicates that branch is rexecuting due to exception in the + /* + * Odd PC indicates that branch is rexecuting due to exception in the * delayslot, like in real hw. */ - pc_start = tb->pc & ~1; - - dc->base.tb = tb; - dc->base.pc_first = pc_start; - dc->base.pc_next = pc_start; - dc->base.is_jmp = DISAS_NEXT; - dc->base.singlestep_enabled = cs->singlestep_enabled; + dc->base.pc_first &= ~1; + dc->base.pc_next &= ~1; dc->cpu = env_archcpu(env); - dc->ppc = pc_start; - dc->pc = pc_start; + dc->ppc = dc->base.pc_next; + dc->pc = dc->base.pc_next; dc->flags_uptodate = 1; dc->flagx_known = 1; - dc->flags_x = tb->flags & X_FLAG; + tb_flags = dc->base.tb->flags; + dc->tb_flags = tb_flags & (S_FLAG | P_FLAG | U_FLAG | X_FLAG | PFIX_FLAG); + dc->flags_x = tb_flags & X_FLAG; dc->cc_x_uptodate = 0; dc->cc_mask = 0; dc->update_cc = 0; @@ -3165,9 +3157,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) dc->cc_size_uptodate = -1; /* Decode TB flags. */ - dc->tb_flags = tb->flags & (S_FLAG | P_FLAG | U_FLAG \ - | X_FLAG | PFIX_FLAG); - dc->delayed_branch = !!(tb->flags & 7); + dc->delayed_branch = !!(tb_flags & 7); if (dc->delayed_branch) { dc->jmp = JMP_INDIRECT; } else { @@ -3176,113 +3166,146 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) dc->cpustate_changed = 0; - page_start = pc_start & TARGET_PAGE_MASK; - num_insns = 0; + if ((dc->base.singlestep_enabled || singlestep) + && dc->base.max_insns > 1) { + /* If re-executing a branch, execute both. */ + dc->base.max_insns = 1 + (dc->base.tb->pc & 1); + } +} - gen_tb_start(tb); - do { - tcg_gen_insn_start(dc->delayed_branch == 1 - ? dc->ppc | 1 : dc->pc); - num_insns++; +static void cris_tr_tb_start(DisasContextBase *db, CPUState *cpu) +{ +} - if (unlikely(cpu_breakpoint_test(cs, dc->pc, BP_ANY))) { - cris_evaluate_flags(dc); - tcg_gen_movi_tl(env_pc, dc->pc); - t_gen_raise_exception(EXCP_DEBUG); - dc->base.is_jmp = DISAS_NORETURN; - /* The address covered by the breakpoint must be included in - [tb->pc, tb->pc + tb->size) in order to for it to be - properly cleared -- thus we increment the PC here so that - the logic setting tb->size below does the right thing. */ - dc->pc += 2; - break; - } +static void cris_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu) +{ + DisasContext *dc = container_of(dcbase, DisasContext, base); - /* Pretty disas. */ - LOG_DIS("%8.8x:\t", dc->pc); + tcg_gen_insn_start(dc->delayed_branch == 1 ? dc->ppc | 1 : dc->pc); +} - if (num_insns == max_insns && (tb_cflags(tb) & CF_LAST_IO)) { - gen_io_start(); - } - dc->clear_x = 1; +static bool cris_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cpu, + const CPUBreakpoint *bp) +{ + DisasContext *dc = container_of(dcbase, DisasContext, base); - insn_len = dc->decoder(env, dc); - dc->ppc = dc->pc; - dc->pc += insn_len; - if (dc->clear_x) { - cris_clear_x_flag(dc); - } + cris_evaluate_flags(dc); + tcg_gen_movi_tl(env_pc, dc->pc); + t_gen_raise_exception(EXCP_DEBUG); + dc->base.is_jmp = DISAS_NORETURN; + /* + * The address covered by the breakpoint must be included in + * [tb->pc, tb->pc + tb->size) in order to for it to be + * properly cleared -- thus we increment the PC here so that + * the logic setting tb->size below does the right thing. + */ + dc->pc += 2; + return true; +} - /* Check for delayed branches here. If we do it before - actually generating any host code, the simulator will just - loop doing nothing for on this program location. */ - if (dc->delayed_branch) { - dc->delayed_branch--; - if (dc->delayed_branch == 0) { - if (tb->flags & 7) { - t_gen_movi_env_TN(dslot, 0); - } - if (dc->cpustate_changed || !dc->flagx_known - || (dc->flags_x != (tb->flags & X_FLAG))) { - cris_store_direct_jmp(dc); - } +static void cris_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) +{ + DisasContext *dc = container_of(dcbase, DisasContext, base); + CPUCRISState *env = cs->env_ptr; + unsigned int insn_len; - if (dc->clear_locked_irq) { - dc->clear_locked_irq = 0; - t_gen_movi_env_TN(locked_irq, 0); - } + /* Pretty disas. */ + LOG_DIS("%8.8x:\t", dc->pc); - if (dc->jmp == JMP_DIRECT_CC) { - TCGLabel *l1 = gen_new_label(); - cris_evaluate_flags(dc); + dc->clear_x = 1; - /* Conditional jmp. */ - tcg_gen_brcondi_tl(TCG_COND_EQ, - env_btaken, 0, l1); - gen_goto_tb(dc, 1, dc->jmp_pc); - gen_set_label(l1); - gen_goto_tb(dc, 0, dc->pc); - dc->base.is_jmp = DISAS_NORETURN; - dc->jmp = JMP_NOJMP; - } else if (dc->jmp == JMP_DIRECT) { - cris_evaluate_flags(dc); - gen_goto_tb(dc, 0, dc->jmp_pc); - dc->base.is_jmp = DISAS_NORETURN; - dc->jmp = JMP_NOJMP; - } else { - TCGv c = tcg_const_tl(dc->pc); - t_gen_cc_jmp(env_btarget, c); - tcg_temp_free(c); - dc->base.is_jmp = DISAS_JUMP; - } - break; + insn_len = dc->decoder(env, dc); + dc->ppc = dc->pc; + dc->pc += insn_len; + dc->base.pc_next += insn_len; + + if (dc->clear_x) { + cris_clear_x_flag(dc); + } + + /* + * Check for delayed branches here. If we do it before + * actually generating any host code, the simulator will just + * loop doing nothing for on this program location. + */ + if (dc->delayed_branch) { + dc->delayed_branch--; + if (dc->delayed_branch == 0) { + if (dc->base.tb->flags & 7) { + t_gen_movi_env_TN(dslot, 0); + } + + if (dc->cpustate_changed + || !dc->flagx_known + || (dc->flags_x != (dc->base.tb->flags & X_FLAG))) { + cris_store_direct_jmp(dc); + } + + if (dc->clear_locked_irq) { + dc->clear_locked_irq = 0; + t_gen_movi_env_TN(locked_irq, 0); + } + + if (dc->jmp == JMP_DIRECT_CC) { + TCGLabel *l1 = gen_new_label(); + cris_evaluate_flags(dc); + + /* Conditional jmp. */ + tcg_gen_brcondi_tl(TCG_COND_EQ, env_btaken, 0, l1); + gen_goto_tb(dc, 1, dc->jmp_pc); + gen_set_label(l1); + gen_goto_tb(dc, 0, dc->pc); + dc->base.is_jmp = DISAS_NORETURN; + dc->jmp = JMP_NOJMP; + } else if (dc->jmp == JMP_DIRECT) { + cris_evaluate_flags(dc); + gen_goto_tb(dc, 0, dc->jmp_pc); + dc->base.is_jmp = DISAS_NORETURN; + dc->jmp = JMP_NOJMP; + } else { + TCGv c = tcg_const_tl(dc->pc); + t_gen_cc_jmp(env_btarget, c); + tcg_temp_free(c); + dc->base.is_jmp = DISAS_JUMP; } } + } - /* If we are rexecuting a branch due to exceptions on - delay slots don't break. */ - if (!(tb->pc & 1) && cs->singlestep_enabled) { - break; - } - } while (!dc->base.is_jmp && !dc->cpustate_changed - && !tcg_op_buf_full() - && !singlestep - && (dc->pc - page_start < TARGET_PAGE_SIZE) - && num_insns < max_insns); + /* Force an update if the per-tb cpu state has changed. */ + if (dc->base.is_jmp == DISAS_NEXT + && (dc->cpustate_changed + || !dc->flagx_known + || (dc->flags_x != (dc->base.tb->flags & X_FLAG)))) { + dc->base.is_jmp = DISAS_UPDATE; + tcg_gen_movi_tl(env_pc, dc->pc); + } + + /* + * FIXME: Only the first insn in the TB should cross a page boundary. + * If we can detect the length of the next insn easily, we should. + * In the meantime, simply stop when we do cross. + */ + if (dc->base.is_jmp == DISAS_NEXT + && ((dc->pc ^ dc->base.pc_first) & TARGET_PAGE_MASK) != 0) { + dc->base.is_jmp = DISAS_TOO_MANY; + } +} + +static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) +{ + DisasContext *dc = container_of(dcbase, DisasContext, base); + target_ulong npc = dc->pc; + + if (dc->base.is_jmp == DISAS_NORETURN) { + /* If we have a broken branch+delayslot sequence, it's too late. */ + assert(dc->delayed_branch != 1); + return; + } if (dc->clear_locked_irq) { t_gen_movi_env_TN(locked_irq, 0); } - npc = dc->pc; - - /* Force an update if the per-tb cpu state has changed. */ - if (dc->base.is_jmp == DISAS_NEXT - && (dc->cpustate_changed || !dc->flagx_known - || (dc->flags_x != (tb->flags & X_FLAG)))) { - dc->base.is_jmp = DISAS_UPDATE; - tcg_gen_movi_tl(env_pc, npc); - } /* Broken branch+delayslot sequence. */ if (dc->delayed_branch == 1) { /* Set env->dslot to the size of the branch insn. */ @@ -3292,45 +3315,56 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) cris_evaluate_flags(dc); - if (unlikely(cs->singlestep_enabled)) { - if (dc->base.is_jmp == DISAS_NEXT) { - tcg_gen_movi_tl(env_pc, npc); - } - t_gen_raise_exception(EXCP_DEBUG); - } else { + if (unlikely(dc->base.singlestep_enabled)) { switch (dc->base.is_jmp) { - case DISAS_NEXT: - gen_goto_tb(dc, 1, npc); - break; - default: + case DISAS_TOO_MANY: + tcg_gen_movi_tl(env_pc, npc); + /* fall through */ case DISAS_JUMP: case DISAS_UPDATE: - /* indicate that the hash table must be used - to find the next TB */ + t_gen_raise_exception(EXCP_DEBUG); + break; + default: + g_assert_not_reached(); + } + } else { + switch (dc->base.is_jmp) { + case DISAS_TOO_MANY: + gen_goto_tb(dc, 1, npc); + break; + case DISAS_JUMP: + case DISAS_UPDATE: + /* indicate that the hash table must be used to find the next TB */ tcg_gen_exit_tb(NULL, 0); break; - case DISAS_NORETURN: - /* nothing more to generate */ - break; + default: + g_assert_not_reached(); } } - gen_tb_end(tb, num_insns); +} - tb->size = dc->pc - pc_start; - tb->icount = num_insns; - -#ifdef DEBUG_DISAS -#if !DISAS_CRIS - if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM) - && qemu_log_in_addr_range(pc_start)) { - FILE *logfile = qemu_log_lock(); - qemu_log("--------------\n"); - qemu_log("IN: %s\n", lookup_symbol(pc_start)); - log_target_disas(cs, pc_start, dc->pc - pc_start); - qemu_log_unlock(logfile); +static void cris_tr_disas_log(const DisasContextBase *dcbase, CPUState *cpu) +{ + if (!DISAS_CRIS) { + qemu_log("IN: %s\n", lookup_symbol(dcbase->pc_first)); + log_target_disas(cpu, dcbase->pc_first, dcbase->tb->size); } -#endif -#endif +} + +static const TranslatorOps cris_tr_ops = { + .init_disas_context = cris_tr_init_disas_context, + .tb_start = cris_tr_tb_start, + .insn_start = cris_tr_insn_start, + .breakpoint_check = cris_tr_breakpoint_check, + .translate_insn = cris_tr_translate_insn, + .tb_stop = cris_tr_tb_stop, + .disas_log = cris_tr_disas_log, +}; + +void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) +{ + DisasContext dc; + translator_loop(&cris_tr_ops, &dc.base, cs, tb, max_insns); } void cris_cpu_dump_state(CPUState *cs, FILE *f, int flags) From patchwork Sun Jun 20 04:21:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464316 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1357389jao; Sat, 19 Jun 2021 21:24:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxR02SHY+KG2MBCRovdz+kmgJGrrIBmiUvuHhZ2+ScvxOHGIZZ2hzIi3AwrPdkkxvfTZyOM X-Received: by 2002:a25:9d0b:: with SMTP id i11mr14792498ybp.357.1624163061309; Sat, 19 Jun 2021 21:24:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624163061; cv=none; d=google.com; s=arc-20160816; b=HUAEkJiFM7SKedjYNNoWWuUhC1PD2m/u0CQiMflPgDlTWl4hteERyCRvXTS7vv1DYD Vq+cv1AO8uiBqLxRlrnsfECVeF5VfdsNZrwPYemS1ycjSA99DHnDax57crlLEIrM+/x5 zyxr44WlRDFf7MF6kC/+VvRLMLGBEwAGl8rRrag8XvNPL48U+Vxn6bbJowrSWwG9pbAq e2EuaGz8+ARhAECWTXcP54+H/QZ4iO+mY4tdKGCnbOB7yILZLz9yTljwDKstlBF6BMjL ydQJVs+1qQEtFQW1IL3k6qbgmnNs/W6QkjBBAcHVYQi5CFU8Q+Kg99eq9wKNHPpxo8Qv 3D6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=oqu6i/kvNHrYtHemRicmatPUkUSmc3yTCi7Ugc/TW74=; b=kqN++fbpv1zn5RMTZYzS+EKuzW9SPX2Lc7DDZBMq8lpMc+WkbgRevgTqOY1dV+o7VB icqBnqI51q22fFDNOx/jiasisa8q8OL3/GoWV4RSoDNo0ssinilZZuZXK0SEeffkON/e pifWx9Rx566x/r5DZgmcEe2fNYZeCkfT9ILbqRwABy6cejMetc5kSihP7Qd7BBrU/ri9 Ih4TjxKaqW8d7BLKpS2rMo449Xfl272UP/Oyl7lFMoTwpqdwz2ElU+e+RbWIsB/PD+Rz iBCt1ATcmrdBzbYg0Sn1X3vGxog01wUzN2XThiWH+pmT++7IpI5W4U9We3uBbefHE58D EDIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qgWXZjJa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f5si7016573ybi.72.2021.06.19.21.24.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Jun 2021 21:24:21 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qgWXZjJa; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lup0O-0002ik-Pz for patch@linaro.org; Sun, 20 Jun 2021 00:24:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoxy-0005JK-5l for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:51 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:39853) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxw-0007z9-7x for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:49 -0400 Received: by mail-pf1-x436.google.com with SMTP id g192so3323955pfb.6 for ; Sat, 19 Jun 2021 21:21:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oqu6i/kvNHrYtHemRicmatPUkUSmc3yTCi7Ugc/TW74=; b=qgWXZjJaADP3CmLd8NzXADVqAXiMlMMvu1WQDACA/GxX75pw8TXzbFDx4+e/kN3NXm zfL39+upX6mbVI8cfhOEW2LSvhmjqn4JawBckIX/YU+zbVYDzzVQZVx+wILwRiTInfoT cPUgOD42ahNMZ5vlx30YhwEZS6UEeVK1hEUIC2BUIh53YR/RT1I+rORA7A1g4AzEY3GM gHJ9IlYNRAzpc41mvOLZWWCAuRKfkN/gfA663Dd7Msw6yJxXQR6AfLRQB7YIoevttpM8 8CAcs15Qz4pmSoqFlZH7JWSmF627Y1V9hyZTzBBkpv2uywKy1MRSUG+jO956PhS/pDCG 7GVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oqu6i/kvNHrYtHemRicmatPUkUSmc3yTCi7Ugc/TW74=; b=bQFwbG7fDK552iaXe+tE/Md0WfdRUDAIfeAFSiuMCt3l5Splc44bmuwhBAxo84TbES 4Fg8ltjZyyojJPZq3ah5Ueu/9iAeqAaU48SgNq0hv2WTVqYZPSUMtJ7/bFXE8iU0kZlX JSMD2H80ZvNcE0RV7AfKtKIZE0dkTzt3GkRp0GUeiqOGzzV+IynbZEWkBxzBuJUgjtUB vK4AxtltUdqgn7jDHjbxY1D/rADSTvd2DzdwrLRjR3vv6vyyU0CKTuLED1IZ2lyMhiO1 1jA8aZ7vqPpyVcg1oDVCKOqUllw/iUNfAuG8vs/hFcJDuDTuLYalaPk2/20WdIE3Npfy rV8w== X-Gm-Message-State: AOAM533XETPYKXnb0Kf8Dxmsr5F1/DAPxk0C6sURfJdbGXLXXQgpVFSb jBNDrls4ev4pOjzUIccoPtwvpY6db1cdPA== X-Received: by 2002:a63:2483:: with SMTP id k125mr6463747pgk.99.1624162907050; Sat, 19 Jun 2021 21:21:47 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 6/9] target/cris: Mark helper_raise_exception noreturn Date: Sat, 19 Jun 2021 21:21:38 -0700 Message-Id: <20210620042141.1235541-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/cris/helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 diff --git a/target/cris/helper.h b/target/cris/helper.h index 20d21c4358..3abf608682 100644 --- a/target/cris/helper.h +++ b/target/cris/helper.h @@ -1,4 +1,4 @@ -DEF_HELPER_2(raise_exception, void, env, i32) +DEF_HELPER_2(raise_exception, noreturn, env, i32) DEF_HELPER_2(tlb_flush_pid, void, env, i32) DEF_HELPER_2(spc_write, void, env, i32) DEF_HELPER_1(rfe, void, env) From patchwork Sun Jun 20 04:21:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464320 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1358155jao; Sat, 19 Jun 2021 21:25:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8UbqSeHzWb0fRVcP4ahn5+5w2YW/3N4eIEKBB2Ti3vVlK4YgCNoCAGPz3jzBMp6xopvX1 X-Received: by 2002:a25:d0c3:: with SMTP id h186mr24300829ybg.150.1624163137030; Sat, 19 Jun 2021 21:25:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624163137; cv=none; d=google.com; s=arc-20160816; b=lnt1EiX37KBqbQwKLiGNEzUNTOopJITvsBPqSxnllaySNWUuDG6YgMqP6lROdRipY9 s6kdzm2dftrf+ykx+P1MeuwJhNuHrPHAzwv83QUvJmL1yiStAoJCNiyvofskynTXzszI n14ItUBW4wHbZfdd01DFfGkJwzhEH+CGj9ONDfZICDfwkOJ1AicvWSK+MaxSlLDYQXvB G32uB2d9j41IReiwUffj0CcLGOfDeclVC37GOUKkbd2k0mV6NI/XJdUHnPJAYtdEW8LH VARTdXnQX4NZXN0CHy8Gd0e1JaJLw6pnx/T+KEQEYV89+8dJOd71t7PsUVqjBNE4PUvL 3ZSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=xehCQ9vTLilSPHreJ5z6HAmdw9vSAgo0a8TpFRTr4mo=; b=sBZdqRVamIlwaxNRDKIYmHV6juWQn69vbtkkCGUAJjLgvPkStYH8duTTgA1NnHl+ef vvhNvofs3hOVywFHv0snffGF/wxTU6V4fGlG3XOWQDecDd6jl55FajnCdIJsNFcXwL+n IoedBi1b7UA4eZ9ygkTEu8+VgQS6LObWwtCxAirVRENYpsO0T8qYZFJ7Z4kuSf7v7Z2W kP2h+oe9UcA2FeP/r5D2Ed2Rmq/vMFAxInBZNmbS49E/B5+Pq3gL5qU5PJ6qyMBETlMa qKyhu3IyphZfCPsAT73xKbvr8f75BgEPU0B91ZL/wjmpB1IuAWtKIBbwDWedI/hw0C8b XDDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uf1LXOjQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c8si6367866ybs.339.2021.06.19.21.25.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Jun 2021 21:25:37 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uf1LXOjQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lup1c-0006rx-Gl for patch@linaro.org; Sun, 20 Jun 2021 00:25:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoy3-0005Km-Hn for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:55 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:39443) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxx-0007zJ-Nz for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:55 -0400 Received: by mail-pg1-x536.google.com with SMTP id w31so11273061pga.6 for ; Sat, 19 Jun 2021 21:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xehCQ9vTLilSPHreJ5z6HAmdw9vSAgo0a8TpFRTr4mo=; b=uf1LXOjQlLi95vPdgt/zeewXab2w5VyDPzjECeToS0mC48/Fxv+TBn9QNS4+3Z/6QN tRBp0tD3seNFEaERPKMSkcos6OhLMh2q3FSxu4la6IXXRceWy7lsVUuHxuHTiFJ5ozbw kg7e0mjysDxzsxUDeGLkGFl6p4GzF5ZxT1iCtLSF7/ojJhwBxSKf1mDHdBhC/IeQ2ZUn L8myaDTIgFWwnJtmYPIR5OVP14DsS9DYxxFLwnNov0YWNgO3RNWmQXX+y2n4/601lZSe d1nWWnR0N407+LSZHYZrfgdor/Ws6138i/3y0LnN0xDyWRAoYYMtURd4Xqv5WqI6Wn0k Zu1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xehCQ9vTLilSPHreJ5z6HAmdw9vSAgo0a8TpFRTr4mo=; b=EZ8tHQLqRmuhgRAk12FFFijES7SwkF2O6Ti84mq/Xo989FcsRfjFHniBZiU1at3HAL 01dsqa27aNu/6ONDV4UmYUkPO7ONfhe9lfAmQiVlNvzHNanICBzLs9DzodPEmQCRUX9h Ubn+KCr+9C9vnodrgnSdxMajGyvNvl9NFzEp4cc85nEOpnokQua25zz0bg7jjC64mk8I 6xoh2iK2E6KAfhTfwbgCdMKYWlAETworcHIVE97JSawVZMWFZrcTgQGGjJbg0Ap0sZY3 SE4ykg7NOtDmFMHn1yXUYg5BFoGyP91bfUmR3U2Z4xmwDuQhtwfmPl/1HuRa0bu8wWRQ iy6A== X-Gm-Message-State: AOAM531Ra8VifS9IrNXXngVoNPHaPjCSMjXgpYKtkBsRYs9CUJyn8qkB ++mkwMuJGYjvHzpk5nxupHe0ITcrD1rTzw== X-Received: by 2002:a63:e245:: with SMTP id y5mr17462746pgj.171.1624162907668; Sat, 19 Jun 2021 21:21:47 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 7/9] target/cris: Mark static arrays const Date: Sat, 19 Jun 2021 21:21:39 -0700 Message-Id: <20210620042141.1235541-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/cris/translate.c | 19 ++++++++++--------- target/cris/translate_v10.c.inc | 6 +++--- 2 files changed, 13 insertions(+), 12 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index 8c24053f5e..3515c21b7b 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -137,14 +137,15 @@ static void gen_BUG(DisasContext *dc, const char *file, int line) cpu_abort(CPU(dc->cpu), "%s:%d pc=%x\n", file, line, dc->pc); } -static const char *regnames_v32[] = +static const char * const regnames_v32[] = { "$r0", "$r1", "$r2", "$r3", "$r4", "$r5", "$r6", "$r7", "$r8", "$r9", "$r10", "$r11", "$r12", "$r13", "$sp", "$acr", }; -static const char *pregnames_v32[] = + +static const char * const pregnames_v32[] = { "$bz", "$vr", "$pid", "$srs", "$wz", "$exs", "$eda", "$mof", @@ -153,7 +154,7 @@ static const char *pregnames_v32[] = }; /* We need this table to handle preg-moves with implicit width. */ -static int preg_sizes[] = { +static const int preg_sizes[] = { 1, /* bz. */ 1, /* vr. */ 4, /* pid. */ @@ -475,9 +476,9 @@ static inline void t_gen_swapw(TCGv d, TCGv s) ((T0 >> 5) & 0x02020202) | ((T0 >> 7) & 0x01010101)); */ -static inline void t_gen_swapr(TCGv d, TCGv s) +static void t_gen_swapr(TCGv d, TCGv s) { - struct { + static const struct { int shift; /* LSL when positive, LSR when negative. */ uint32_t mask; } bitrev[] = { @@ -1284,7 +1285,7 @@ static int dec_prep_alu_m(CPUCRISState *env, DisasContext *dc, #if DISAS_CRIS static const char *cc_name(int cc) { - static const char *cc_names[16] = { + static const char * const cc_names[16] = { "cc", "cs", "ne", "eq", "vc", "vs", "pl", "mi", "ls", "hi", "ge", "lt", "gt", "le", "a", "p" }; @@ -2931,7 +2932,7 @@ static int dec_null(CPUCRISState *env, DisasContext *dc) return 2; } -static struct decoder_info { +static const struct decoder_info { struct { uint32_t bits; uint32_t mask; @@ -3371,8 +3372,8 @@ void cris_cpu_dump_state(CPUState *cs, FILE *f, int flags) { CRISCPU *cpu = CRIS_CPU(cs); CPUCRISState *env = &cpu->env; - const char **regnames; - const char **pregnames; + const char * const *regnames; + const char * const *pregnames; int i; if (!env) { diff --git a/target/cris/translate_v10.c.inc b/target/cris/translate_v10.c.inc index 0ba2aca96f..4ab43dc404 100644 --- a/target/cris/translate_v10.c.inc +++ b/target/cris/translate_v10.c.inc @@ -21,7 +21,7 @@ #include "qemu/osdep.h" #include "crisv10-decode.h" -static const char *regnames_v10[] = +static const char * const regnames_v10[] = { "$r0", "$r1", "$r2", "$r3", "$r4", "$r5", "$r6", "$r7", @@ -29,7 +29,7 @@ static const char *regnames_v10[] = "$r12", "$r13", "$sp", "$pc", }; -static const char *pregnames_v10[] = +static const char * const pregnames_v10[] = { "$bz", "$vr", "$p2", "$p3", "$wz", "$ccr", "$p6-prefix", "$mof", @@ -38,7 +38,7 @@ static const char *pregnames_v10[] = }; /* We need this table to handle preg-moves with implicit width. */ -static int preg_sizes_v10[] = { +static const int preg_sizes_v10[] = { 1, /* bz. */ 1, /* vr. */ 1, /* pid. */ From patchwork Sun Jun 20 04:21:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464319 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1358138jao; Sat, 19 Jun 2021 21:25:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycljfkSaayGT//JUZ5+I03zQOTN6gvmIgyzKaUm34EUVsd7DblhRz5PWc8SGw0/Qpj6iE0 X-Received: by 2002:a25:9809:: with SMTP id a9mr25050325ybo.330.1624163135636; Sat, 19 Jun 2021 21:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624163135; cv=none; d=google.com; s=arc-20160816; b=dnly5w6ZDDG2btHNta6yakbCEB9o8TsgsQ8v/1U5S2wpRZ41RqqqpMxh58jPl9L9Fk iatq+LTbX4oHKxtFFmcXI0LPEP7fOAa4m/x3sTcb6gPEtvIT8BvhIv7l7J/zIOstk9GG dOS/qDh0MSljDmt6lZRHF3RhD1d3+kfQPuGSN2V8qnGG3sLvNCkmQt+9VjQeNyIbjW1N JZQjKCBdL59GfVPR1Rhz7Q0xoyvltrRpPPN9wivQ6UxZ0g1zSFES8ufnbLBTXTPpui23 L9TEAolFYOwxc8Y+u5vcz0mKyHxT/spmH9CFsb0Nt9snLlSGhNxVHUNJdzTfYPiMwZBd QLnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=mmktZg4SZs/Mbi17grMf/E2VN5NS9/M2R6nJtdGiSV4=; b=r28JeLcPNJnGOz8wcToHYrqbdtjCNZgBOTOsihZcQVYoLLcNno3ILqzTH4EeqW0jQL dWHV9Pzvg7kXYbVdM+0KHZBJAPBU/srsNTfVs4h6pwifKXn3/ie6KQOu7EaiTo8x+qyo frSJuNErwbR8yeigBj5WYZGhZfrQ/wnuOLFuQYvdDLK1kTQWjs9VAwtaca+K/KPJm3jk qAo6GUeXcx2WXV2PJDrLL+2su3PkfRGcoaL/087j/e9y1Ww6dgYwojrGy3MGBQIFx+dZ UXnvDuLQSHeC687l5J9K862W+xj9mTRpb/p8aZHIV6/Zggj7q3A25I0XSmsZp9reOwSZ SBiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ym7QMcKC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f75si6998552yba.137.2021.06.19.21.25.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Jun 2021 21:25:35 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ym7QMcKC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lup1b-0006mV-3K for patch@linaro.org; Sun, 20 Jun 2021 00:25:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoy1-0005Jp-L6 for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:54 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:36657) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxx-0007zy-OA for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:52 -0400 Received: by mail-pj1-x102d.google.com with SMTP id s17-20020a17090a8811b029016e89654f93so10493960pjn.1 for ; Sat, 19 Jun 2021 21:21:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mmktZg4SZs/Mbi17grMf/E2VN5NS9/M2R6nJtdGiSV4=; b=ym7QMcKC+GV5NZXg0I2JSlbF3SmV7V/VbtTKR/Rd/PfyBV8W40dBM9qJaoYixATZzZ eile7f4ZGVC6L9HA0rq2BKW+teV1+RQeqKpI5/kHMcL59wIA8q5Ae+vRjSS8a9v+FRsm w/Vx99UUwzPddja5gBsQgbWaDMg8NsCb3jKPHG85cjH2bCOPurWicVj22ilWhLXM14HQ beSKTXIlP5C+3JNpidrQZTfqItgC+/DWFbZiEpf1vyYdiHNUsEDE/ORL31wrjcSqhwGB 5ajf3IBPNx6PJo0O/EU32k/eDNfTr3yjbsBx7N9emQfGRY8BOWnNNIgnKDCQtZeKzlKU YSLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mmktZg4SZs/Mbi17grMf/E2VN5NS9/M2R6nJtdGiSV4=; b=bYhgsjUwdq72+UPLlYRzeWztBhvRnKwGBxSIBsGbR0KM7YDYujFAV/c52I6Aq1oRye aCVPkrgzXbqRXjaXQ2xYHzPFI74sQqQMc5xpbw+QnDi0ldYeB8AGwQyvpeAaOLnM6Ca3 OlTItwRxgiGl6PAKnkw6FlqFZErOXB7ZYLTJ3HSEDd3vRdZiRZlnON6KOdC9mqFsRNPY pkEHZExwi2uzomOFSczyMJW4xqHD0+Yd1K/6GjAcMtIIcHodLDC2Rn0gngRKUqD3T6Z6 KoCOVuevMmyw4X/2gonMyD0Er70bQ0sm67L9ybjRtrsRVnH8OeDxXqGixhpOiH0IMSwR lk5g== X-Gm-Message-State: AOAM530f8MUmzpDZOrxiJVCVIoILUthFb2t9lKvPzIKn+Xa40PuI5IlX tsjLtGh4ABStphM5YhyaoKqtqOwfpaeftA== X-Received: by 2002:a17:90a:d598:: with SMTP id v24mr18803360pju.185.1624162908257; Sat, 19 Jun 2021 21:21:48 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 8/9] target/cris: Use movcond for t_gen_cc_jmp Date: Sat, 19 Jun 2021 21:21:40 -0700 Message-Id: <20210620042141.1235541-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is better than branch around assignment. Signed-off-by: Richard Henderson --- target/cris/translate.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index 3515c21b7b..e4cbc35ebd 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -516,13 +516,9 @@ static void t_gen_swapr(TCGv d, TCGv s) static void t_gen_cc_jmp(TCGv pc_true, TCGv pc_false) { - TCGLabel *l1 = gen_new_label(); - /* Conditional jmp. */ - tcg_gen_mov_tl(env_pc, pc_false); - tcg_gen_brcondi_tl(TCG_COND_EQ, env_btaken, 0, l1); - tcg_gen_mov_tl(env_pc, pc_true); - gen_set_label(l1); + tcg_gen_movcond_tl(TCG_COND_NE, env_pc, env_btaken, tcg_constant_tl(0), + pc_true, pc_false); } static inline bool use_goto_tb(DisasContext *dc, target_ulong dest) From patchwork Sun Jun 20 04:21:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464321 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1359345jao; Sat, 19 Jun 2021 21:28:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6KQlHq25PyakPc3C6DB5QxTmi3UT408yqMl2apNaWK0apprDvzDtYQG5Jg/Hfl+s8hQ9Z X-Received: by 2002:a05:6638:1919:: with SMTP id p25mr11054912jal.115.1624163288813; Sat, 19 Jun 2021 21:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624163288; cv=none; d=google.com; s=arc-20160816; b=PbLHFFsxNPm3O7Ug0VIuL2OKcuiVJDH5ILF6cmpe7tbihruzXmuv9P16qnVJEkRdLa LZ3R573XpXgvUOkC6EnpmIf9DuV/dRVPc4MW3nWEQWPQxcu+EEfYCeM0Vc4LUodTdgW7 g5XISQXd/HRFB24MVHnzrCUiYST68UGUS4T5rivThSX/BI99pH7dqQkL3T7bGuv5SiPx AQxZ5ra0hbznQ5jmVpYc+XrDufTfQiLgROaEG4aT9myxBv5sEBdakPDKoNkVXqoMYive D2k5mHTjutwJNwRGZkkDXCpgT6Xa0kK9LlJCyxictSX+zujP8C2oAJe1445ZgkDZIHt2 KIIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=soBxmYzIZMGH+aXCnzU66X8RLdvoKJnc1fvxigxH0fg=; b=Ra7BLaTVMqXJRF2nIAxd7YZuSO2YwN4bnb+fPAzDbB2++6wCfR9YP40A1y76rAEq8M q5Xmzhsn1jZYwGZQ5uOIv1RFbY2MBB1rgNA5F4E3R0FEr7DtdV/EeXRb3rIM0+tO9tek R42bt3sLzqttGhen1mLSDvWDLhdmh54z/JgISvRg0J35bMPgv8nzG58XBQm0QKRFyZp3 dWRPPrTZpk6y4mY3shk8bzuI0PGe/ddmHh68A6DTTHudlJArTWF7N+sE2Noay+qDpB/u /SxI4jzx75cJ+hMO2IsJ56a1eVemV3hkfzqkvFWPRmw1fXpY5cs2HrGtcrDrL5/tJe8U TbHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=of+tKD29; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m11si8967554jat.29.2021.06.19.21.28.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 19 Jun 2021 21:28:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=of+tKD29; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lup44-0003m7-4J for patch@linaro.org; Sun, 20 Jun 2021 00:28:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoy4-0005MG-MY for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:57 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:44782) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxz-00080l-7N for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:56 -0400 Received: by mail-pf1-x42e.google.com with SMTP id u18so5644019pfk.11 for ; Sat, 19 Jun 2021 21:21:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=soBxmYzIZMGH+aXCnzU66X8RLdvoKJnc1fvxigxH0fg=; b=of+tKD29OLtcKdR0OPS8PhlSF+PcG44d4in9HuN2gHtJ7sx2LTIaDNvFmHkIal2z+q iTPVPTWuKZi0/XnIhOLdeBWCpbBBVnqgHgNRQNUvVM5kU3PApsD7eaT6h9BAjMlMoT5z OozTtbsZR7qFi8+VvAHE4NlHeTx/4ZaEGIyzmKGrIlvWCl/P/yp3885WU+NclzVuldh1 O2K3nFcxKj35jhfMdPb3TX8mdIlNSzZXhivzpPkyMNNQSbV7ruYWglRweJ1PK1C9iUhj lXUwo0PU9Z0Ra2+ph8Fd4otuo4HHyqtW/ZhL2w+kJQsMXvcETRxtVvKZWjlTl4lQpBsa 4j6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=soBxmYzIZMGH+aXCnzU66X8RLdvoKJnc1fvxigxH0fg=; b=RVZ+wcnHLOBHdFRKjzeGsxn6qY1KThT0nqcjCiASvqfl3AOgLh7xgagm61SAc+dmou VogUzpGyTsDhnGWKEC6fdNErz9gRU8JN/APXGkTX+lIDdKhvANZf+LKF0Ff+/mJQaEJd fyEj16zJ/SYQQq+qRT1Agr4Ssi7G9qbB0+1s1zy30QemqaJqzf84e6SGlwauZeL+nc2I +6lE+KFGdai2u//knqygbiqOZqckMo1hrz0B9o/GqzPbEun1m3LKkOuMAmhI7F2AhsHs 8/hRL74a0OnFnuQokv+PZSuPxqGfkirwTG9k00Z76M9c283M/dCgqrqylK4fjndVk5ad NdUg== X-Gm-Message-State: AOAM530e/B9xbCZQUkXrtwZBs/MCza+vpOtcZ/KPBA1RF8HuUzhj3rrb zPMzuGS+XAAeTr+8vW9XV0exAWg8jAe/mA== X-Received: by 2002:a63:e04e:: with SMTP id n14mr8530781pgj.324.1624162908886; Sat, 19 Jun 2021 21:21:48 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 9/9] target/cris: Use tcg_gen_lookup_and_goto_ptr Date: Sat, 19 Jun 2021 21:21:41 -0700 Message-Id: <20210620042141.1235541-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Indirect jumps can use this to avoid returning to the main loop. Signed-off-by: Richard Henderson --- target/cris/translate.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index e4cbc35ebd..8a8d62f11b 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -3330,6 +3330,9 @@ static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) gen_goto_tb(dc, 1, npc); break; case DISAS_JUMP: + /* indirect chain to the next TB */ + tcg_gen_lookup_and_goto_ptr(); + break; case DISAS_UPDATE: /* indicate that the hash table must be used to find the next TB */ tcg_gen_exit_tb(NULL, 0);