From nobody Wed May 8 22:22:39 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1624224882; cv=none; d=zohomail.com; s=zohoarc; b=Mn2l2871aGfEaMFk2BLGNxRrGNii6bydlmwmJkYwxc6puJJd4IqZu3ZexHGlgG/a7MtaMGn8nLvgAofSbnwkzHiBxABrbMifzd5bywUcoMlTfBvzQhf5nGXsUFcuzeuKXfBy0R7bRX1QlIQm6fY6EpFZxZLbehuOBdn3DAFlm3U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624224882; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IZqsDG39a6RHRH2b5Sr2GJhmurivUBKrieIfGWTmK84=; b=BcB5M7enjhyR4fPolnW4h8hlBkbIDg4sdJB9AFMS6zhdR+5oQqr4x+R7YPC47UZHVjRxJiZ6fECzJJMmApjYH7hFcfjJtc4EbKOb9WWxKWZvOXGPJkW/2AF3pSMNGuwtKe6vIT5OKtecAEcv8xs0pSrDl6Y8IWSefq2PlJ5MqM8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624224882899311.3409833888676; Sun, 20 Jun 2021 14:34:42 -0700 (PDT) Received: from localhost ([::1]:36668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv55V-0004tc-QK for importer2@patchew.org; Sun, 20 Jun 2021 17:34:41 -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) 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) 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-Google-Smtp-Source: ABdhPJzOG+3sm7xJA5i+oSQYnDWMSp5oSMHa9oCmT37eZNfHhn5qsSh0udGepBaHV51qHc6wjHV2AA== 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" 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(-) 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; =20 /* This is the state at translation time. */ typedef struct DisasContext { + DisasContextBase base; + CRISCPU *cpu; target_ulong pc, ppc; =20 @@ -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; =20 #define JMP_NOJMP 0 #define JMP_DIRECT 1 @@ -131,9 +132,6 @@ typedef struct DisasContext { uint32_t jmp_pc; =20 int delayed_branch; - - TranslationBlock *tb; - int singlestep_enabled; } DisasContext; =20 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) =3D=3D (dest & TARGET_PAGE_MASK= ) || + return (dc->base.pc_first & TARGET_PAGE_MASK) =3D=3D (dest & TARGET_PA= GE_MASK) || (dc->ppc & TARGET_PAGE_MASK) =3D=3D (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, DisasCont= ext *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 =3D DISAS_UPDATE; + dc->base.is_jmp =3D DISAS_UPDATE; dc->cpustate_changed =3D 1; } =20 /* For the I flag, only act on posedge. */ if ((flags & I_FLAG)) { tcg_gen_movi_tl(env_pc, dc->pc + 2); - dc->is_jmp =3D DISAS_UPDATE; + dc->base.is_jmp =3D DISAS_UPDATE; dc->cpustate_changed =3D 1; } =20 @@ -2886,14 +2884,14 @@ static int dec_rfe_etc(CPUCRISState *env, DisasCont= ext *dc) LOG_DIS("rfe\n"); cris_evaluate_flags(dc); gen_helper_rfe(cpu_env); - dc->is_jmp =3D DISAS_UPDATE; + dc->base.is_jmp =3D DISAS_UPDATE; break; case 5: /* rfn. */ LOG_DIS("rfn\n"); cris_evaluate_flags(dc); gen_helper_rfn(cpu_env); - dc->is_jmp =3D DISAS_UPDATE; + dc->base.is_jmp =3D DISAS_UPDATE; break; case 6: LOG_DIS("break %d\n", dc->op1); @@ -2904,7 +2902,7 @@ static int dec_rfe_etc(CPUCRISState *env, DisasContex= t *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 =3D DISAS_UPDATE; + dc->base.is_jmp =3D DISAS_UPDATE; break; default: printf("op2=3D%x\n", dc->op2); @@ -3146,13 +3144,16 @@ void gen_intermediate_code(CPUState *cs, Translatio= nBlock *tb, int max_insns) * delayslot, like in real hw. */ pc_start =3D tb->pc & ~1; - dc->cpu =3D env_archcpu(env); - dc->tb =3D tb; =20 - dc->is_jmp =3D DISAS_NEXT; + dc->base.tb =3D tb; + dc->base.pc_first =3D pc_start; + dc->base.pc_next =3D pc_start; + dc->base.is_jmp =3D DISAS_NEXT; + dc->base.singlestep_enabled =3D cs->singlestep_enabled; + + dc->cpu =3D env_archcpu(env); dc->ppc =3D pc_start; dc->pc =3D pc_start; - dc->singlestep_enabled =3D cs->singlestep_enabled; dc->flags_uptodate =3D 1; dc->flagx_known =3D 1; dc->flags_x =3D tb->flags & X_FLAG; @@ -3189,7 +3190,7 @@ void gen_intermediate_code(CPUState *cs, TranslationB= lock *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 =3D DISAS_UPDATE; + dc->base.is_jmp =3D 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, Translatio= nBlock *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 =3D DISAS_TB_JUMP; + dc->base.is_jmp =3D DISAS_TB_JUMP; dc->jmp =3D JMP_NOJMP; } else if (dc->jmp =3D=3D JMP_DIRECT) { cris_evaluate_flags(dc); gen_goto_tb(dc, 0, dc->jmp_pc); - dc->is_jmp =3D DISAS_TB_JUMP; + dc->base.is_jmp =3D DISAS_TB_JUMP; dc->jmp =3D JMP_NOJMP; } else { TCGv c =3D tcg_const_tl(dc->pc); t_gen_cc_jmp(env_btarget, c); tcg_temp_free(c); - dc->is_jmp =3D DISAS_JUMP; + dc->base.is_jmp =3D DISAS_JUMP; } break; } @@ -3264,7 +3265,7 @@ void gen_intermediate_code(CPUState *cs, TranslationB= lock *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, Translatio= nBlock *tb, int max_insns) npc =3D dc->pc; =20 /* Force an update if the per-tb cpu state has changed. */ - if (dc->is_jmp =3D=3D DISAS_NEXT + if (dc->base.is_jmp =3D=3D DISAS_NEXT && (dc->cpustate_changed || !dc->flagx_known || (dc->flags_x !=3D (tb->flags & X_FLAG)))) { - dc->is_jmp =3D DISAS_UPDATE; + dc->base.is_jmp =3D DISAS_UPDATE; tcg_gen_movi_tl(env_pc, npc); } /* Broken branch+delayslot sequence. */ @@ -3293,12 +3294,12 @@ void gen_intermediate_code(CPUState *cs, Translatio= nBlock *tb, int max_insns) cris_evaluate_flags(dc); =20 if (unlikely(cs->singlestep_enabled)) { - if (dc->is_jmp =3D=3D DISAS_NEXT) { + if (dc->base.is_jmp =3D=3D 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, Disa= sContext *dc) t_gen_mov_env_TN(trap_vector, c); tcg_temp_free(c); t_gen_raise_exception(EXCP_BREAK); - dc->is_jmp =3D DISAS_UPDATE; + dc->base.is_jmp =3D 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 &=3D ~PFIX_FLAG; tcg_gen_andi_tl(cpu_PR[PR_CCS], cpu_PR[PR_CCS], ~PFIX_FLAG); - if (dc->tb_flags !=3D dc->tb->flags) { + if (dc->tb_flags !=3D dc->base.tb->flags) { dc->cpustate_changed =3D 1; } } --=20 2.25.1 From nobody Wed May 8 22:22:39 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1624225061; cv=none; d=zohomail.com; s=zohoarc; b=aF402WjnwIj0G/JcBWnn+UAsQunhA0fwSArvA7oa7FPdCPW9RapAI1vfjEgH8uwbqaVwfgSQEf/gvu4r9zgDyLsDvB+x+TkYbbBIJHiuC6/4P/27L3IXKNon2fLRz2a51NLPXXI9zDaYqWi3YX+LzKB9yC+w/+/Z2G/MKkrTvw0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624225061; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ktgo4xWUwEPLcu/uB4HSWazqzoEfJMOHsnknfFL5vLg=; b=Zt/rWul3E2tFU8USiGFYk0Vt9RdfXTt+uBaLVoXT+A8Y2HN/ocoX05xyDCDqo/qY2kkUlA5gsJ6nStpkz8YXsVuzET7SFOMvh0U2qjRKkd3+mZTX9NBRrMlZ3+voerzTPEBhgEJl1YdFIX/6AiKTlzMFWiEINkBNpN1vc2ZUmJA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624225061500294.9913326277368; Sun, 20 Jun 2021 14:37:41 -0700 (PDT) Received: from localhost ([::1]:52724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv58O-00075j-HB for importer2@patchew.org; Sun, 20 Jun 2021 17:37:40 -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) 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) 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-Google-Smtp-Source: ABdhPJx9iXbnFBsuN/oybKQIjWWLci3OFIrUG572iCeBGENfJimJS2TgBM+JeEwD9/uRrcwm+1glaQ== X-Received: by 2002:a17:90b:300c:: with SMTP id hg12mr26176275pjb.46.1624224771330; 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" 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(-) 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 =20 /* Used by the decoder. */ @@ -3243,12 +3242,12 @@ void gen_intermediate_code(CPUState *cs, Translatio= nBlock *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 =3D DISAS_TB_JUMP; + dc->base.is_jmp =3D DISAS_NORETURN; dc->jmp =3D JMP_NOJMP; } else if (dc->jmp =3D=3D JMP_DIRECT) { cris_evaluate_flags(dc); gen_goto_tb(dc, 0, dc->jmp_pc); - dc->base.is_jmp =3D DISAS_TB_JUMP; + dc->base.is_jmp =3D DISAS_NORETURN; dc->jmp =3D JMP_NOJMP; } else { TCGv c =3D tcg_const_tl(dc->pc); @@ -3311,7 +3310,7 @@ void gen_intermediate_code(CPUState *cs, TranslationB= lock *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; } --=20 2.25.1 From nobody Wed May 8 22:22:39 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1624224966; cv=none; d=zohomail.com; s=zohoarc; b=WRIS2cUv7MB2iUVl78/lkrx7Zx+0VXyE6XVKWltQD7h+d9+wxWC64f2gQelNJHxyPVYfZ4OHF7yJfCvl5dEcgG5qPBy/UpOY2X7SVEXsW15M4XQG4SMvy9g0UK/ok1cC5NK9KCmIh8NQosl94P9IAKH+TzKsKJ8TGUXh0qpX5uU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624224966; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4qZYFgo5owfVk6zq1cDCv8vj7PKVInUCjUJb6z1w1uE=; b=YHRe4zr2ZBy76xynFXKOPGi9yUc1OzzOW8mIgm/reea0V8OMyWOK8+NjA3mszY686NZDpZFsh+fHCdiSTgCeECAtVipHXKJZAe5/JttPveYSQKuok3fY72rZlr19OEMcme8y/dcy9oaVKEi/RWPg13kta1b3iljQS03CEjn5D+E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624224966406336.3739861181515; Sun, 20 Jun 2021 14:36:06 -0700 (PDT) Received: from localhost ([::1]:44862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv56r-0001rS-AT for importer2@patchew.org; Sun, 20 Jun 2021 17:36:05 -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) 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) 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-Google-Smtp-Source: ABdhPJxdWE4FtlvtgTBoNqbdJH434zuEiY8i7wntzExivfghkhpp+lZTrLDJWtvrItlyoZocodnJhw== 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" 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(-) 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, DisasContex= t *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 =3D DISAS_NORETURN; return 2; } =20 @@ -2901,7 +2902,7 @@ static int dec_rfe_etc(CPUCRISState *env, DisasContex= t *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 =3D DISAS_UPDATE; + dc->base.is_jmp =3D DISAS_NORETURN; break; default: printf("op2=3D%x\n", dc->op2); @@ -3189,7 +3190,7 @@ void gen_intermediate_code(CPUState *cs, TranslationB= lock *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 =3D DISAS_UPDATE; + dc->base.is_jmp =3D 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=3D%x\n", dc->pc); t_gen_raise_exception(EXCP_BREAK); + dc->base.is_jmp =3D DISAS_NORETURN; } =20 static void gen_store_v10_conditional(DisasContext *dc, TCGv addr, TCGv va= l, @@ -1169,7 +1170,7 @@ static unsigned int dec10_ind(CPUCRISState *env, Disa= sContext *dc) t_gen_mov_env_TN(trap_vector, c); tcg_temp_free(c); t_gen_raise_exception(EXCP_BREAK); - dc->base.is_jmp =3D DISAS_UPDATE; + dc->base.is_jmp =3D DISAS_NORETURN; return insn_len; } LOG_DIS("%d: jump.%d %d r%d r%d\n", __LINE__, size, --=20 2.25.1 From nobody Wed May 8 22:22:39 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1624224971; cv=none; d=zohomail.com; s=zohoarc; b=G0win5RXYuEglr1Y8rd9854P/rIWwYu4Ow2pE8i/lJy2TRz3mwgfG6dVLvW3QNWYShHH4u7fYTiqcCKH/0NmHTcA23I6hEpdW5+FdFrG+gnE1wNWu4Cdbjio7I0SPmWautap1cMBmeItswC7hSkytPcfb4lCD65a5fJetQDtMiU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624224971; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=h38+yrqYLEF8Qg/+ccdM2Tcru/YIUG4nfpAARgqgxf4=; b=PI0bUFJA3vQ+6xCtL0hH3ImycxLWq37NYCJczR7MLq0g2TOC0M3H21MA1xfxMjKJy7qk8EbFjEJ6YfI6i1z8ppIwwmuGrasda5JlzkhpXacM16c55rz60p+4s/uCyY/wJmSTPSOrT10Kwfmf4Q0iAibYvWkXFphS1Mfp5ONIl5g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624224971173404.2889396884025; Sun, 20 Jun 2021 14:36:11 -0700 (PDT) Received: from localhost ([::1]:45264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv56w-00027q-4v for importer2@patchew.org; Sun, 20 Jun 2021 17:36:10 -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) 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) 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-Google-Smtp-Source: ABdhPJxkGjVNPZ8YxKsTOmsF7nnAA7jBduRYFGe5QrP7zzDugm/gaPfSmWnVHbI059Ewv4YGJ3zIPQ== 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" This value is unused. Signed-off-by: Richard Henderson --- target/cris/translate.c | 2 -- 1 file changed, 2 deletions(-) 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 =20 /* Used by the decoder. */ #define EXTRACT_FIELD(src, start, end) \ @@ -3310,7 +3309,6 @@ void gen_intermediate_code(CPUState *cs, TranslationB= lock *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; --=20 2.25.1 From nobody Wed May 8 22:22:39 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1624225157; cv=none; d=zohomail.com; s=zohoarc; b=iDBpO8qB05xobCGc1d5M/ORcxxxu+AoMmE1GrjJ8nPeAiJm7K1TGrWz9EXCO8LJnXRDwtoPnguvk9u4/eCWUPw7XHghPxLDL+9GZ45pasZ7X3qpzxreE9AhZOX12qPhphA1GCjxLsfj6YEBaf0y1BPDKAwf2Tv60UY/lgIZGVRI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624225157; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7dML7HVO3SIUvu7+ZiyMAW2r1aYzDyVht2iysbBCWL0=; b=EUasVhhi948k6uLvZlQ7KOyUOfeQKpCqar38j0yXbEk5AGkZN7wQV7E9XWhbPOlhjnJAyYmha8k1EdsP0tqMk2cf2q4JlLO5Tp8SMPanZRdwBhy9ggvUTTajPKRDfq1Z5QZand7sNCbqSeSAaeV8EourwK/JNlo+w6YszijgN9c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624225157430842.431985365325; Sun, 20 Jun 2021 14:39:17 -0700 (PDT) Received: from localhost ([::1]:56820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv59w-0001OS-FI for importer2@patchew.org; Sun, 20 Jun 2021 17:39:16 -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) 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) 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-Google-Smtp-Source: ABdhPJwjI8YtgqETXdkh+1s+K54pjYv4zfwGo9XWgEh4hkyakXzLzoldXM9m+IsjGQg6ogGZ0NfWPw== 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" 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(-) 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); } =20 -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) =3D=3D (dest & TARGET_PA= GE_MASK) || - (dc->ppc & TARGET_PAGE_MASK) =3D=3D (dest & TARGET_PAGE_MASK); -#else - return true; -#endif + return ((dest ^ dc->base.pc_first) & TARGET_PAGE_MASK) =3D=3D 0; } =20 static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest) --=20 2.25.1 From nobody Wed May 8 22:22:39 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1624224889; cv=none; d=zohomail.com; s=zohoarc; b=kZYYnrXvcBPPviIpf2xBSdPOy6RpycTAnzxg8cPaaHI8ZA1cE9/HJCOnRuJrG8dcrBxXk6YI4BBAMkYM1VKBDcL39LSolu9uJGlq9xJOlT5t5xMXQJs/djivT1JNDD1nzImu6cebnbUizOHcXVnDRQxNUaDvfMBAQlMLskyw8Lk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624224889; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BdnLl8xmYlB1beezapSg6HL7QcSYtDLtwjs+7yT5xBc=; b=dr7ExCCmoMqksevFwz1pSfyL6kfQQlb6xVpVMVqvW7ftzor+nFeZeo4D07AAcyiGmdQfxhiJL8SQpEW/mo2ukG6ZR4YIzk/tgNwox4ZLw+1pnKMit/dsnrGnUyQ/hIqQhAec/Xrw+CWOEAB8InNOtUUOpbHnZGtJX/KZlkOW8TY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162422488974343.136718145124064; Sun, 20 Jun 2021 14:34:49 -0700 (PDT) Received: from localhost ([::1]:37208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv55c-0005G0-Li for importer2@patchew.org; Sun, 20 Jun 2021 17:34:48 -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) 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) 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-Google-Smtp-Source: ABdhPJzxTh5s7OnWTXfV2k0uRWGMkPUQLUK3cHQ1qC7IehkbougyG+CbXCF+4e1OQezamoIBlz9S2g== 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- target/cris/translate.c | 313 ++++++++++++++++++++++------------------ 1 file changed, 170 insertions(+), 143 deletions(-) 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 *e= nv, DisasContext *dc) * */ =20 -/* generate intermediate code for basic block 'tb'. */ -void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_ins= ns) +static void cris_tr_init_disas_context(DisasContextBase *dcbase, CPUState = *cs) { + DisasContext *dc =3D container_of(dcbase, DisasContext, base); CPUCRISState *env =3D cs->env_ptr; + uint32_t tb_flags =3D dc->base.tb->flags; uint32_t pc_start; - unsigned int insn_len; - struct DisasContext ctx; - struct DisasContext *dc =3D &ctx; - uint32_t page_start; - target_ulong npc; - int num_insns; =20 if (env->pregs[PR_VR] =3D=3D 32) { dc->decoder =3D crisv32_decoder; @@ -3134,150 +3129,170 @@ void gen_intermediate_code(CPUState *cs, Translat= ionBlock *tb, int max_insns) dc->clear_locked_irq =3D 1; } =20 - /* 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 =3D tb->pc & ~1; - - dc->base.tb =3D tb; + pc_start =3D dc->base.pc_first & ~1; dc->base.pc_first =3D pc_start; dc->base.pc_next =3D pc_start; - dc->base.is_jmp =3D DISAS_NEXT; - dc->base.singlestep_enabled =3D cs->singlestep_enabled; =20 dc->cpu =3D env_archcpu(env); dc->ppc =3D pc_start; dc->pc =3D pc_start; dc->flags_uptodate =3D 1; dc->flagx_known =3D 1; - dc->flags_x =3D tb->flags & X_FLAG; + dc->flags_x =3D tb_flags & X_FLAG; dc->cc_x_uptodate =3D 0; dc->cc_mask =3D 0; dc->update_cc =3D 0; dc->clear_prefix =3D 0; + dc->cpustate_changed =3D 0; =20 cris_update_cc_op(dc, CC_OP_FLAGS, 4); dc->cc_size_uptodate =3D -1; =20 /* Decode TB flags. */ - dc->tb_flags =3D tb->flags & (S_FLAG | P_FLAG | U_FLAG \ - | X_FLAG | PFIX_FLAG); - dc->delayed_branch =3D !!(tb->flags & 7); + dc->tb_flags =3D tb_flags & (S_FLAG | P_FLAG | U_FLAG | X_FLAG | PFIX_= FLAG); + dc->delayed_branch =3D !!(tb_flags & 7); if (dc->delayed_branch) { dc->jmp =3D JMP_INDIRECT; } else { dc->jmp =3D JMP_NOJMP; } +} =20 - dc->cpustate_changed =3D 0; +static void cris_tr_tb_start(DisasContextBase *db, CPUState *cpu) +{ +} =20 - page_start =3D pc_start & TARGET_PAGE_MASK; - num_insns =3D 0; +static void cris_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu) +{ + DisasContext *dc =3D container_of(dcbase, DisasContext, base); =20 - gen_tb_start(tb); - do { - tcg_gen_insn_start(dc->delayed_branch =3D=3D 1 - ? dc->ppc | 1 : dc->pc); - num_insns++; + tcg_gen_insn_start(dc->delayed_branch =3D=3D 1 ? dc->ppc | 1 : dc->pc); +} =20 - if (unlikely(cpu_breakpoint_test(cs, dc->pc, BP_ANY))) { +static bool cris_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *c= pu, + const CPUBreakpoint *bp) +{ + DisasContext *dc =3D 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 =3D 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 +=3D 2; + return true; +} + +static void cris_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) +{ + DisasContext *dc =3D container_of(dcbase, DisasContext, base); + CPUCRISState *env =3D cs->env_ptr; + unsigned int insn_len; + + /* Pretty disas. */ + LOG_DIS("%8.8x:\t", dc->pc); + + dc->clear_x =3D 1; + + insn_len =3D dc->decoder(env, dc); + dc->ppc =3D dc->pc; + dc->pc +=3D insn_len; + dc->base.pc_next +=3D 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 =3D=3D 0) { + if (dc->base.tb->flags & 7) { + t_gen_movi_env_TN(dslot, 0); + } + + if (dc->cpustate_changed + || !dc->flagx_known + || (dc->flags_x !=3D (dc->base.tb->flags & X_FLAG))) { + cris_store_direct_jmp(dc); + } + + if (dc->clear_locked_irq) { + dc->clear_locked_irq =3D 0; + t_gen_movi_env_TN(locked_irq, 0); + } + + if (dc->jmp =3D=3D JMP_DIRECT_CC) { + TCGLabel *l1 =3D 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 =3D 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 +=3D 2; - break; + dc->jmp =3D JMP_NOJMP; + } else if (dc->jmp =3D=3D JMP_DIRECT) { + cris_evaluate_flags(dc); + gen_goto_tb(dc, 0, dc->jmp_pc); + dc->base.is_jmp =3D DISAS_NORETURN; + dc->jmp =3D JMP_NOJMP; + } else { + TCGv c =3D tcg_const_tl(dc->pc); + t_gen_cc_jmp(env_btarget, c); + tcg_temp_free(c); + dc->base.is_jmp =3D DISAS_JUMP; } + } =20 - /* 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 =3D=3D DISAS_NEXT + && (dc->cpustate_changed + || !dc->flagx_known + || (dc->flags_x !=3D (dc->base.tb->flags & X_FLAG)))) { + dc->base.is_jmp =3D DISAS_UPDATE; + tcg_gen_movi_tl(env_pc, dc->pc); + } =20 - if (num_insns =3D=3D max_insns && (tb_cflags(tb) & CF_LAST_IO)) { - gen_io_start(); - } - dc->clear_x =3D 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 =3D=3D DISAS_NEXT + && ((dc->pc ^ dc->base.pc_first) & TARGET_PAGE_MASK) !=3D 0) { + dc->base.is_jmp =3D DISAS_TOO_MANY; + } +} =20 - insn_len =3D dc->decoder(env, dc); - dc->ppc =3D dc->pc; - dc->pc +=3D insn_len; - if (dc->clear_x) { - cris_clear_x_flag(dc); - } +static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) +{ + DisasContext *dc =3D container_of(dcbase, DisasContext, base); + DisasJumpType is_jmp =3D dc->base.is_jmp; + target_ulong npc =3D dc->pc; =20 - /* 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 =3D=3D 0) { - if (tb->flags & 7) { - t_gen_movi_env_TN(dslot, 0); - } - if (dc->cpustate_changed || !dc->flagx_known - || (dc->flags_x !=3D (tb->flags & X_FLAG))) { - cris_store_direct_jmp(dc); - } - - if (dc->clear_locked_irq) { - dc->clear_locked_irq =3D 0; - t_gen_movi_env_TN(locked_irq, 0); - } - - if (dc->jmp =3D=3D JMP_DIRECT_CC) { - TCGLabel *l1 =3D 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 =3D DISAS_NORETURN; - dc->jmp =3D JMP_NOJMP; - } else if (dc->jmp =3D=3D JMP_DIRECT) { - cris_evaluate_flags(dc); - gen_goto_tb(dc, 0, dc->jmp_pc); - dc->base.is_jmp =3D DISAS_NORETURN; - dc->jmp =3D JMP_NOJMP; - } else { - TCGv c =3D tcg_const_tl(dc->pc); - t_gen_cc_jmp(env_btarget, c); - tcg_temp_free(c); - dc->base.is_jmp =3D 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 =3D=3D DISAS_NORETURN) { + /* If we have a broken branch+delayslot sequence, it's too late. */ + assert(dc->delayed_branch !=3D 1); + return; + } =20 if (dc->clear_locked_irq) { t_gen_movi_env_TN(locked_irq, 0); } =20 - npc =3D dc->pc; - - /* Force an update if the per-tb cpu state has changed. */ - if (dc->base.is_jmp =3D=3D DISAS_NEXT - && (dc->cpustate_changed || !dc->flagx_known - || (dc->flags_x !=3D (tb->flags & X_FLAG)))) { - dc->base.is_jmp =3D DISAS_UPDATE; - tcg_gen_movi_tl(env_pc, npc); - } /* Broken branch+delayslot sequence. */ if (dc->delayed_branch =3D=3D 1) { /* Set env->dslot to the size of the branch insn. */ @@ -3287,45 +3302,57 @@ void gen_intermediate_code(CPUState *cs, Translatio= nBlock *tb, int max_insns) =20 cris_evaluate_flags(dc); =20 - if (unlikely(cs->singlestep_enabled)) { - if (dc->base.is_jmp =3D=3D 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); =20 - tb->size =3D dc->pc - pc_start; - tb->icount =3D 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 =3D 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 *cp= u) +{ + 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 =3D { + .init_disas_context =3D cris_tr_init_disas_context, + .tb_start =3D cris_tr_tb_start, + .insn_start =3D cris_tr_insn_start, + .breakpoint_check =3D cris_tr_breakpoint_check, + .translate_insn =3D cris_tr_translate_insn, + .tb_stop =3D cris_tr_tb_stop, + .disas_log =3D cris_tr_disas_log, +}; + +void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_ins= ns) +{ + DisasContext dc; + translator_loop(&cris_tr_ops, &dc.base, cs, tb, max_insns); } =20 void cris_cpu_dump_state(CPUState *cs, FILE *f, int flags) --=20 2.25.1 From nobody Wed May 8 22:22:39 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1624224885; cv=none; d=zohomail.com; s=zohoarc; b=KHup4R4JJkKHAkSsRSJBLuir47kG//U9xEO+F96dtUr87betD1royzys9V6Tvmte+YNRkfu0JwVZWsPZwtCFuxNJg/IV+7XOv3Ky54hSqi16BM9ckk0TEjsHRXZ5grAZ5twNwBWoX9KwEuDMUj3yTZJrCAGriuP4/6I8D7i8n3c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624224885; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oqu6i/kvNHrYtHemRicmatPUkUSmc3yTCi7Ugc/TW74=; b=QxNFS04eQxHNHWAmbQm/1o4aB0L6lQeQ51gYy9r4V/T3G1L+RpQ3K3D1i1zgUhtDtVk1svhbFOKZWK79RL56+YsNoZtUiQ6kMpFSeJOURZYuJEm5g+E/LXW5D9zrjP083SWXV4UkrNW4jyFXfdNZgpRWHIrKnwwftelNhtLB2Z8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624224885433826.2400433701312; Sun, 20 Jun 2021 14:34:45 -0700 (PDT) Received: from localhost ([::1]:36886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv55Y-00052j-Co for importer2@patchew.org; Sun, 20 Jun 2021 17:34:44 -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) 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) 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-Google-Smtp-Source: ABdhPJxc7mJDm/wz2K7m6Jnt+N1zjF3QaPNG33V8pCqhF3cE4wNGsz+GuzyMcdY/8pRvhM6IcctozA== X-Received: by 2002:a17:90b:187:: with SMTP id t7mr6849684pjs.67.1624224773860; 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- target/cris/helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) --=20 2.25.1 From nobody Wed May 8 22:22:39 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1624225280; cv=none; d=zohomail.com; s=zohoarc; b=ndXrXlLHwzm0ObKtr2yRDvI4Ip3Jof7J3JVy0rWt2me26Syky0VQL+FsySqLy740dqk+btI2fi8i7XWPgIXXgPvaV9KftnGBvwKBsDiCmtsk2TT1v9PT1c95WZ8bYdfU8xMJ/KnyJEBPcewvIcPrptQS23LRGjXYeFwsxHusU8E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624225280; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=v4kZDh8uVsOZEauYx+O7aUBWOVxEx002X2bRwf1pVz0=; b=b/061SvqMfy5HrWmM4fWvASgiDsTdIiJQQbA9E7Zh2QV3eK7nMV2lQYtjN0rT5cMk/ifZfBjWPN6VNDE4N8bhhnnUqdYQ/AFceXKvCh2uIG8jF/+ZZ3hHRDlj20Aq22xHwKosJnDQdMmokPYOglFpGmKTptwmPZ0tziGWhPcdbg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624225280696894.857226806232; Sun, 20 Jun 2021 14:41:20 -0700 (PDT) Received: from localhost ([::1]:59396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv5Bv-0003DY-Cx for importer2@patchew.org; Sun, 20 Jun 2021 17:41:19 -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) 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) 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-Google-Smtp-Source: ABdhPJzJ65lCqomzyl6He88ZpE6x7SWJy7FQ+Ct2Y94IMZZmdf2CZw5JQKBIskwLQObWSc3UKRV38A== 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/cris/translate.c | 19 ++++++++++--------- target/cris/translate_v10.c.inc | 6 +++--- 2 files changed, 13 insertions(+), 12 deletions(-) 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 *fil= e, int line) cpu_abort(CPU(dc->cpu), "%s:%d pc=3D%x\n", file, line, dc->pc); } =20 -static const char *regnames_v32[] =3D +static const char * const regnames_v32[] =3D { "$r0", "$r1", "$r2", "$r3", "$r4", "$r5", "$r6", "$r7", "$r8", "$r9", "$r10", "$r11", "$r12", "$r13", "$sp", "$acr", }; -static const char *pregnames_v32[] =3D + +static const char * const pregnames_v32[] =3D { "$bz", "$vr", "$pid", "$srs", "$wz", "$exs", "$eda", "$mof", @@ -153,7 +154,7 @@ static const char *pregnames_v32[] =3D }; =20 /* We need this table to handle preg-moves with implicit width. */ -static int preg_sizes[] =3D { +static const int preg_sizes[] =3D { 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[] =3D { @@ -1279,7 +1280,7 @@ static int dec_prep_alu_m(CPUCRISState *env, DisasCon= text *dc, #if DISAS_CRIS static const char *cc_name(int cc) { - static const char *cc_names[16] =3D { + static const char * const cc_names[16] =3D { "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; } =20 -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 f= lags) { CRISCPU *cpu =3D CRIS_CPU(cs); CPUCRISState *env =3D &cpu->env; - const char **regnames; - const char **pregnames; + const char * const *regnames; + const char * const *pregnames; int i; =20 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" =20 -static const char *regnames_v10[] =3D +static const char * const regnames_v10[] =3D { "$r0", "$r1", "$r2", "$r3", "$r4", "$r5", "$r6", "$r7", @@ -29,7 +29,7 @@ static const char *regnames_v10[] =3D "$r12", "$r13", "$sp", "$pc", }; =20 -static const char *pregnames_v10[] =3D +static const char * const pregnames_v10[] =3D { "$bz", "$vr", "$p2", "$p3", "$wz", "$ccr", "$p6-prefix", "$mof", @@ -38,7 +38,7 @@ static const char *pregnames_v10[] =3D }; =20 /* We need this table to handle preg-moves with implicit width. */ -static int preg_sizes_v10[] =3D { +static const int preg_sizes_v10[] =3D { 1, /* bz. */ 1, /* vr. */ 1, /* pid. */ --=20 2.25.1 From nobody Wed May 8 22:22:39 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1624225065; cv=none; d=zohomail.com; s=zohoarc; b=KvJ6WSU9KoLUD63m6248QWO+UirCqFTxT1YYHhGhSGAoZE1gWFQuTYXffI7MTrWcHjmdowdUQ+FCsOL36Q9f5sRZ4GcdNjMMsff1/LTZLTzrEwLyo1hk9Bp3C6b23tv/N0wMNvvhenKVsuppnszVtuevpp9vfl1tDolW3Xr+T2o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624225065; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vWYGihdcluFmv+BkOCZIBqSaEk3uezdQ5EyW3tAoFv0=; b=fRXyT48TC2BmD7I2O9aXrldU1IWlOgpCPgcodacGCInBFp7OMq+DgOWQ9ySyfoAvyhDyQEu5JvJdGqDfYhNd/phQONi39bUH/rBnzqT/exuNo4F1k61agRNtXyfIpUT0pGcYFL0vmmic6M3PRyXIlib0ODtHUxvdPcL0CP8g/sI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624225065975827.140186026158; Sun, 20 Jun 2021 14:37:45 -0700 (PDT) Received: from localhost ([::1]:53090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv58T-0007KF-0h for importer2@patchew.org; Sun, 20 Jun 2021 17:37:45 -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) 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) 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-Google-Smtp-Source: ABdhPJyn7H9YyjEwbTbgNdhffrmRs0GMZQ27vlHWWxx/83upV9rTNZMakw64jEKomHwv9KRMf7Ed4g== X-Received: by 2002:a17:90b:197:: with SMTP id t23mr23094377pjs.61.1624224774851; 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" 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(-) 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 */ =20 /* 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 =3D=3D 0) { - if (dc->base.tb->flags & 7) { - t_gen_movi_env_TN(dslot, 0); - } - - if (dc->cpustate_changed - || !dc->flagx_known - || (dc->flags_x !=3D (dc->base.tb->flags & X_FLAG))) { - cris_store_direct_jmp(dc); - } - - if (dc->clear_locked_irq) { - dc->clear_locked_irq =3D 0; - t_gen_movi_env_TN(locked_irq, 0); - } - - if (dc->jmp =3D=3D JMP_DIRECT_CC) { - TCGLabel *l1 =3D 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 =3D DISAS_NORETURN; - dc->jmp =3D JMP_NOJMP; - } else if (dc->jmp =3D=3D JMP_DIRECT) { - cris_evaluate_flags(dc); - gen_goto_tb(dc, 0, dc->jmp_pc); - dc->base.is_jmp =3D DISAS_NORETURN; - dc->jmp =3D JMP_NOJMP; - } else { - TCGv c =3D tcg_const_tl(dc->pc); - t_gen_cc_jmp(env_btarget, c); - tcg_temp_free(c); - dc->base.is_jmp =3D DISAS_JUMP; - } + dc->base.is_jmp =3D DISAS_DBRANCH; + return; } =20 /* 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) =20 cris_evaluate_flags(dc); =20 + /* Evaluate delayed branch destination and fold to another is_jmp case= . */ + if (is_jmp =3D=3D DISAS_DBRANCH) { + if (dc->base.tb->flags & 7) { + t_gen_movi_env_TN(dslot, 0); + } + + switch (dc->jmp) { + case JMP_DIRECT: + npc =3D dc->jmp_pc; + is_jmp =3D 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 =3D 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 =3D 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 =3D DISAS_JUMP; + break; + + default: + g_assert_not_reached(); + } + } + if (unlikely(dc->base.singlestep_enabled)) { switch (is_jmp) { case DISAS_TOO_MANY: --=20 2.25.1 From nobody Wed May 8 22:22:39 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1624224971; cv=none; d=zohomail.com; s=zohoarc; b=Zv/g7E7c9gpf95cmabMGT4MyNBTF0UR+gLllMOX+tFotXqRtu2u3SzZPIwMDYwifVcwxn9UuNi6AnD83n5LVLYYQ8SfbgheJTFxlS2g5Bjk/xozpV9IGfCZqYU8MAlCAYNa643/BNMucSkOLinHvXQdML3rxcXHS5UJ2Hf8+Zf0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624224971; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hlWx/fey2FgjFaKp9Mso1gmF59ZDXY3XC/bRgVAOonA=; b=FHA9PhYpgPPL6Np2FB9jsfL7FWlPiZ122DpFLfydY4vYj+nQNDmABSjcI/ufsKn5xnBR33cK6QMDbn+A5Ci8jBTOrIlpsKcHvJrSu3YbppUODRInr0jnD1f4hxLT0h78PjT9FamOdyGXIXI4F9O4TWCyWlBnxO4ftfY1pKwdI0c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624224971726957.144136739745; Sun, 20 Jun 2021 14:36:11 -0700 (PDT) Received: from localhost ([::1]:45382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv56w-0002D7-MP for importer2@patchew.org; Sun, 20 Jun 2021 17:36:10 -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) 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) 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-Google-Smtp-Source: ABdhPJyUwuItaLAuJ3CCbn1982u0r9Ae4+VqfY72HG/UR/hvnES9yn3ECVLccEnYQVRiEt50lufIJw== 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" 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(-) 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(); } } =20 @@ -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); --=20 2.25.1 From nobody Wed May 8 22:22:39 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1624224977; cv=none; d=zohomail.com; s=zohoarc; b=fYIZNtdjb/wsF61RpcHNOB9nKrRupxIK1qe2rZ37Mabt8cMZ4fHTSBKwRXsp4G62+Q8XMi3OyvrklpsIvAXx5Lve0lhsTB3bE/wuNJWR7HOGACg6XV4S9obTSw1Uju5R5+EeXIBXdbwbM9Qq43RSSlzsBe8Gy3ous7gWMrqSYIM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624224977; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EMPtI6EgvV/WiXI17jvBtKPkWXlx76mMDamBhdAr7N4=; b=XJzDUukus5AdYYB5pH5/idQFu5iUirrzBKXiM/aq8MUwybCjr9GKohWTgTmXVhPid6YKLdE3FKPgmvv4g4OWV+QLNNWxNlHjjDczPP0uyhXHIe405JGv2e5VV11z55L25s9wcSRFdkrzEJDNmcGVfJNBMVXR7QMysfFDNRkctec= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1624224977250594.0924945452095; Sun, 20 Jun 2021 14:36:17 -0700 (PDT) Received: from localhost ([::1]:45926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lv572-0002Yt-5o for importer2@patchew.org; Sun, 20 Jun 2021 17:36:16 -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) 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) 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-Google-Smtp-Source: ABdhPJxnYgqASLY1xR59KgnAgxTuseNkqF1Fe9RbDKVZ1sSFeb7zynhmN/N8nFkP8WuzA6NGupwc1Q== X-Received: by 2002:a17:90a:fb51:: with SMTP id iq17mr23259567pjb.26.1624224776081; Sun, 20 Jun 2021 14:32:56 -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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" 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(-) 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); } =20 -static void t_gen_cc_jmp(TCGv pc_true, TCGv pc_false) -{ - TCGLabel *l1 =3D 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) =3D=3D 0; @@ -3302,8 +3291,17 @@ static void cris_tr_tb_stop(DisasContextBase *dcbase= , CPUState *cpu) /* fall through */ =20 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 =3D 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; =20 default: --=20 2.25.1