From patchwork Sun Jun 20 21:32: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: 464340 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1983458jao; Sun, 20 Jun 2021 14:34:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybwov78l0lmSgloQpYo3d4WMZ0apYNHzpwGXNRrtsykBXBlUywe+XKCYrhItTCiOsbxSdN X-Received: by 2002:ac8:2:: with SMTP id a2mr14793643qtg.101.1624224841425; Sun, 20 Jun 2021 14:34:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624224841; cv=none; d=google.com; s=arc-20160816; b=q/fkuuyw619HcqS7oei4T/fy8izH6qVemkxWJN/lBTV5t0z3GKJVOaUK+ESpVm8i64 I+BTXekdbzbj4NILvTRtttd1hdpAZ6OKZ2tEyLP0IgzkvtM3oNzLhQ4NzW3KO/GUQ4sf xWBnNu9ycj8jdUJ6NMrcmlmVt970MZYpeJg5V07tDbcRwB8Zusuk67ESasOJjDvNqNIj fSSjJWsP+lETAPQ9Wzx7e7zh6Oat0Hq0ACGT7bSKeiva2jTsYTdb1hrK6l1xVp0KDhY3 CPYQvvDI7IRqyHLI5cHrX/ZMZW+Pks3z09bAYaiWsOpH6ZSkBSyiEb0GATAflYH2ZHPo l6ow== 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=EBGSFlnrTfO2zTTYq9r3VjtUJUtG+Wai+BL+f0j2hAvG2lLrCY2wSrrLKl+29ffdwv 674lhzi6W60KE3eS3pjux9CrIH4hwPygVS8ZDcOBJ9QJHQcIquTVPJqTnwIoYTxyMxvj kRQ94bxczqhZGIdYNHmI0Aii2QtYq9RBIaPi4UaLaQL1SQcRMlyQ/MAvVREXIiVhyHjv QAgBAiYpGSwAKk/CHEFpcuHK8HGKBkws0e7E5Xcotq4zu9/e0/1QfiXFjNK42aNK9eCG LrZRgbH6OJIGeoqgeSu+46DUdZD1LJOvtum0PdVS+HX2hJvgoOBRGW81De74TQ3Ffe67 +jiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DD1lRpkQ; 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 x1si5201383qkd.286.2021.06.20.14.34.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jun 2021 14:34:01 -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=DD1lRpkQ; 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]:60990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv54q-0002II-QD for patch@linaro.org; Sun, 20 Jun 2021 17:34:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lv53q-0002Gg-FD for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:32:58 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:36448) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lv53k-0008SK-JE for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:32:58 -0400 Received: by mail-pg1-x535.google.com with SMTP id e33so12528446pgm.3 for ; Sun, 20 Jun 2021 14:32:51 -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=DD1lRpkQnjbCCUKgbNcmYQ3AN1pxYpksb3ByCg20kO2fyRmCKRB+u27JAIEOysVj2w Q/SyIjmbLEN39eMarNDQgU3RVD5jqq7mFqbvsWf5teIFLGotUkxwr6ICkTEtUlx6nUnv GzogPn78bduXpMaDk+1B1OJ5vnFvSHlOtYtdod4J0YmqgtPqfXP3HPV1Tdp6GT+z/AKE 78+3y/6e6LPLbIlfFcgCCS8ebvCZcC8yU2/eifXowOf78XfAO67/b+vZvSQWFN0FjlAv wxnDQbH6EXCdNqkMYMK0f/+LXVMxZPu2fIoeNmeyLH/9OJ9uLgMRN7y/rvDnNmR2e+PF BK3A== 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=jJxUr2+mFR8t8HpEHHidFZzGeZ1T8XOc6FE+5oF4MFhCaw6HNWRbE3gY+BjEMDc8zq RcdfqOT2l/Pg6/hOr7CGiPBS11VCrOb8vOPU+Wr2JBozOkllCDpxX3XMdR0KJ1zpzx0H vXsn8OKmSYg/TknlDfeLZ9Nca+F9Q0N0JCCdyOU/fINEQS7f9aakPbfeu5YofbmWp2Qg /F3vbgF7xJ6r/6M1X9gAm2bqvr7+Ob0Bmky1gXOMaEBvtXk8bAVJlhAVB9n1QE5/B0mg 4A0q1cVT91EQA/+ULNGxT1FpHVo++cdXVyjQSYQePbw3MHpGagEngQAaGgJlDrv2F8w+ BJ6A== X-Gm-Message-State: AOAM531jg6aj66nkA1tj/Ie6fxJF/0lX7fjx5sVrw1ck9sFJrdvWLtEE HYI66JGaC+Dh9ywvHLOgd3JQzj2G8bh+hw== X-Received: by 2002:aa7:958a:0:b029:303:18ed:4432 with SMTP id z10-20020aa7958a0000b029030318ed4432mr2887912pfj.14.1624224770773; Sun, 20 Jun 2021 14:32:50 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id w21sm13608329pfq.143.2021.06.20.14.32.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 14:32:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 01/11] target/cris: Add DisasContextBase to DisasContext Date: Sun, 20 Jun 2021 14:32:39 -0700 Message-Id: <20210620213249.1494274-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620213249.1494274-1-richard.henderson@linaro.org> References: <20210620213249.1494274-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.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 21:32: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: 464345 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1984451jao; Sun, 20 Jun 2021 14:36:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfeMkti0W6UQjSqk5A3P5UVobVsLjj0PF9kxhaYpuLc1T9Za/wZd5e3BavWAcQj0PWia7l X-Received: by 2002:a0c:ff25:: with SMTP id x5mr17134767qvt.39.1624224994291; Sun, 20 Jun 2021 14:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624224994; cv=none; d=google.com; s=arc-20160816; b=gqibyp2H+7QuZGG6psLECaUR4Ciss8gYG1byEHssjbwjDsP1Q9Po2RLjoU/d6iPWIy NVYv1nwuIFuRGn1Z8mxO88KPHKbE6tn5Gw8//VbIQXoGtAyA/N3k+b42M8cGcin8ckPH a+m/bnXaX61tMmu0M7+3+BUNx2NG2SAHGktE7AP09yZ1rCCzqki1QAVDa31EBFxjVXCz O7o/xkaKYOrwr26BI9HeO94OhL9jKqP7vjuB0xFq6YbCo/xjmUKs7cBm7kHSf/RJZrts DXhhN+71nDJFNwao9W1+MlAelvzDRH4sq4+d5+mE2EmYCiLlY6nYJrgnRy636VHOWSw8 tTug== 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=eU2YtPODVp6q36a9RaT/V8v2Uq57gm90+dBd9ejhSicHL5pSFqED7TSOKpGOTumudY 5G/dLr+ojWmG//Na9IKIFtdCW9+wNk4aYfHpSKlHOOs7p5Nx2rsPXHOVIUd4aFIbGHGb UJUSTG/vitxXgF5MG5W4RnCQsON72fXWW4Q1zzbxwXYcBItNNxvt5o7QxDq0slhHr7k0 dcRBvj1hnh01HAOxYPzopSftWQMLY4dBh0gvKBdFkiD/xI4PQIILHL8dDCXhnv1t0daS yVuLeiljTOCZETrYLI9mRsOvCJBGumg0PiA/x9m9vnbpJNf3Cm1tCqTHbk66ZDOXykLP Ulbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jEiRs9rl; 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 u1si10851147qkb.309.2021.06.20.14.36.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jun 2021 14:36:34 -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=jEiRs9rl; 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]:49342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv57J-0004rU-Lx for patch@linaro.org; Sun, 20 Jun 2021 17:36:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lv53r-0002ID-FU for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:32:59 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:39620) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lv53k-0008SO-JQ for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:32:59 -0400 Received: by mail-pj1-x102e.google.com with SMTP id c7-20020a17090ad907b029016faeeab0ccso471601pjv.4 for ; Sun, 20 Jun 2021 14:32:52 -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=jEiRs9rlN2OoWgNESPPR0gyrScgHNkyV3YQt0PWFcY2CLMY1UTsPKPdV7rpw0h2ATa dY4K5tuNclkXzcgAQLAtzEdTNGHSeAZAExNiSH0rMPTrsPU6AhYZExm1YFGUbauRu49h enFA2F08hzXuGPaxhliTwZBj9BRE7EemabX5ia0fK0zD6L8oYIlPY+gPob1xUo2BGmSL LdPsNfMXiAasDUDDLUNBDk8O9r7tvSYHGAhMGmkAsqSRMy9spfMmvMafUTgVu8nCY5mr pcjlBFHZTSfLk+BKl8iDN/Cs8Yg+WQU32+uWqTgBy8uJt87MWDMqlLUEQM3Tg7JRATNQ rmIQ== 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=B7MxxA38HcIocEQD+Sn6Qg6FgYvdhTlKN80PkWwrKLKtCu4rix2khGpkYOCLmwyvMX coU557DosXRWsLwpZwW/UvW6Z3fZOflSfWB55VegagF47HJwjLlwnZCJIKAub2tu3g4k YScyaFiRG0lHrBal8BCsSMyafm7tA1E6QCzHV4tsvh/tJH1WKd+XayN4BuCOxCYpavcs gRrCixWqwFYjRI5/Zcwxy1w2idULMxptD/IqpQIX5VN6Qnim1RDaaESwk1ZAjM89uDoy 3MZJQCNsz4a+QFu34I4mmLZ6eF3brbADuyPSJNrcKyV+eT9lWrWA6dJ1lYUK94d+aUAA wXBg== X-Gm-Message-State: AOAM531jfVTM9mFz7Eys27Tan8Sse97p0+bkAmF4ybFcn42yZayjpw27 sJO1ej8cYIyjF8AQ5AWCsy7EbYgw/fXSzg== X-Received: by 2002:a17:90b:300c:: with SMTP id hg12mr26176275pjb.46.1624224771330; Sun, 20 Jun 2021 14:32:51 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id w21sm13608329pfq.143.2021.06.20.14.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 14:32:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 02/11] target/cris: Replace DISAS_TB_JUMP with DISAS_NORETURN Date: Sun, 20 Jun 2021 14:32:40 -0700 Message-Id: <20210620213249.1494274-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620213249.1494274-1-richard.henderson@linaro.org> References: <20210620213249.1494274-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.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 21:32: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: 464341 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1984066jao; Sun, 20 Jun 2021 14:35:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF2TotteGF152nPsq8cpvlBr0zQMhjJsOJdABEuDdTtKkNjY6owwyEVxEUHd8sR5wPC0kL X-Received: by 2002:a37:7d7:: with SMTP id 206mr19828049qkh.3.1624224934333; Sun, 20 Jun 2021 14:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624224934; cv=none; d=google.com; s=arc-20160816; b=suRZNq10ybvdetxJIJEg/znTQ8ZKHhLbM+eyagpT73Wo2UJtmY67PLmRhHtIvCR5/8 PjqVvSCvgqRNzQfN5hxZgVt8RsshMFjdsSoS/eVZsiupbL3rCISNr2X+T0b4Cy7OhLeO jJBsBbBH7My79tjLoF3jC8hoI6UJWiihEmX+Gr4KJtJPYA0Jm+DzJcn8RTsOY4VHnUk8 dfeURjHK3dGU3HAP/NQ8knMov4qxLUr/ldNVRT4Qr1A76qItvkjY1FU2pYQCBERDzZro JIxL2+rVsvHBP1PHFnY2dOpu7roRm+OSCafnFFB6TOhyxAxGUedOj3C6RNWSFbJSsOm/ u3gw== 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=iFFEUoolperq/qtp32HkBWbUblbvIU6WcpHS3v944024Sbf0suTSOaDZo7xig7HgKo FIdexQ4unoI9EQAlPWR+mq1FrahHrF8cqfWbtkxPgyykkH1Gy58yOH7/JTC8bPzmBNwB aaLVOHh5v2jVrhySr581hk0u5sUbk9o/OPxc1mC0/pDnVsW0FwsZY2rTtC3pxqBEecPo ITd+oHEu8zH//rW/SFb9Tr6Zr4XmLBwGMOWFbdLPsBLg20v9kiOlRMMpMiSSKcLI2xHK 6+8AUvWqyQHVngZcXp3WqIgxXInPM4NGfT4/ZIMYLcTo1OSWh1JKM6LBrHgEUYXg6+TB eRcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F23Wtev8; 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 d10si15012667qtm.43.2021.06.20.14.35.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jun 2021 14:35:34 -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=F23Wtev8; 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]:40790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv56L-0007bs-MN for patch@linaro.org; Sun, 20 Jun 2021 17:35:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39312) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lv53q-0002HP-TQ for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:32:58 -0400 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]:34544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lv53l-0008SS-GJ for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:32:58 -0400 Received: by mail-pg1-x52b.google.com with SMTP id g22so12529290pgk.1 for ; Sun, 20 Jun 2021 14:32:52 -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=F23Wtev8aAJoEJXyCZxEg5HbH1+AdOJheSKIb/ket6m8qtP0/jdC7P7zgexn3WzYMa 89y9x+jwwFB/oVIThxG2deqz9xgzo5pJbz3Vrs8LaVShXBzCNzv9Iip//tCQ5j4qdKqH AuLz7hOecy55hsmx9P3URjsYo6eQzjEYETh7HqsfGcXZrValklWhhRxhqWgB1XVUEB5t b21g+fCBDP5Ny2OMsLtrPyovSdKRlarebIQIrykHsCEeQHkOzRuoKNZKlvlF/2xe6DkA usQmwn4DmJ0qxIG+ZsAsFt12/kB6DcmiKuWHGkxkL/i3LpMOx0jlIsaMgyEtSIuJr7hn opuA== 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=JhfiEYvcdZxO1ADSfpsPExWHzAJDLz+oq2R/iOJFoKurPVzTQdHuxzq+KwWcjpMCvI /TA8OsSphBC9lsIwGtRR78aZQ8tgfHyY7KOLu72vih2ErWvSvs8Zhsnh9T9YeGavrwxZ IlmprNyJELfy7J2ReJPFEwbFJFxNxNWIeYegfT8WziC4hYu6vNutIQ4q53EoP8RD1A1B G9Lj939wY/NhKZRBASQmnyJGHpBJwdFQlIUjLOs0bZeHhwdn6lbbM5Wi1/FXkj2ojOuc Z2LdSytJYxma9G2st288FNA3l8uu/NTf5A70P1TYfQDqelVna3b5cGzo42O4+Y0d0I7r OYYA== X-Gm-Message-State: AOAM530xXp3RrUrvz1k9baoF9g39cgK6p4PBm9xlT9g6PdekUgQp8mvr 607FtIEToegyNVkAlv/GlcJz3jkp+CbzHg== X-Received: by 2002:aa7:9118:0:b029:2eb:2ef3:f197 with SMTP id 24-20020aa791180000b02902eb2ef3f197mr16058299pfh.27.1624224771834; Sun, 20 Jun 2021 14:32:51 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id w21sm13608329pfq.143.2021.06.20.14.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 14:32:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 03/11] target/cris: Mark exceptions as DISAS_NORETURN Date: Sun, 20 Jun 2021 14:32:41 -0700 Message-Id: <20210620213249.1494274-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620213249.1494274-1-richard.henderson@linaro.org> References: <20210620213249.1494274-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.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 21:32:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464342 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1984093jao; Sun, 20 Jun 2021 14:35:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhpyCt72IJ94wqqZTnwrwWR6Bj2mmi6kssr2gyUrjrJRfsZVVfEhXJRupkLaj9IPrtPwU0 X-Received: by 2002:ac8:4d84:: with SMTP id a4mr20942563qtw.319.1624224938643; Sun, 20 Jun 2021 14:35:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624224938; cv=none; d=google.com; s=arc-20160816; b=vKhEH3hvQ1Vs6EthbjRO3mpiLbEYS0zmpbFPEthuWI4o9f8TZlCj9fOHIatJE8IkVK YaL3tbQTe64Z5DySwhspRiNfIMEaSLXb33V0L95AWiqVjnjdgBNsKtomYy2+87DoMWND 3EBRCTSS/6HYWxAdQXENehFF1c+d4zcLJn1+8O/BwAIJoQAdyx8UzYIR4X671a1BvWfH R4e0sJSlD4wwaei7X0gemBg7uaXPJ0pXIs3e0PKukCfbkZKOoQbFOYk8Y/Pyzr3rKPuj qyYN1mQeiw2P2t6PupdAluMtlt/3UxveG7gMCtkfEYuSD50Bl/tmxRrOlcrz9juKtkEK J6vA== 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=K3XyHfL4tN+qyJxR9iQwE3O/KIe2SyMw72EU6+xU+iv5pwA3cDsQ1qHXlzk1BuqLES uYUWxs4nhJNLltO/v8BcjXBq4W1DP8U9K9lsuUy+yCjcdFlmCrgeJBplqeIV1RO1vNv5 0cCZeq0NMfUL25Ak9h3bAkWbtUquAPk6rwbDX3N58Sh2ujXWtW9BLngq2y2wv4T4iA2n iqm4XbIg0CS11qOymiU/49cnAYJht3pwNuKiX1eEWq8sO9FF0dkfYO4ONqdjx5y3DSHj tTADHUb3xRlRn3dVh9iDHN3pRgBSkSCQH1c+djXOMQusFEBPvHmUOgdSeJNsE/X4fdM7 pmkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HsavbWgh; 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 203si9977102qkh.340.2021.06.20.14.35.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jun 2021 14:35:38 -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=HsavbWgh; 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]:41204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv56P-0007s9-UF for patch@linaro.org; Sun, 20 Jun 2021 17:35:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lv53s-0002Kn-I1 for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:33:00 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:43728) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lv53l-0008SY-Gn for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:33:00 -0400 Received: by mail-pf1-x432.google.com with SMTP id a127so1577832pfa.10 for ; Sun, 20 Jun 2021 14:32:53 -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=HsavbWgh9WewKIU833VjpOBjbyIX8eTZj66A2oo++LE7Hym8C5kDAkEU5ce+eVpxED nOUtxUIVIUEAkJbWIl6WJdKX8cfdEw0/XQrsN/1uEHtaA0tsOF4U++MQWFIKf3DZ1o7e LsZKhb7eHaSjOhDt4/Uy3z7m3eUHrDEnUhi/HdzRYuGb2sYtFdsXq+C8Oi3+X5v+i2Fw NwoRo02QHunCsuKTQVdaIrvy/xu+UinAMJnNFfxIPunzDuLyKc6mVMxbg2p9J1iaxkvi jE16rDnaBt8dx8sXZPGyxMQ/LP418VgOGEmWCFui34cPs0Qit3iZf64WMsCrH6PS+jTX L45A== 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=gR3opwFS/TVvNSD5uDu09PgxwXmUQcIYDakqQCHGflI5+dW6io1sSMHZPKTTRwxajp NKlIjBy4cwxqReGh4faFsOHuPf8vOJen5SrXK7bsV3o7wIRg1Zym1FqqfpIFdXKZPtUO cz8FN5iJPQYwiukZEI/oxMZfVcBH3u8mPwQyskgQwZrz3KVjdw8gc5Sl10evIV4+zepP FtMUaewLl4JNvQctNbvmJ5Zvqb5D+OMgEJolEB0erxzOTbKG6Rm3l9bli0YIPvg+Ujaw 6cO7r4LeyrFDBRWTNZhQCdhEmTlM9SZaHvFZdttO58qXQBIELligP195em+Is43RE3nt rK8Q== X-Gm-Message-State: AOAM530ImMfCnGN4fcV5QiNrQS76rzB7AYjqF8RtlKmlb7fmxVHJ6OQA DUaKV3CgKVo2BUwLmMi/P5s+ITpYXHnNiQ== X-Received: by 2002:a62:f20a:0:b029:300:43ed:198d with SMTP id m10-20020a62f20a0000b029030043ed198dmr13394188pfh.55.1624224772317; Sun, 20 Jun 2021 14:32:52 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id w21sm13608329pfq.143.2021.06.20.14.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 14:32:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 04/11] target/cris: Remove DISAS_SWI Date: Sun, 20 Jun 2021 14:32:42 -0700 Message-Id: <20210620213249.1494274-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620213249.1494274-1-richard.henderson@linaro.org> References: <20210620213249.1494274-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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 21:32:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464347 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1985341jao; Sun, 20 Jun 2021 14:38:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNj8ox0G0raelUn46hU093E9FO7ON46f/HxxZyXqO6f5pSRE+0daWLaSo0OtgmrLM4F3D6 X-Received: by 2002:a05:6638:379b:: with SMTP id w27mr14769503jal.108.1624225127468; Sun, 20 Jun 2021 14:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624225127; cv=none; d=google.com; s=arc-20160816; b=wzZ+s9c0gZYFGBpTl2TqkkivOoBdhg8kvzUnZUU7ynnOQECJD8/xJWtF7DuApWQGA5 6sl+bpvE6pqMqqpIVl99HhUocFfBs2qirDpom9fgUv5N1a0sSzARKNh1f2RCUPOrkCcN MBvxWXIEYIyp6DtCEPYHVBPSQPiEzqR71q4ZPVjP/tT1vepHUMpu2ux3mF8A7t4e6Uq6 nMii1zReMVSw4/KtiolnWomte0FbN3e5UCvp7TQU13jDt8Ffv6WzB8GWFc30kAE49X+B etcwnN+v5foKTELwioOsnAR+OgnyxNB+ByQtOPkw7PFJytKLM275Bfv1oeTuvkDz158h 4SMQ== 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=7dML7HVO3SIUvu7+ZiyMAW2r1aYzDyVht2iysbBCWL0=; b=gUIU/N+5RQMYj02+xNsc1XOtFZZNdZ+gHb94696EgbYsi5Wc3U7+77eAa+q/GBa7L4 IklWNhYl3ymXiW6+rv2HZ1PzA4Gah14sdkDbxAPLfJN80SFar4m5uxAmnNmHrtHY50MA rBT45Hu6JuQEUUzmFgNVyJFJMx2xpzY40m/XLxPMG3SOd3zV9NhBnLY3s5FR7esndg30 IKWUByrJCSnHqdi0zty2+JoxA3WYmJtIveauGY1gjqKEjru8lDsbnnbv5ZFIl4AKJQ09 s22dNcSbRIuW5inJ02c8qTwsvtTOR2KCPVKwDZR0W3J0G4HMbEiNfu458aM2mcPnDyqz XwJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DTrvdicQ; 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 g9si17662225iom.21.2021.06.20.14.38.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jun 2021 14:38:47 -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=DTrvdicQ; 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]:55660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv59O-0000bl-T5 for patch@linaro.org; Sun, 20 Jun 2021 17:38:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39330) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lv53r-0002J6-Si for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:32:59 -0400 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:36437) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lv53m-0008TB-Dl for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:32:59 -0400 Received: by mail-pg1-x529.google.com with SMTP id e33so12528487pgm.3 for ; Sun, 20 Jun 2021 14:32:53 -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=7dML7HVO3SIUvu7+ZiyMAW2r1aYzDyVht2iysbBCWL0=; b=DTrvdicQDUOCoFBJXoZqja3HB1XdWqMYYHnE34/QkQQ0bX/tshffG8x/kv/KCSn6oP hSbmJ8GEknmLoQ8gFF8kzdS5r9vb03dWCZK0wWQL69JhcezLWHoakf8bvcCnOHjhYdA6 /J6liarVUZrX/N5NucsjkdPvLDa7sbCzEv3uPlHBhbAjGNZyoE+jghY1NOZpWqsT9NfG LpaRwA2t+Aw/v2Qcmr/DULtCQSj113JQDp5YcSo/iMfIL73a/Apx6v1dIRCsq31iPimG jnx0fbh6TKslacR5m9zrXCX5kk+X+0ppKtDsjJqaV1AHX94jtNmWZ7z9SktnJ4e0rzNj 4fZQ== 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=7dML7HVO3SIUvu7+ZiyMAW2r1aYzDyVht2iysbBCWL0=; b=CCPTgjwx4OBUIkSCevCe0Pqpm3jqZMGbqaEUxqMRpT8cNppTSSPeyK6z98NhCL3wGA DWhp86G3fejGkj1iuE+VzBXfdkUrWTjJATsNFSn8Jiyw2dxepr5tkNzDO7r5Og7D4T5S nZzhApEqCGconWvJJmxgzxTsy8rTHEBizqu56MCGABwg02eZUhKYq7+w7JAM5upj2sD0 2rPViypU9+SmFt4hjWSAmhSjP61viPGXl2vpR7wrDWj5QUwUzrsorFpTl0H06TM3YcGJ b0TErE7bY+e+dkQK/2g6PT/t94A3/lY+DQ4JuXALwp7KitAJ1h+C8RDUA/s4EJkmL2g8 I3jQ== X-Gm-Message-State: AOAM533tPw0Emwu+1XDkVIR0k0aFV2K3sQNUF/lrZzWmiqLrxX6GeCQg FR7ILod/2U/Jkp0lgV4k5f/eYcyn3qQIKQ== X-Received: by 2002:a62:1657:0:b029:301:af69:5ae3 with SMTP id 84-20020a6216570000b0290301af695ae3mr6472800pfw.57.1624224772793; Sun, 20 Jun 2021 14:32:52 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id w21sm13608329pfq.143.2021.06.20.14.32.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 14:32:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 05/11] target/cris: Fix use_goto_tb Date: Sun, 20 Jun 2021 14:32:43 -0700 Message-Id: <20210620213249.1494274-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620213249.1494274-1-richard.henderson@linaro.org> References: <20210620213249.1494274-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.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" Do not skip the page check for user-only -- mmap/mprotect can still change page mappings. Only check dc->base.pc_first, not dc->ppc -- the start page is the only one that's relevant. Signed-off-by: Richard Henderson --- target/cris/translate.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index 24dbae6d58..9e1f2f9239 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -524,14 +524,9 @@ static void t_gen_cc_jmp(TCGv pc_true, TCGv pc_false) gen_set_label(l1); } -static inline bool use_goto_tb(DisasContext *dc, target_ulong dest) +static bool use_goto_tb(DisasContext *dc, target_ulong dest) { -#ifndef CONFIG_USER_ONLY - return (dc->base.pc_first & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK) || - (dc->ppc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK); -#else - return true; -#endif + return ((dest ^ dc->base.pc_first) & TARGET_PAGE_MASK) == 0; } static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest) From patchwork Sun Jun 20 21:32:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464338 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1983141jao; Sun, 20 Jun 2021 14:33:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrczVUg9XB1nGR9L31j7nb5tDtGjI3I20577hT7siOobtoARHJLfrsRBd5Mfo3aZl4qrLU X-Received: by 2002:a05:622a:100b:: with SMTP id d11mr20759936qte.371.1624224797605; Sun, 20 Jun 2021 14:33:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624224797; cv=none; d=google.com; s=arc-20160816; b=WaJP2BvjP+FOg5a/2S6wke7wbjxJD+jSFgKU7X5YQS1poza0lNTBvr3ti+1IH9tVxu CLuApav3fwJ+Ft8bCPcOrv6wLDrxwzYWuMbEDCrpDNdG6FiDtOJJEG2an3qALH0LetK0 BD6h8zkY3448Y9Vq/VgnJ+HqWpZ1+3+li4bud5Cw0yv3sUq3vxy+DqNyQbsp/PpD8YbU df0QcoZfnb1WzDfm6KuU+bui5OMq0ioguO4HZgdvxBOc5OL9FwQy6qg4zt+/p+lnP7nV sPN6dGJMlX2/jgaWzA/xLrNL5RiPkOehJzYMau1/QfLcTQj2m+6uoFBT2Pyd4WS9nrz7 Kcmg== 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=BdnLl8xmYlB1beezapSg6HL7QcSYtDLtwjs+7yT5xBc=; b=ro3yHqM9tbv8bgovP6CoGOh0zXRinTgdFIrdIXMVxrm6duAz/jstNQhqCJRMtSJ1vg 9Wo+aC2waT3fe+4OMK5UxhBYe5+UWOSwaooAzPHMyJlVTaejbE8f1KUTwravLAbH72N6 YjfOKsMs0Nbasx3NXpljx+uY1Znbez9qwLP/9ea3UqwUIpGA9dWyo7bPjL9OI64I1wSx Zhg5rtv6IIDa/8v5ZhAnx5yg0NFNolfuJzPdfx9JtY6hjEy98O/kU+3/0fcgsXK6bRtJ PI5BHCXU7Lg7OtOWnrx2APvCXMNincn7n88KhDI5cgJPw6lMS8zcaVCAZhCHYnV49GfB A8mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ek8p2Of+; 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 bk20si4473448qkb.37.2021.06.20.14.33.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jun 2021 14:33:17 -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=Ek8p2Of+; 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]:33150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv549-0002Ym-0y for patch@linaro.org; Sun, 20 Jun 2021 17:33:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lv53u-0002PU-Cm for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:33:02 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:39778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lv53n-0008UO-Gg for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:33:02 -0400 Received: by mail-pg1-x534.google.com with SMTP id w31so12526713pga.6 for ; Sun, 20 Jun 2021 14:32:54 -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=BdnLl8xmYlB1beezapSg6HL7QcSYtDLtwjs+7yT5xBc=; b=Ek8p2Of+No8fAmEJPD4DkNaj47ruCU3gNKwP2Y6mPsWRSLfyz2jep+HMrKJAssARib PP4skcyzbu+YcIvUufzv3TyIHZ8D/PgHHDtKj8IZsTWPBSSIU4sozn66kgJ62CRXhTyc 7A0PtrxQxz035N6dt11G/1RpcSbsTwFNmCDfNHqbbdMSj33WbmqXvEgeQbYFNNRMzckG g0OvsnzaQKQX5ij7TsbIsgrHlGAim9racdT47xoEyF52dq0MtmBZFydN02lIB+nq9EBI s1zppo7/Gha1R7NebpBlNRF+tBdA1B60dnfIZgngBp3kPeCJvnJa39Fz4wi6vezImcdq sDdA== 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=BdnLl8xmYlB1beezapSg6HL7QcSYtDLtwjs+7yT5xBc=; b=K42VcdsHPsVqGUBG4vyXS7rNgmGOcpFHTYrjXGw82aWzujKa/gNLyykrk28abfd+1a z1EF1spMs5oaj4LcDtbLsmHQEQmqDJviE2mYSKc3OXO/zmMdHdhAe/hptzBoRYi29KjW 5f5atIGVoM+fQIBe8/y9/ATJvuLYMkviCLX4rh8F06cX709EBkZFpxLacdLHxO98n6rM 7zK9qlcOnAn9L1GPAqkLeIpAWKz3fM9IguBn81pBFq89vkP3bDtELACrb1xpyaBZrmOC 1vDjlfBLc39xue38sYIGZZ3/qQvbNJ5u+HgCVKO9AL5qZqfCb2Fw6CEEbFGWTXw1KVxe rGGg== X-Gm-Message-State: AOAM532LM51KaI3346AgHj6gyiHERAL7aoKNmhFmevPatnWGHfWCCKAy rB6BC/D3SjPdmZNvWmdW42ifFuUXgcVkGA== X-Received: by 2002:a62:ea1a:0:b029:2ec:9146:30be with SMTP id t26-20020a62ea1a0000b02902ec914630bemr16079597pfh.29.1624224773432; Sun, 20 Jun 2021 14:32:53 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id w21sm13608329pfq.143.2021.06.20.14.32.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 14:32:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 06/11] target/cris: Convert to TranslatorOps Date: Sun, 20 Jun 2021 14:32:44 -0700 Message-Id: <20210620213249.1494274-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620213249.1494274-1-richard.henderson@linaro.org> References: <20210620213249.1494274-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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 | 313 ++++++++++++++++++++++------------------ 1 file changed, 170 insertions(+), 143 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index 9e1f2f9239..f6d1fa914f 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -3114,17 +3114,12 @@ 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 tb_flags = dc->base.tb->flags; 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; if (env->pregs[PR_VR] == 32) { dc->decoder = crisv32_decoder; @@ -3134,150 +3129,170 @@ 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; + pc_start = dc->base.pc_first & ~1; 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->flags_uptodate = 1; dc->flagx_known = 1; - dc->flags_x = tb->flags & X_FLAG; + dc->flags_x = tb_flags & X_FLAG; dc->cc_x_uptodate = 0; dc->cc_mask = 0; dc->update_cc = 0; dc->clear_prefix = 0; + dc->cpustate_changed = 0; cris_update_cc_op(dc, CC_OP_FLAGS, 4); 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->tb_flags = tb_flags & (S_FLAG | P_FLAG | U_FLAG | X_FLAG | PFIX_FLAG); + dc->delayed_branch = !!(tb_flags & 7); if (dc->delayed_branch) { dc->jmp = JMP_INDIRECT; } else { dc->jmp = JMP_NOJMP; } +} - dc->cpustate_changed = 0; +static void cris_tr_tb_start(DisasContextBase *db, CPUState *cpu) +{ +} - page_start = pc_start & TARGET_PAGE_MASK; - num_insns = 0; +static void cris_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu) +{ + DisasContext *dc = container_of(dcbase, DisasContext, base); - gen_tb_start(tb); - do { - tcg_gen_insn_start(dc->delayed_branch == 1 - ? dc->ppc | 1 : dc->pc); - num_insns++; + tcg_gen_insn_start(dc->delayed_branch == 1 ? dc->ppc | 1 : dc->pc); +} - if (unlikely(cpu_breakpoint_test(cs, dc->pc, BP_ANY))) { +static bool cris_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *cpu, + const CPUBreakpoint *bp) +{ + DisasContext *dc = container_of(dcbase, DisasContext, base); + + 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; +} + +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; + + /* Pretty disas. */ + LOG_DIS("%8.8x:\t", dc->pc); + + dc->clear_x = 1; + + 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 == 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); - tcg_gen_movi_tl(env_pc, dc->pc); - t_gen_raise_exception(EXCP_DEBUG); + + /* 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; - /* 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; + 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; } + } - /* Pretty disas. */ - LOG_DIS("%8.8x:\t", 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 != (dc->base.tb->flags & X_FLAG)))) { + dc->base.is_jmp = DISAS_UPDATE; + tcg_gen_movi_tl(env_pc, dc->pc); + } - if (num_insns == max_insns && (tb_cflags(tb) & CF_LAST_IO)) { - gen_io_start(); - } - dc->clear_x = 1; + /* + * 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; + } +} - insn_len = dc->decoder(env, dc); - dc->ppc = dc->pc; - dc->pc += insn_len; - if (dc->clear_x) { - cris_clear_x_flag(dc); - } +static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) +{ + DisasContext *dc = container_of(dcbase, DisasContext, base); + DisasJumpType is_jmp = dc->base.is_jmp; + target_ulong npc = dc->pc; - /* 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); - } - - 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; - } - break; - } - } - - /* 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); + if (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. */ @@ -3287,45 +3302,57 @@ 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) { + if (unlikely(dc->base.singlestep_enabled)) { + switch (is_jmp) { + case DISAS_TOO_MANY: tcg_gen_movi_tl(env_pc, npc); - } - t_gen_raise_exception(EXCP_DEBUG); - } else { - switch (dc->base.is_jmp) { - case DISAS_NEXT: - gen_goto_tb(dc, 1, npc); - break; - default: + /* fall through */ 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 */ + t_gen_raise_exception(EXCP_DEBUG); + return; + default: break; } + 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); + switch (is_jmp) { + case DISAS_TOO_MANY: + gen_goto_tb(dc, 0, npc); + break; + case DISAS_JUMP: + case DISAS_UPDATE: + /* Indicate that interupts must be re-evaluated before the next TB. */ + tcg_gen_exit_tb(NULL, 0); + break; + default: + g_assert_not_reached(); } -#endif -#endif +} + +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); + } +} + +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 21:32:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464337 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1983125jao; Sun, 20 Jun 2021 14:33:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCdO9/1Q1uTqPDesjRdn44Tbn06+OjlNF9qc0bxmJDylkuuCvJGJQp5b5qb2lZx1XVqSGa X-Received: by 2002:a05:620a:e02:: with SMTP id y2mr20487355qkm.54.1624224794601; Sun, 20 Jun 2021 14:33:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624224794; cv=none; d=google.com; s=arc-20160816; b=zClRVlrIUtoRWavRa9DjlHiSLOnVqKh8LhyGvHlvK1hGoB8GWMeMYgmjMbKEs5W0HY IBL8cN23ei/0ght6WRyahO4y950jYdWolGOOHhpcs0pdhfL0GRwAlIi1C4DMrYdKBjU9 E8g2UdEgPSJ74L/LVwTV5pulsirtcjdyvMnWIQ6Fv+JUCtMC6dJ0h5Gd0m8spKbGB0fx y8PM0ir5iqofWWLC0u6LU4R1NrkBMAGigwj5wbOcOV/vtUoZpHyrLVrUFhtezUiDhxBs +vxn4h/4s/3f56anU0pu2OdsRSxVuhatHRHwdtM//DuUF3lTw2KCoeR5BNbnKXrGt31p pgfA== 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=n7wF0Ycu/CCH/OCzFJ4Hgb6JmFywiAyzKXBTQFqzYI+sv/mmDpFAT6WivOVDSM5gmx Pu0MZmquhaKiBqcSAasn5LKEu2FMRTLU3+Xgzlm5jocj/F+pFzdKsFHo9EFwJg5id8B4 8poNuz8Q49QXQHyKEtN6g3HDR3bBbAATDW5/PlIZS8O3JX9/T9cn6rL9dy8dIdBgCrAF prziW6JsG9MmHK0c/nOnrjapZ3bZl82lF3/ySFxgZAM0fiRk2+eGLigDVqU/VO959m8P 23crBl8ppaSAZ3HWcix+wiTZeA/RSdnD0FPYsaT0TO3oWvoMnpHemmUb4EfcuLHud+F3 6knQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PDi6MCig; 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 m20si6751766qkn.231.2021.06.20.14.33.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jun 2021 14:33:14 -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=PDi6MCig; 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]:32970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv546-0002Qy-0J for patch@linaro.org; Sun, 20 Jun 2021 17:33:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lv53s-0002LD-N1 for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:33:00 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:43806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lv53n-0008UT-HN for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:33:00 -0400 Received: by mail-pl1-x630.google.com with SMTP id v12so7457366plo.10 for ; Sun, 20 Jun 2021 14:32:54 -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=PDi6MCigN/kQXgFwgSVPBR848SyHXrsX4qj099P2w8I18a2TFz0iXxLpwqp87YdqBL hxSr/ZtR+nf6mk92rdUwtIbHwacSeiC9WhKooJvH+plk+O8C/TkkhXWdzLl3HpyzqkGc xT+k4VyT0pDIudtjIvNeP6IQ0tghwIlMCBTU8H/RyulUWC8ZaciilQKiqSooIOUm0RDh bpwx5eu0YuVIAAUzBAkUSzXfYlUkdTOZbQG9UuUdAmsH1scNYdVa4P9f2J2v5K2DafAi hgCdJGFjjCAPdNhCOCi8X1GUqyvTuD+wer5nWnQbxmUx1zEvehpWcb4aMt6Mw+ASWYWe FQ8Q== 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=F8KeBMfxr/bPcogsV/ciHyvnd+ua9oSJINhbPmBXP4/5gMCfKVkiAvUurxcOngBBRv eOueHP2h3PYG6xe0p3z1VzFBYy1RykS1mKhn5q38Ae5QWMIZ5uA8Cu7eIwB+E/nyFNmo rQ5H3U+ekyCv/GfuZNR1d04QQP8SsEfA5jG4avaJuMGih4IieQ/q2fDKHowsjhEptWGL Ev77t41Jxvx+qlWz4RLNLtvNg8vFxz8S3oZywajt9prU0jZIRqOi2YJjCz2LFCfirpAn fq8XP9fP+jR+qGTSAet8zqiZ2e78AN+HngOLycssOENbS6UKssEYJagrjbMWhVOg2nAN I+dA== X-Gm-Message-State: AOAM530Ba4WBdUjdYiHiltUWXAmp/V47TcCoeqGnGTTIdnFcxPtkwFY4 jyQzUmE9mmIfYvfAaXB2DVQL7qLhg17giQ== X-Received: by 2002:a17:90b:187:: with SMTP id t7mr6849684pjs.67.1624224773860; Sun, 20 Jun 2021 14:32:53 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id w21sm13608329pfq.143.2021.06.20.14.32.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 14:32:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 07/11] target/cris: Mark helper_raise_exception noreturn Date: Sun, 20 Jun 2021 14:32:45 -0700 Message-Id: <20210620213249.1494274-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620213249.1494274-1-richard.henderson@linaro.org> References: <20210620213249.1494274-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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 21:32:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464348 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1986228jao; Sun, 20 Jun 2021 14:40:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxLE6a9Gf919+4zs71wJOYE3S3o/wMcv9JMlNHD1rd3ZuXO7HQgZj1UrtcBDbFErXxB8sj X-Received: by 2002:a02:334e:: with SMTP id k14mr14580892jak.52.1624225247731; Sun, 20 Jun 2021 14:40:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624225247; cv=none; d=google.com; s=arc-20160816; b=MtybZaBFX86SaFL2a3f1FryFsppUogZ4yaZ9ZsL9OU3ra54csj3gnalFrRcrmUry2m WdDitdWlYLJ4K61CKGqzmMNSPETN6ypnNkOQQKBsIe/eUX25xvocQ4rFq+DbJTFDeQ6f WSy0taSNur3GmzUsp5c/OyBEuLwDzoRjjgIyjBr29BmkJf3vNzXcqFFpVwCrQN+hw3PS Pum7x7IgyuGDS15FG/7tu6zeCaaP2320VVSTA+mBkIq2pfsPFKEOuUKpHQg3bNCSEuao K+9DWXhOroyFvKgh7qvm3sReQ/JGCF12Qf6HsyYJK1sgR6jXJVcCP5139hD7Ie/LlLDV 0AyA== 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=v4kZDh8uVsOZEauYx+O7aUBWOVxEx002X2bRwf1pVz0=; b=gE5/jTf8uE6kdBYX4l4wi7MkNBwODBa8dqdAvQBiJmYRTd6G7LVUrwKt5Tgl1ZJ1Fl Guis4QQH518vMkqJ1088LXzurHZnJzFG9UKYlisQ4xknFDJFrElKunWKEBW6Yl3t2kHt tQ0qbFA69lrMRouv40beUTKbtb1BvV3P3RL5rZuoreBHqAYrp2vIGDBL62J4tMYIdkRP jxroe6j8dpyEg3qpEBQFBXqF2fxUYQ+yGE/kDks0AZqW1D/wePsH+bhyfpwLYVS0wdWY L1JpMN42q0waaXJmfskzeMkM2tV3wEvigW9GW4j2BYw64Y2Y+ezWgygG3zvxt0lybv/m YEjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cdpo0K+S; 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 f13si10965730ila.126.2021.06.20.14.40.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jun 2021 14:40:47 -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=cdpo0K+S; 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]:58310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv5BP-0002Nw-7z for patch@linaro.org; Sun, 20 Jun 2021 17:40:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lv53t-0002Nf-LQ for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:33:01 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]:36381) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lv53o-0008Ub-2Q for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:33:01 -0400 Received: by mail-pf1-x434.google.com with SMTP id t8so1860007pfe.3 for ; Sun, 20 Jun 2021 14:32:55 -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=v4kZDh8uVsOZEauYx+O7aUBWOVxEx002X2bRwf1pVz0=; b=cdpo0K+Sh0yVlGEkyYNgjItt4m5Cs0tDBwPBlTc6QZtl9ek2+qHgs+y4VsXTmSDvH4 nH3NCS21MP646qMm3TyWu9/Qa1iCekyitqeL29h4eYbz+bu78gZ9S0DBSQLG8+I53fHL 2GzXDpxBxwd42DwLXpfwtoncBWgf8ItWjqoGXvvuZtsH1kzAWN7kTJPLIhYZpvE30uAJ s39HLAQUTXE4wZqxIaktwEhm7BN9WoZe1CyQDCYkIOKPlc8NyaEuSduhRF6uYKJzupiH HEpifoDdfxvzm+RopE/LeCEP6OiM+SUfFudvbcXkfSdwMspwK2EkSqf76IE9EhInbgqH t6dw== 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=v4kZDh8uVsOZEauYx+O7aUBWOVxEx002X2bRwf1pVz0=; b=peXjdONyCZAxayKJTbHc2eQBg6BHizSGYlUBcMSkT/J83i7cqkzSenQFMPrq12l1z8 gonypTNVpKThk5vnc92076SB1ChmTQSyRZ8WkfD8ctqwd0h0px2uhpzahihPthelp8Zs WP2HzBHC78xz1ICNom4tbbgcZsVfhp16mQwp9y0oPj8wKpwfmQaYLnb30q6neeskTINS eimeDxCbg0iTVFCCdBDGtMWVIthEOaHnQionxlhtZcFn1ca5sGvyE4kovkYZf8EC7Zz0 RKU0V4C4NkRwtJKd4gZ6JYiQH45v3t6yXv+E9gyP2QRK9jNVlFXIIZBcYQT29uv2YGAS k0kw== X-Gm-Message-State: AOAM530YfmSoMIJGGgP6JJBTiZB2lyp+kftTNv4UFw1g5f5Soc1bvM1Y ipCIls/c0oGLuj+LavovPJc5yxLjPz/j8g== X-Received: by 2002:a62:8f81:0:b029:2e9:c6d9:df67 with SMTP id n123-20020a628f810000b02902e9c6d9df67mr16340032pfd.52.1624224774300; Sun, 20 Jun 2021 14:32:54 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id w21sm13608329pfq.143.2021.06.20.14.32.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 14:32:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 08/11] target/cris: Mark static arrays const Date: Sun, 20 Jun 2021 14:32:46 -0700 Message-Id: <20210620213249.1494274-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620213249.1494274-1-richard.henderson@linaro.org> References: <20210620213249.1494274-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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 Reviewed-by: Philippe Mathieu-Daudé diff --git a/target/cris/translate.c b/target/cris/translate.c index f6d1fa914f..83b20162f1 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[] = { @@ -1279,7 +1280,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" }; @@ -2926,7 +2927,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; @@ -3359,8 +3360,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 21:32:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464346 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1984483jao; Sun, 20 Jun 2021 14:36:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKcUNZJGF810XzjZy7MokuiMaukFZaltr5cInKmdBN/YiamdDSFv5KQW11Kbs3ugQ7fRDt X-Received: by 2002:ac8:5685:: with SMTP id h5mr20866267qta.255.1624224998757; Sun, 20 Jun 2021 14:36:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624224998; cv=none; d=google.com; s=arc-20160816; b=xezj8gaRkzhWsPfhQ2YnkgtbwGhx8GC7w5rcefV/45VCRChHSwjhR2Wv9yvFQj5WPT BwF/aL25B28GBOTgCsRw5Kk1z8Y8gaVTqmLVeMj8RIepCM+I6gYli6oX2sZS8FE7nwjC YXZLUvzc9wZFSTOQKhrNEsPq+IvzyN2K2PkZW63wLCIjX6gEh0ECz61S6+bggZpdXVxj KOsH0agDiffNKS/2o++W5mtPSdCatqP3EQf09/9rw6FtpWi/LtmqBj0lau1EECKINpq0 vG1r6U3r9dgzD5Q9C/apIUg59Iyco/Z8a98hrXZfQSUKY+bUgsKt+tz/2sRxSB8X4ohn i0mA== 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=vWYGihdcluFmv+BkOCZIBqSaEk3uezdQ5EyW3tAoFv0=; b=wQ3lZ9M2TilcIvTU48EebS3oX5jg2vGu0ldrVs87oZAXPYAGt+bnqVxtI1od7lxX73 2I7YfDs/Dd8aXZQFFojbIPlR+Prp/UnDX1dhJIEic5Wtfa9mjPcz5T1RptEs1l7ruvsH 3kWhqcbB0j0ISP8vHVH3kxvypXInEL3HGxbEPqxds9LanSsEZQIbLFHKJnjmRPyWB4V1 0fo+r7myuBxOfZxMTxHRkC4nZvGOGjkyKx+gqQCHMfUyoUDbEJVD1o2cg4I2xEu2CWzu oAQIvHzWINLGF1bpPJGlBtuA3diYTY/W5wdpc/hqgzB8E29IH21z6txvSaCG/8MjnCwJ gT6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xisxX7Zm; 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 e18si16316270qtm.393.2021.06.20.14.36.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jun 2021 14:36:38 -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=xisxX7Zm; 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]:49898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv57O-0005DS-0u for patch@linaro.org; Sun, 20 Jun 2021 17:36:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lv53t-0002Ny-QT for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:33:01 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]:33619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lv53o-0008Ui-GE for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:33:01 -0400 Received: by mail-pl1-x632.google.com with SMTP id f10so5330936plg.0 for ; Sun, 20 Jun 2021 14:32:55 -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=vWYGihdcluFmv+BkOCZIBqSaEk3uezdQ5EyW3tAoFv0=; b=xisxX7ZmFRXfhYfLb39miEUT9xHZaKsgF8uFQ89Yz6bTnRGFx9KOrArEzpv1h1Lemy CEmsDtIfsJE11RZMsVU7+vIGPOXDKjdGOJ6gucRHsA898BZ0fUmhxFDQHml3y18Ze3Jr npczjYL76FV733LPZftc1AXO/ASCd+QvT7ETItj/RbCTqp3cWbnpD0nkrZV6BPHKkxzw VB+svUb4iKV740olLMfH4dHY51mg9/vL+NtrpjL4d4gW++vbSNuiw+eeV92sNbg1nW66 EeBeXCC9aOzW4wZ8MxQ1KgcedJxtWh15oWKgNolkEvMHK/lGzFcjKBzUFZopqa4MngLe BT5A== 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=vWYGihdcluFmv+BkOCZIBqSaEk3uezdQ5EyW3tAoFv0=; b=DAIPxDJk+82w2++3gH7gCFCWakGuNc7iwu0AWZNqcQcqExwxZeSSmq0twVExC50Uaz LlYsgsTaPuKwzb6ZF0R7gvMHmg71uxqkuJidbpqH/p5/UjYW9dsgag3vVp/6fc8YhSiA jY/dURDKlCFdWvDSOgOxs5DdaFYiCxfWgCGFa7UeqtMGdbWa+pWxtmg+OaNde4O2xe54 VCEHOT8m50rQX0YW7jcGWwiURNOVSyQRnvZFWp3oJCnHvNIPL+1rLSUVqMHEofUis+Cb phYExyjRVJ2dt6K5CAfkE5LAnIqhi/gR73EMMFaXN1mQdp1tw6I0HXusBIxPnYmVKabE OlNQ== X-Gm-Message-State: AOAM530Goje+PAGJeegjRyartNXZMfyUKMoKPui0D2WpZJ/JOSbgaL1U ptvBzqi0hMPGXUB/d6Tqh1EJOcJb3cLWsQ== X-Received: by 2002:a17:90b:197:: with SMTP id t23mr23094377pjs.61.1624224774851; Sun, 20 Jun 2021 14:32:54 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id w21sm13608329pfq.143.2021.06.20.14.32.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 14:32:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 09/11] target/cris: Move delayed branch handling to tb_stop Date: Sun, 20 Jun 2021 14:32:47 -0700 Message-Id: <20210620213249.1494274-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620213249.1494274-1-richard.henderson@linaro.org> References: <20210620213249.1494274-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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" By moving the code here, we can re-use other end-of-tb code, e.g. the evaluation of flags. Honor single stepping. Signed-off-by: Richard Henderson --- target/cris/translate.c | 82 ++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 37 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index 83b20162f1..0e925320b3 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -55,6 +55,7 @@ /* 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_DBRANCH DISAS_TARGET_2 /* pc update for delayed branch */ /* Used by the decoder. */ #define EXTRACT_FIELD(src, start, end) \ @@ -3219,43 +3220,8 @@ static void cris_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) * loop doing nothing for on this program location. */ if (dc->delayed_branch && --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; - } + dc->base.is_jmp = DISAS_DBRANCH; + return; } /* Force an update if the per-tb cpu state has changed. */ @@ -3303,6 +3269,48 @@ static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) cris_evaluate_flags(dc); + /* Evaluate delayed branch destination and fold to another is_jmp case. */ + if (is_jmp == DISAS_DBRANCH) { + if (dc->base.tb->flags & 7) { + t_gen_movi_env_TN(dslot, 0); + } + + switch (dc->jmp) { + case JMP_DIRECT: + npc = dc->jmp_pc; + is_jmp = DISAS_TOO_MANY; + break; + + case JMP_DIRECT_CC: + /* + * Use a conditional branch if either taken or not-taken path + * can use goto_tb. If neither can, then treat it as indirect. + */ + if (likely(!dc->base.singlestep_enabled) + && (use_goto_tb(dc, dc->jmp_pc) || use_goto_tb(dc, npc))) { + TCGLabel *not_taken = gen_new_label(); + + tcg_gen_brcondi_tl(TCG_COND_EQ, env_btaken, 0, not_taken); + gen_goto_tb(dc, 1, dc->jmp_pc); + gen_set_label(not_taken); + + /* not-taken case handled below. */ + is_jmp = DISAS_TOO_MANY; + break; + } + tcg_gen_movi_tl(env_btarget, dc->jmp_pc); + /* fall through */ + + case JMP_INDIRECT: + t_gen_cc_jmp(env_btarget, tcg_constant_tl(npc)); + is_jmp = DISAS_JUMP; + break; + + default: + g_assert_not_reached(); + } + } + if (unlikely(dc->base.singlestep_enabled)) { switch (is_jmp) { case DISAS_TOO_MANY: From patchwork Sun Jun 20 21:32:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464343 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1984103jao; Sun, 20 Jun 2021 14:35:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/jJOSMj5QycKHNPrnz6QO4KB96Pd+nL0eblHORQJjKwG1Ij9YQlF3vQl8dpFFI9QQMXo4 X-Received: by 2002:a05:6214:12c6:: with SMTP id s6mr16749342qvv.19.1624224939861; Sun, 20 Jun 2021 14:35:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624224939; cv=none; d=google.com; s=arc-20160816; b=sn18VxpZGjrZe7QfTb07LI4CpSrpYck/8QKRgbl5g4YCHBJjTyCJ3F54PZpwJmCrZ4 RDWYRQq7fReg4c54qhcvGaSoMexbBqdHoa/xVuhgk8pXTdB9/riBhNXv2PLSwKbBn7SQ PdNcaArE6lMBkiy0/dkI7hkFTJICHndHN6T4kCITbhW8jAws2H85ul9q1F2Dg30NELBE hx2zCyike9EOY6nlQCbtpbWmSPahWx4Bnkn63DM4L1LoXU6OIyeyyS/sSqZytgtdQ2Ge QMFSSjdM1mjym7pB3n/B0++Vl/4++HYN7OmsH/JzruI1kUadABxZCyA1k/dpZnbdgzBw Ikgw== 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=hlWx/fey2FgjFaKp9Mso1gmF59ZDXY3XC/bRgVAOonA=; b=uF9aq5A+TfZNtpEk8JybldG4RACx4tUv6lMFqahAUDoCviRdTDQwaijWrMFMMywLpw Me5dHe08aDskCS4E6EUmCaRLeEvib2xoU1GbAiifMJYOc7rAVy/JNLdfag1vp4rCoNKr 5SThT2ImFyexJXXTEyTBBpcjod+UH1d8YDO9FhSB+lhm0SnWK5ta+HyOOj4aw/iaAGTX gGM4mM08B8FiKNU8CWBHEereNCnjBdftpHG3MSyL5MIKSo3HQyEi4gzMqs5fb3nWXJHA E44M643rzWDk3qO2/DU9PEpo5wj928N4HywJpS9/o2sdr9D5XZQMBEqqnOOVNV7k1Cek aR6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v6k99Czs; 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 di19si6431416qvb.159.2021.06.20.14.35.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jun 2021 14:35:39 -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=v6k99Czs; 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]:41390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv56R-0007zC-8J for patch@linaro.org; Sun, 20 Jun 2021 17:35:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lv53v-0002RM-1k for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:33:03 -0400 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]:37388) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lv53q-0008Uy-74 for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:33:02 -0400 Received: by mail-pg1-x52f.google.com with SMTP id t9so12517394pgn.4 for ; Sun, 20 Jun 2021 14:32:56 -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=hlWx/fey2FgjFaKp9Mso1gmF59ZDXY3XC/bRgVAOonA=; b=v6k99CzsHwq/Tmq6lqntABxxmXfkeRmUgD3DiFuJHLDAg/1IWERWuNBzjXKFOT1MMn TfTC4i4JKWJibC1e++WyyeGh6XwavjY6Opjh+v5dJJrvRQdE4jO/8c9ZdkTT36X868Eh NQ93mX18kuke7QV9bDiRVkyOlYBFcMrZd6NYmI5W+oBxVsUXEiOq0uMyGDS6LOOLg38x 5/1FinqD89/tIGSfVU7Ggfc1jG3nDmmnd4phqSxCsXFixLci770CLTanoLfEcMdzb9iF Wa/AoAOEkYPKaQ6QI0NiUr4evfEUeAHJYHfSzKzOKQzVf2xm8CiYLzDbtXAQeRM9nKR/ yAUA== 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=hlWx/fey2FgjFaKp9Mso1gmF59ZDXY3XC/bRgVAOonA=; b=SzxLfxV7uLegi/hHrwQKpIRlSk9sCEZaxm2rIhTHd7W19dNrYBLOKUYR98K9MTGSY0 wPiL8t50DepojGxpdnmIRK4f9J58qjsKBGvVpGypU0ChT/vq+srFVtuRDZWx3wL2K4Qe QrB6qUNY88CZC/gkK7/BeR2qjiFuNHaFDFAS6Sb/yalEjMuckys6xEILkrkbX4KfduK2 FpN9eAWTCZpb+5DYj9HcW7Eg1nBehWeyIyHPLdHwkIttFzxmzTHlUM8q/bVCOB/+YNI+ feoxkNr93FBVCZzs5ovVjSYXQt+b3QM0TyqEH3HhiH3dvr/jig0jg/gYhkVDyQGaGWVF fYTw== X-Gm-Message-State: AOAM533rmhRtfqjLGRH1+DxyhKNNmWMANaYtGMFBC2/HrAjPsRuOAP3f hcQMZbtExkdC2brfQWwWvp366hZBcGGGFw== X-Received: by 2002:aa7:8b0d:0:b029:2e9:857e:c1d1 with SMTP id f13-20020aa78b0d0000b02902e9857ec1d1mr16200305pfd.33.1624224775452; Sun, 20 Jun 2021 14:32:55 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id w21sm13608329pfq.143.2021.06.20.14.32.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 14:32:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 10/11] target/cris: Use tcg_gen_lookup_and_goto_ptr Date: Sun, 20 Jun 2021 14:32:48 -0700 Message-Id: <20210620213249.1494274-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620213249.1494274-1-richard.henderson@linaro.org> References: <20210620213249.1494274-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.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" We can use this in gen_goto_tb and for DISAS_JUMP to indirectly chain to the next TB. Signed-off-by: Richard Henderson --- target/cris/translate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index 0e925320b3..c33324b988 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -539,7 +539,7 @@ static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest) tcg_gen_exit_tb(dc->base.tb, n); } else { tcg_gen_movi_tl(env_pc, dest); - tcg_gen_exit_tb(NULL, 0); + tcg_gen_lookup_and_goto_ptr(); } } @@ -3331,6 +3331,8 @@ static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) gen_goto_tb(dc, 0, npc); break; case DISAS_JUMP: + tcg_gen_lookup_and_goto_ptr(); + break; case DISAS_UPDATE: /* Indicate that interupts must be re-evaluated before the next TB. */ tcg_gen_exit_tb(NULL, 0); From patchwork Sun Jun 20 21:32:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 464344 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:102:0:0:0:0 with SMTP id x2csp1984159jao; Sun, 20 Jun 2021 14:35:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAqDP+26zOi0mPSnTkKBRCcBw3hPX9jYVNBSCZqx/MMNijKnNoKPQ22GmxwjtL9cvLyuNj X-Received: by 2002:ac8:4c8c:: with SMTP id j12mr20710257qtv.390.1624224945582; Sun, 20 Jun 2021 14:35:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624224945; cv=none; d=google.com; s=arc-20160816; b=fjAgAHxOehKWW5Unb9kyx7U7d3GcbIiOKFUjQaKmd9ewdg8Woy8XM26V/8PIpkAfVm 6++QwnKL3VJTiB4qU/oDlB47eMaQrQeJh0ZGOUgGTjY1DBucTkqslM933giZ84y1+w6V yCDAukzQuJXPkXqWlLVChzCXCsVIh4nnscpRaArLnjiy+Q97eSjZKDWeOdTj/hK8ao6x JNmJ6ALxJ9weumN5XCgwAtdO8yX6G6MeULbo7sFKlc/7zLTdcgbvO8YYV5QoMI30zIIU q3vXwsVCRqcgJQZ2fucHCluaqHjvpZrK+RZ9yL8q59YGqYZkOzWjiov1m9BWE2RT8Jyn ZzEg== 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=EMPtI6EgvV/WiXI17jvBtKPkWXlx76mMDamBhdAr7N4=; b=P+Y/mMS6YdQHI2xMdnJpU33l45CqpV+5LZkklrO//Bani9Gob3Efc8GTWPDc4p+HSl izEPOxxstZUvjIq+0VB+nw7pplwJBEjOeFPLY8lK8rAofOpfbIc8kKYGFoU+UZCKqidX 7H4tw5BfCcTW0mLjtN7ZuKFWArAEG74bp/oiOA8E+DJBrb7tU85kMOg5nN7bM6+zmo4y Bi6Wo9BSu5JUx3MWt2F8zFg6rhemqbrc2XdMs3IsY2hidvoOMsQ+314rZRw2ExblUabY zSuHbbpv7p2o5RHdapUqNRKMys8wlhQhs4EuykKsiVrz9yVMXpBcmscDJYjZcbQsv100 1aYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NFskWdxC; 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 b20si9492717qkk.53.2021.06.20.14.35.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Jun 2021 14:35:45 -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=NFskWdxC; 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]:41932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv56W-0008LN-WB for patch@linaro.org; Sun, 20 Jun 2021 17:35:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lv53v-0002Sf-FA for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:33:03 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:42612) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lv53q-0008Ve-7A for qemu-devel@nongnu.org; Sun, 20 Jun 2021 17:33:03 -0400 Received: by mail-pl1-x636.google.com with SMTP id v13so7448243ple.9 for ; Sun, 20 Jun 2021 14:32:56 -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=EMPtI6EgvV/WiXI17jvBtKPkWXlx76mMDamBhdAr7N4=; b=NFskWdxC2hSl5DAKKXzUV6VjYI6M0308P+6QbjeNfODbA0ZWPyX8nRXSNXb8kW+I0+ VBLkarpPrG4dzhbd+QRPYS846r6h1ZBefVTQzroS9gOOr8gHl7nNHCP2ueUJIQl6bC/u /TMwkBLCZ6KSqWhOrj/sOiMmN4HhdHtiDoIilxct9KZZ6ltrejeVvf0LQ3p5/FZqXE0a pZQ13G5SyKrmSi09mg8ySSKONxLVCRoz8MUiId3VRroa3VoCbR8M6UErIQbJ1s3KjXKP +GSONPUkbFQb7ux2z/xubVJJcGhDVB9gF4UWDrGvu7JBD2zGsDNak7w6g+QC91dzELbQ rLoA== 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=EMPtI6EgvV/WiXI17jvBtKPkWXlx76mMDamBhdAr7N4=; b=XujEp9hxXNtPq7U+O09EbZz32IoaJhwITsUYiKH7UjKmSxr1AmGP/SKFWL/uh0rRC4 4P688x9iSJIt7tuRVLXoI0CAuKtZChUOI6BgLdPwcIaycd1UUFmpEAwwUjfaVUO5QqxK 92BFDS5t+TSqU8E0Pz4eRlBk29IG1Ro7MsOxOe/dGRiL0iZtkhBhshdvu0Laxoa0V+Vy m4HhNdm9oq4+eyYUJGYneZCDSRNkyoKbAubsYyUT4K+EOa8YiZiP/OQP0com9GuPeHXU G7gW/KXT7LTfB57cjJJRXdwOqeFVaRaG9+W7NadB6V1RAbenfe4nQzYxGS7Ua4hNAq+Z hFXQ== X-Gm-Message-State: AOAM533SJaMBfqhtyxHGGkq0Yn7HJcH7YeELmKnJpDciXYadYaTLVpsC Q2yMWGLT+sLDBDOUwwP+Ax5+j5EkgaisdA== X-Received: by 2002:a17:90a:fb51:: with SMTP id iq17mr23259567pjb.26.1624224776081; Sun, 20 Jun 2021 14:32:56 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id w21sm13608329pfq.143.2021.06.20.14.32.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 14:32:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 11/11] target/cris: Improve JMP_INDIRECT Date: Sun, 20 Jun 2021 14:32:49 -0700 Message-Id: <20210620213249.1494274-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620213249.1494274-1-richard.henderson@linaro.org> References: <20210620213249.1494274-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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" Use movcond instead of brcond to set env_pc. Discard the btarget and btaken variables to improve register allocation and avoid unnecessary writeback. Signed-off-by: Richard Henderson --- target/cris/translate.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index c33324b988..3200819f32 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -515,17 +515,6 @@ static void t_gen_swapr(TCGv d, TCGv s) tcg_temp_free(org_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); -} - static bool use_goto_tb(DisasContext *dc, target_ulong dest) { return ((dest ^ dc->base.pc_first) & TARGET_PAGE_MASK) == 0; @@ -3302,8 +3291,17 @@ static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) /* fall through */ case JMP_INDIRECT: - t_gen_cc_jmp(env_btarget, tcg_constant_tl(npc)); + tcg_gen_movcond_tl(TCG_COND_NE, env_pc, + env_btaken, tcg_constant_tl(0), + env_btarget, tcg_constant_tl(npc)); is_jmp = DISAS_JUMP; + + /* + * We have consumed btaken and btarget. Hint to the + * tcg compiler that the writeback to env may be dropped. + */ + tcg_gen_discard_tl(env_btaken); + tcg_gen_discard_tl(env_btarget); break; default: