From nobody Wed May 1 16:04:32 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=1624163022; cv=none; d=zohomail.com; s=zohoarc; b=mNVQlzQbkARiVq6EkVnilDWacvCDLgCK94aQZnX77RRN8DPEiToCQ8/DE640peorS6v1BQBLbAxx9NPOZUAycZB6uiHuXCs1isqH4JagJ1G2pkWE1M0eNUMwfhaveXlLq6+JP5LMecoxoNJoc83BJWIeMO3QSM7/GG/Sde+ku/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624163022; 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=V5Cf4Ua74q/7qYa0ugyXH5+qxBnLpHym+PksQffUmomW+IVqGH0N+EkHNXefrGTtdHsTOJ4tg+/BL0AVzDbiEBRtnVciBcgq0ZMw+CwIsAHEA2tQmav8piCtufjU9/PNvQxenu7pH22VCiSKoHhNlZnAEQaYSMj9PRsyjQlmmVs= 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 1624163022653114.14543773230218; Sat, 19 Jun 2021 21:23:42 -0700 (PDT) Received: from localhost ([::1]:56562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1luozl-00081V-I6 for importer2@patchew.org; Sun, 20 Jun 2021 00:23:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoxv-0005JH-R1 for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:49 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:45609) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxt-0007wh-KH for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:47 -0400 Received: by mail-pj1-x102d.google.com with SMTP id z3-20020a17090a3983b029016bc232e40bso8201946pjb.4 for ; Sat, 19 Jun 2021 21:21:45 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IZqsDG39a6RHRH2b5Sr2GJhmurivUBKrieIfGWTmK84=; b=pVCT87TE9S4M9yQd73oboYgxnps1F6q+x7Zg4HtC1OhXDBoFf0eZy3lg1L8n/+JiS+ yEtQs+JbakYXRSfwoPoLscTcxJxGRa0y22qqskTnJioPeHq2HiRp+dAm+5oOAupgu+Sc Z8ZxAG3L0Dp0KwPZdmrMWT70neyz6Uqhg0Lnvgm15vOqajPwDjSkImYrpgPypAYswiOs JaBQ/GnDlCWiFtr4Iel76Ftw3IcfuX/woUxqvSMqRxUW+T/oTKQrRk51hKbM+bvgMGdO c2GdhTDnm+v5fXI7rJrj971Oa6lBnLU5JdIr2b9bPVkGkoaGYosgR8DSAz86N3dhrLW/ Sl5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IZqsDG39a6RHRH2b5Sr2GJhmurivUBKrieIfGWTmK84=; b=RuuMl2kuk7caJUP3osoGJxbNhKSQ7diCPXyvOdlmLzatBXXr59fjSdIbSGRmwggLo1 pBaniOCGsLVp9jJFIOWENa2OUxstKQCx2qENDfyQXucUNOwHt3iD6h4nB+iIS4OMvhhQ brl39z74898gy5s3M8f5w0T4zkyEp4Nh3+fKnumeku3vO4sYWkwCIJAkYXeu/wlKwzyJ 7SMR9Q58w33VJ3EIFwvMxT6noEovshHqVhhNtMDeE5q02PTaO2+Xa+maxXGYMGf9OTm+ 3EEeKU81OurfviMhXvVoXAMEC8XhvGiquRtS3GtlG1hNkRkzm/pan0pD/JNJncS8nByL pN7A== X-Gm-Message-State: AOAM531te2CWgJy3kidgTcxmKyI05kA2IoYzcuOjy0I2K75VcfbaWu4Q DGnn0LTlngYunyaFK7nfukfFA4XQVoS/6w== X-Google-Smtp-Source: ABdhPJzxxZKOwsPPbjpNLPfZ9npdLQk5AbnTWWPtSuXBpEVIpZ8gmdPVoB9aa3uM1EU+2oQowaWfuA== X-Received: by 2002:a17:90a:9f81:: with SMTP id o1mr29578610pjp.96.1624162904230; Sat, 19 Jun 2021 21:21:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 1/9] target/cris: Add DisasContextBase to DisasContext Date: Sat, 19 Jun 2021 21:21:33 -0700 Message-Id: <20210620042141.1235541-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+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 1 16:04:32 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=1624163110; cv=none; d=zohomail.com; s=zohoarc; b=annJfUQOKoGFfNDXGas8s1bGlZIY3NSkzWa726NVonbbvv6JnTTJWdF+QAkXlzeoBMxIC45nO25olK84lcmMWfVQvauV/1WNopUiNj5dpuc6Tgf/o283F0VAuw6peOPSyKyBzqyFD6cWEnoddJlp5VxluNKL9YYS8v5oB7xX3Gc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624163110; 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=WKkp/TngSwrwZJfpAI4FWCnI8/z6HAmpSP5cAJflXsv0k9AJafqK4cF38KE/nBiox3avi/1+zpx6Gb0M2Ys0pET+M6aOr2BPDyaghYb3gQNYzL8SkCsMJqUSnJ5ijU8F85B4xjaLRa7l0o0f16NCVI/t7iiTJMJ7EX+D+sfprhA= 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 1624163110971394.45886082734023; Sat, 19 Jun 2021 21:25:10 -0700 (PDT) Received: from localhost ([::1]:35830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lup1B-0004Zi-RB for importer2@patchew.org; Sun, 20 Jun 2021 00:25:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41416) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoxw-0005JI-RC for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:50 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:46943) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxu-0007x6-2d for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:48 -0400 Received: by mail-pf1-x431.google.com with SMTP id x16so10978592pfa.13 for ; Sat, 19 Jun 2021 21:21:45 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ktgo4xWUwEPLcu/uB4HSWazqzoEfJMOHsnknfFL5vLg=; b=c2brptxgdv6EOmz8vTGY5YLkwDzhXqq3s79sfvVO3gYB8KuWIJaOo5RhAffFnTmaEp sr4I6FWTlFyOhVmvkHkto7GP30Ri+hAC1vX29GI3xN76QHfbVCLUyJhYO6OarhcOUZWY 0DJgWdtifQNqyYdPdZ7Ry/KjLwaxY0H7jMa+Z6iO4XAhawlbaMQ/XxP+kXMBeKE8xKAU dNESrARWgw6uSLwtZ++A4mj0JSNxLNHcytZhcSIjVwZnYpQgGGDl0tWP804i7UsQpqf5 cQK4/UOu9bh2uG8QBlwQAs8K/eBUH6sZV0qGLndRpyAufhtz5FgdL95Es/2lE2ZNnLMd Mcsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ktgo4xWUwEPLcu/uB4HSWazqzoEfJMOHsnknfFL5vLg=; b=Z6crMwvlGUY69ZE5svjlxTm5mjqIkWB4/3ksZps7vrdnSEi/0oeLFjRpDpgZsLCdqs nYABH0iQiYChozV8HerfEzXiR6vZURoRoTZQJbdn/kvssgWSB8ZewhvakbQQpNxVcBXJ HKzyNKK/3K16HH3mswgrg9CrpfgzpS6hGCevuR7WnB4z9KigY5/GAHgAvfmWLTg8LwoK tZ7cdRKFGp2jUroR5Ul56uay+EhkBOFJsFwQQUdbOr9EguMZnrmjunwf5lS06xcPpsXS dOSCCWkgRD9XXE390UdtI+lh2KvRCgr8w+q85W2V8hjQvynm1d9Hit/QCFmNRMvmCYzD P0+g== X-Gm-Message-State: AOAM532XWiy0obLJnxlnxaxaMeheTPuhHqBS/WSyyLNilYEja1y+U5Rw md7yOfYTQUA4BQgBzN1VJrcCzK4eBb+olA== X-Google-Smtp-Source: ABdhPJymqwn3NljCdCbOQeyyr0ZTI3oZyygLS3N4VQg4kvqELBLfd0eJyTJvGy67/hPnLAz4Fxj2/Q== X-Received: by 2002:a65:6a52:: with SMTP id o18mr17601325pgu.177.1624162904719; Sat, 19 Jun 2021 21:21:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 2/9] target/cris: Replace DISAS_TB_JUMP with DISAS_NORETURN Date: Sat, 19 Jun 2021 21:21:34 -0700 Message-Id: <20210620042141.1235541-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+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 1 16:04:32 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=1624163112; cv=none; d=zohomail.com; s=zohoarc; b=hSWuD4XPXGhpSP/wD3kzfBD2RcWCbr+FJr90qB79zW5sExI25Z7g2p6vqx+Xs960bRtUdizX24nF32nK53g+W5MdbaLY0MMSD+KtVq7W2Oo3wQqPiXOJtysM+9rRNmsCXFS4+rcxaLSnV+hu6Il35aTjamUW8pu3wpTQh4SWNeo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624163112; 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=E8AFAtC2Tgq34DotfxKtlSi/gvb7ePXyLoe2MxV+rqEpP/wGCla7cVrrUyjt+R+gODKiLkWOg6ijk35CZ1rnZftpPfYsbiUolVk33P+zZ++qNwRJIXZRqDU2WVQI1QJ9r3Ebu0Zm/km0fOA/EM82/UYuP4TyRWuNgBBFFvIo5So= 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 1624163112332506.16817510518956; Sat, 19 Jun 2021 21:25:12 -0700 (PDT) Received: from localhost ([::1]:35832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lup1D-0004Zl-95 for importer2@patchew.org; Sun, 20 Jun 2021 00:25:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoxw-0005JJ-Vt for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:50 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:39439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxu-0007xg-OS for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:48 -0400 Received: by mail-pg1-x532.google.com with SMTP id w31so11273019pga.6 for ; Sat, 19 Jun 2021 21:21:46 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4qZYFgo5owfVk6zq1cDCv8vj7PKVInUCjUJb6z1w1uE=; b=MeGcgIkUojPaUt2PUP5BJce9SYH/8P7z2BAImjnfAIUiIUsUJlhwNtP0ArJPb9excy 3w+TfpC6f2G3xF6k9f/UmCylTRqHh4ZAH1BlcW/iGdNIp/cTwXKzkNLSRUkyoduzXJud Xg5CmTrdJ3MkqPGs4ejxjXUTl94c9HBKNktqvZX4/rEaQB7tfEFRO0XJL41lDCHJ+IB5 gONDUZE0UetTC0RkHBHRv4FpGh3xl5Q176UzSl0/ejU8fitKbOZ2+PgtI4kR1tdindHR J8TVfni/iFiT/svg/K8rKIj9HnlixSTRj5nn3imR++oPhhR0GvHf3nxF317incriEdPc LdeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4qZYFgo5owfVk6zq1cDCv8vj7PKVInUCjUJb6z1w1uE=; b=mPyOJ2Sau+bhVCsbfblksT2wAw1GyqtMu9bi5UpAAQqOvlYPmGa0E4zJl0YqtslHiB EQcOOLxKUUWtfBii/USoA6ChTy3p2DsPnoorGOGUC4gFbfQ/4m72gZSs5UxC4Vp3o3zY fxRxz0fvHmKduD0bgERdbqLuexw3fX65nT2nGhVhaecSbr2CMMMeRhhmclC5ZMvza1DJ RIzdx9CSlFBttaOco0eG/1CmH72A+AUSjNg5uvSkTHqfB+qNnoZjADIQAzA0mWkE6v1n N/CGBUhV6kZjOZW2KRhHxypMgVLYRDwye5BsFcl/J1gGVI/Tt7kF/CJRTiWB9xeMH4SG fr/w== X-Gm-Message-State: AOAM531J7ezI/Y3VTYiLKhN52tmuuS9eyonPp4lbALJNKInjMwOAxQUx p5nYZ4I4YpU6ljgGjwoD/hScVs6RpVi7ZA== X-Google-Smtp-Source: ABdhPJwewuwybRP1iFkKLyMNopG+kmJhvZpUnlCneRh2U/IkRStk1FEJGiHX5CWNLMA5gVWTGygnCw== X-Received: by 2002:a65:638e:: with SMTP id h14mr17810222pgv.108.1624162905225; Sat, 19 Jun 2021 21:21:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 3/9] target/cris: Mark exceptions as DISAS_NORETURN Date: Sat, 19 Jun 2021 21:21:35 -0700 Message-Id: <20210620042141.1235541-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::532; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+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 1 16:04:32 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=1624163021; cv=none; d=zohomail.com; s=zohoarc; b=LBQ9Uo/+Mij7ryMWBoOx449a+Z6TCkHxLup8opxfsjBy0YJBXpuShGdKw7mbZ2rR7qOPMbmqL1R6KfilpPOX/wK/FSvtvMM+63KXPhfFMOhmLxwaHDV8p00xb+2U9LP8zk+G0SqPYMbSQGkiN2tT1p0/HG7PTwmNZAXddNPd2Pc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624163021; 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=lUhjuCQoqOuhKCG2jyvmAbFiav6IxZYgN8CafPhSc5ojdM/mYeoKZvCOQwx52y9ozRNKTJ5uITVNwzHPW9P5Md6vIO2xH3Y4sflEjkUuzq1lYplqYGVeTizUCIba+TB650GMEyB5bLJmmHSrEPTzSRSXpBzHNrJOmh/Cg9G8HQY= 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 1624163021314859.6355682665104; Sat, 19 Jun 2021 21:23:41 -0700 (PDT) Received: from localhost ([::1]:56608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1luozk-00083E-8Z for importer2@patchew.org; Sun, 20 Jun 2021 00:23:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoy5-0005MI-Dv for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:57 -0400 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]:41572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxv-0007xl-Bk for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:57 -0400 Received: by mail-pg1-x52a.google.com with SMTP id u190so7437885pgd.8 for ; Sat, 19 Jun 2021 21:21:46 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=h38+yrqYLEF8Qg/+ccdM2Tcru/YIUG4nfpAARgqgxf4=; b=AP0LLJU51LxHuc/m5L/E7Mg+gGEwsK2yIW6NfBRLfoOPq18EO8GinzG+epZmmLLpJR qJNbxe65lHW6hFAR4IGf6QtOUdBf9DwzS8wf2qaTfGjfb+99+1WXiDXhHv3gw6+Q1z7M 3ml5nbVS8UDKzzxdM/yIvyZdevhdbteCtiLb7qbEOIxCpyDPocvWz7hIXknC1nedWUHJ NZ6xu+D0pNtrNoCewMeWtfMpGQPY9fTQ8cukHO38+MVJW+EH7ifdtB7hd9Mf7IQHVtzl YLlgJaYctV5A/20MqtbD7qo5lSjs/UV5HvEnHZp1dNmJh+zS/HB2UUJmmhrv/j/H4mvg iSxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=h38+yrqYLEF8Qg/+ccdM2Tcru/YIUG4nfpAARgqgxf4=; b=nrqFLIB8VglGYRR6Wqyk09Eo+xLjSdrn8mlxRMyLhWMVtE0y2uwTxeLiyVV6oZu08+ 5E7IytBb6VtPTJsS8LZxmQgTs3oShuOgMsinNTs77jWtsDIsQvO+hvzi79FYdHnbMA3L 78eOcC9csrwzz/oTM4P2MNH9Bb6110ft9JEMFuFyljzDQ+aJaVl7m/MQ7gP2j1eT+sW+ 4x/ujcmGxa/mJVmxZ/5kdnQkfO8RY7hF31eIDDZrf+pXz4x6/27mNaRpCxaDSIV3/g7m Tbp2ibKZYA4Llhhg+sCwq2O2i1ef5x/bSMf2bwx0sUeZkf2cO2pULplzstgSI3D/4M77 jcNA== X-Gm-Message-State: AOAM531hIXAHpGL9IM9KFDeAEz+QTac9SiSBEDGqUz8ZUtWxd+NJw/xx 4923s0xmtR6tLhxN6n0CD+t+fjeCrKM7jg== X-Google-Smtp-Source: ABdhPJwadFdzq8IB90gvxruN9Mp771oE1cm8D18xvsAvnMhZAU/Lt20k5BgH0/2vQG1mx7R2g+sFzQ== X-Received: by 2002:a63:1848:: with SMTP id 8mr17820014pgy.392.1624162905841; Sat, 19 Jun 2021 21:21:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 4/9] target/cris: Remove DISAS_SWI Date: Sat, 19 Jun 2021 21:21:36 -0700 Message-Id: <20210620042141.1235541-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+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 1 16:04:32 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=1624163025; cv=none; d=zohomail.com; s=zohoarc; b=RsGx27i9Xhk2PW75dMmkoOQB3JkU+1JT3o1hHzp4ZBtEICGkx1vgUXMkBXRhAQmbuD8ueVbhcQTnG0meFTNvBIaSMm2qRWbGeBvU7YdNNaRhzWfgusk+2TueeacyNiq5vQC6YquUEpZlZU5JuMbbK19vwxVGcZ4sk8TgEMHa2Y4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624163025; 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=dZADyMfffqsmp+0m+4yVAjA1tVQt/ONZZyrANqPtQYA=; b=Ogppnz1vZPEwws4LC6vI2F5ZkngcKnQzgnXfpbRPhq667IiugyVTFpWePDwffv2ija5M5bPapi/teoFlG/i3zfmzU3smCnyoW0MoZI8G/xAKly2WSMDxuvprIj1ReyZmiOH0PWrRux883Y+X2g3YYdvz/yuhlGApD6A7X5bfN04= 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 1624163025540203.53295423475265; Sat, 19 Jun 2021 21:23:45 -0700 (PDT) Received: from localhost ([::1]:56614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1luozo-00083P-D8 for importer2@patchew.org; Sun, 20 Jun 2021 00:23:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoxz-0005JN-RB for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:53 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:42948) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxv-0007yB-RJ for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:51 -0400 Received: by mail-pj1-x1029.google.com with SMTP id 13-20020a17090a08cdb029016eed209ca4so8223891pjn.1 for ; Sat, 19 Jun 2021 21:21:47 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dZADyMfffqsmp+0m+4yVAjA1tVQt/ONZZyrANqPtQYA=; b=gA+kQVMUJvnbLEFrQcCp/8fjjRqGrUXBHHlyyTDbtktx8TxgqjBQnq2iJoCX0fP1Jt 6dN0RYBD9B2joHjsaHrHOlHil3K7OsnxCWLEKejapPTGVYpYeLtluiHmkiZ3kNTBDFZ5 v0oxl2U6HSGvNv9HEzzrZT1Qi+63nDAraen59yAqdvgrNP97E00FOpLpmuXY1Wx4qVix uqNWmBMX5A1rZtgPn9gtm8krytWmQVEzdS5jkJPU4LJxfiMYH8KP6x5ysf0/3SOOvxml hocpQ5Snfb1fbAC831NUDiVdXbufgwgliuqUG3fXxiOk6K8jX3GRpbVP5lfBmbfy5z+I Jukg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dZADyMfffqsmp+0m+4yVAjA1tVQt/ONZZyrANqPtQYA=; b=hgFPc3qa/y+hWsN2ZlRYQGSWU6SK+GdlBMM9QQuF1zNjX2MIUiD6o8ZIpoMNrNyF4T hBWyL2ieQhWEYx9CmGdL5dBZSSzRf7I3AB0tbRox/8yEG/hiCThDbptmKFiLvn7O4prA +Q+uhwNDvgDQKDs+pPRGO9ntmmL57B8c5mRHmvENutCiGTc5AjWGDjFjbzEjFBLw6EIU YH2aajqR+H7dgbe7AeYgpxOzFDKRWqXSjFqa9gPXC1XxMJb+TqN07M9jtxhN475Et1Fj OmEx0Hukw21lfc0dEYs/fEOdIurEWYReRFhZoDvQcPZQ6SUAvuCNKFzG5g9UUOT3YeRO nrlg== X-Gm-Message-State: AOAM5329MGeEWZc2go0CEh1ZLGe12potqdq2AhPv8DAxG/mTQPxHeTLG t753ytUaA8t7gGDNAwavjPSk9GjdaQBuZg== X-Google-Smtp-Source: ABdhPJx3rVdEP/aWiXZ/aEoZ466fujPMqILdyUmJdWojZj4fD8tPDsivliOfMSs/uZsDw2aGbeRv8w== X-Received: by 2002:a17:90a:740a:: with SMTP id a10mr22476338pjg.162.1624162906478; Sat, 19 Jun 2021 21:21:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 5/9] target/cris: Convert to TranslatorOps Date: Sat, 19 Jun 2021 21:21:37 -0700 Message-Id: <20210620042141.1235541-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+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 | 320 ++++++++++++++++++++++------------------ 1 file changed, 177 insertions(+), 143 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index 24dbae6d58..8c24053f5e 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -3119,17 +3119,11 @@ static unsigned int crisv32_decoder(CPUCRISState *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 pc_start; - unsigned int insn_len; - struct DisasContext ctx; - struct DisasContext *dc =3D &ctx; - uint32_t page_start; - target_ulong npc; - int num_insns; + uint32_t tb_flags; =20 if (env->pregs[PR_VR] =3D=3D 32) { dc->decoder =3D crisv32_decoder; @@ -3139,23 +3133,21 @@ void gen_intermediate_code(CPUState *cs, Translatio= nBlock *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; - 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->base.pc_first &=3D ~1; + dc->base.pc_next &=3D ~1; =20 dc->cpu =3D env_archcpu(env); - dc->ppc =3D pc_start; - dc->pc =3D pc_start; + dc->ppc =3D dc->base.pc_next; + dc->pc =3D dc->base.pc_next; dc->flags_uptodate =3D 1; dc->flagx_known =3D 1; - dc->flags_x =3D tb->flags & X_FLAG; + tb_flags =3D dc->base.tb->flags; + dc->tb_flags =3D tb_flags & (S_FLAG | P_FLAG | U_FLAG | X_FLAG | PFIX_= 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; @@ -3165,9 +3157,7 @@ void gen_intermediate_code(CPUState *cs, TranslationB= lock *tb, int max_insns) 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->delayed_branch =3D !!(tb_flags & 7); if (dc->delayed_branch) { dc->jmp =3D JMP_INDIRECT; } else { @@ -3176,113 +3166,146 @@ void gen_intermediate_code(CPUState *cs, Translat= ionBlock *tb, int max_insns) =20 dc->cpustate_changed =3D 0; =20 - page_start =3D pc_start & TARGET_PAGE_MASK; - num_insns =3D 0; + if ((dc->base.singlestep_enabled || singlestep) + && dc->base.max_insns > 1) { + /* If re-executing a branch, execute both. */ + dc->base.max_insns =3D 1 + (dc->base.tb->pc & 1); + } +} =20 - gen_tb_start(tb); - do { - tcg_gen_insn_start(dc->delayed_branch =3D=3D 1 - ? dc->ppc | 1 : dc->pc); - num_insns++; +static void cris_tr_tb_start(DisasContextBase *db, CPUState *cpu) +{ +} =20 - if (unlikely(cpu_breakpoint_test(cs, dc->pc, BP_ANY))) { - cris_evaluate_flags(dc); - tcg_gen_movi_tl(env_pc, dc->pc); - t_gen_raise_exception(EXCP_DEBUG); - dc->base.is_jmp =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; - } +static void cris_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu) +{ + DisasContext *dc =3D container_of(dcbase, DisasContext, base); =20 - /* Pretty disas. */ - LOG_DIS("%8.8x:\t", dc->pc); + tcg_gen_insn_start(dc->delayed_branch =3D=3D 1 ? dc->ppc | 1 : dc->pc); +} =20 - if (num_insns =3D=3D max_insns && (tb_cflags(tb) & CF_LAST_IO)) { - gen_io_start(); - } - dc->clear_x =3D 1; +static bool cris_tr_breakpoint_check(DisasContextBase *dcbase, CPUState *c= pu, + const CPUBreakpoint *bp) +{ + DisasContext *dc =3D container_of(dcbase, DisasContext, base); =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); - } + 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; +} =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); - } +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; =20 - if (dc->clear_locked_irq) { - dc->clear_locked_irq =3D 0; - t_gen_movi_env_TN(locked_irq, 0); - } + /* Pretty disas. */ + LOG_DIS("%8.8x:\t", dc->pc); =20 - if (dc->jmp =3D=3D JMP_DIRECT_CC) { - TCGLabel *l1 =3D gen_new_label(); - cris_evaluate_flags(dc); + dc->clear_x =3D 1; =20 - /* 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; + 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--; + if (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; } } + } =20 - /* If we are rexecuting a branch due to exceptions on - delay slots don't break. */ - if (!(tb->pc & 1) && cs->singlestep_enabled) { - break; - } - } while (!dc->base.is_jmp && !dc->cpustate_changed - && !tcg_op_buf_full() - && !singlestep - && (dc->pc - page_start < TARGET_PAGE_SIZE) - && num_insns < max_insns); + /* Force an update if the per-tb cpu state has changed. */ + if (dc->base.is_jmp =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); + } + + /* + * 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; + } +} + +static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) +{ + DisasContext *dc =3D container_of(dcbase, DisasContext, base); + target_ulong npc =3D dc->pc; + + if (dc->base.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. */ @@ -3292,45 +3315,56 @@ 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) { - tcg_gen_movi_tl(env_pc, npc); - } - t_gen_raise_exception(EXCP_DEBUG); - } else { + if (unlikely(dc->base.singlestep_enabled)) { switch (dc->base.is_jmp) { - case DISAS_NEXT: - gen_goto_tb(dc, 1, npc); - break; - default: + case DISAS_TOO_MANY: + tcg_gen_movi_tl(env_pc, npc); + /* fall through */ case DISAS_JUMP: case DISAS_UPDATE: - /* indicate that the hash table must be used - to find the next TB */ + t_gen_raise_exception(EXCP_DEBUG); + break; + default: + g_assert_not_reached(); + } + } else { + switch (dc->base.is_jmp) { + case DISAS_TOO_MANY: + gen_goto_tb(dc, 1, npc); + break; + case DISAS_JUMP: + case DISAS_UPDATE: + /* indicate that the hash table must be used to find the next = TB */ tcg_gen_exit_tb(NULL, 0); break; - case DISAS_NORETURN: - /* nothing more to generate */ - break; + default: + g_assert_not_reached(); } } - gen_tb_end(tb, num_insns); +} =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); +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); } -#endif -#endif +} + +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 1 16:04:32 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=1624163113; cv=none; d=zohomail.com; s=zohoarc; b=Br2sPS4sbnSp+RPzFqLGP65IUGLnvz1WUtgeoDrhjbGvYd66P2ClXMGsdmxLF2vk9//UGDOPeVvXpU0IJjlQCZj1UDB25Dpf+bML1hmOn2EuJwjl3yI2RjqLnvkN5TX4HLvhO1fn693EyP8t+6aWfbR1IJ+mBbPo4qiWuYeu+ak= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624163113; 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=RwXRV/Qb/xNNyoFKCQRumg2nhkc/s52+so0hPxjJStLs0WsBrlHdCGP5IslGDG5miRIEPsh3xwsBaujbPlNuq7mW86EZLKll+v7EUEkCrPg4eA5Cv7YL6u1enjWHgyx0RDAZICScpJgTRfjyc+LhMVFY+evJ9RL37QJksLaaW/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 1624163113583564.3490188259047; Sat, 19 Jun 2021 21:25:13 -0700 (PDT) Received: from localhost ([::1]:36004 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lup1E-0004gp-Io for importer2@patchew.org; Sun, 20 Jun 2021 00:25:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoxy-0005JK-5l for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:51 -0400 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:39853) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxw-0007z9-7x for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:49 -0400 Received: by mail-pf1-x436.google.com with SMTP id g192so3323955pfb.6 for ; Sat, 19 Jun 2021 21:21:47 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oqu6i/kvNHrYtHemRicmatPUkUSmc3yTCi7Ugc/TW74=; b=qgWXZjJaADP3CmLd8NzXADVqAXiMlMMvu1WQDACA/GxX75pw8TXzbFDx4+e/kN3NXm zfL39+upX6mbVI8cfhOEW2LSvhmjqn4JawBckIX/YU+zbVYDzzVQZVx+wILwRiTInfoT cPUgOD42ahNMZ5vlx30YhwEZS6UEeVK1hEUIC2BUIh53YR/RT1I+rORA7A1g4AzEY3GM gHJ9IlYNRAzpc41mvOLZWWCAuRKfkN/gfA663Dd7Msw6yJxXQR6AfLRQB7YIoevttpM8 8CAcs15Qz4pmSoqFlZH7JWSmF627Y1V9hyZTzBBkpv2uywKy1MRSUG+jO956PhS/pDCG 7GVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oqu6i/kvNHrYtHemRicmatPUkUSmc3yTCi7Ugc/TW74=; b=bQFwbG7fDK552iaXe+tE/Md0WfdRUDAIfeAFSiuMCt3l5Splc44bmuwhBAxo84TbES 4Fg8ltjZyyojJPZq3ah5Ueu/9iAeqAaU48SgNq0hv2WTVqYZPSUMtJ7/bFXE8iU0kZlX JSMD2H80ZvNcE0RV7AfKtKIZE0dkTzt3GkRp0GUeiqOGzzV+IynbZEWkBxzBuJUgjtUB vK4AxtltUdqgn7jDHjbxY1D/rADSTvd2DzdwrLRjR3vv6vyyU0CKTuLED1IZ2lyMhiO1 1jA8aZ7vqPpyVcg1oDVCKOqUllw/iUNfAuG8vs/hFcJDuDTuLYalaPk2/20WdIE3Npfy rV8w== X-Gm-Message-State: AOAM533XETPYKXnb0Kf8Dxmsr5F1/DAPxk0C6sURfJdbGXLXXQgpVFSb jBNDrls4ev4pOjzUIccoPtwvpY6db1cdPA== X-Google-Smtp-Source: ABdhPJziYnJxpPVg7qtu+28vvB4ho9kMOnPBGG27Jghhsqxx4nNOpeQqt0X08XFv25KY6kYlr7YKcA== X-Received: by 2002:a63:2483:: with SMTP id k125mr6463747pgk.99.1624162907050; Sat, 19 Jun 2021 21:21:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 6/9] target/cris: Mark helper_raise_exception noreturn Date: Sat, 19 Jun 2021 21:21:38 -0700 Message-Id: <20210620042141.1235541-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::436; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+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 1 16:04:32 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=1624163212; cv=none; d=zohomail.com; s=zohoarc; b=V66yXB5Yi9YEVTu6kVTPOlOw4Q4v4meTcGiOG+5wXqr1SQWDARcmHhbYJJ5mOOtl1CIY9oyAjucgYQf6r3XmsF6reSkXZ2kTobAo5E/zhugK/iKKWbo2usSy/FA1KHitkZ+j+7ThFMzZAmM8lTBCPI/DRqUaBcwm11hsMwRMBRY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624163212; 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=xehCQ9vTLilSPHreJ5z6HAmdw9vSAgo0a8TpFRTr4mo=; b=h9mHcSS90kYgjnILoF3grw/Xz0RjLCafU4I9jYakllnaxNArQ9Da7O4KkkQWD8mh6UJ0eFWF2BsW2SvMWBvRhVvpcMhN7CRMrRAvrZ7RnvfQcsF/J+Gd83gZ2oYKXPqqzzl2dGPs+h2zBckg6CbFVCMrrH0on4jR2PY0VAJ5W8A= 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 1624163212895741.8004538132683; Sat, 19 Jun 2021 21:26:52 -0700 (PDT) Received: from localhost ([::1]:42476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lup2p-0000oa-NL for importer2@patchew.org; Sun, 20 Jun 2021 00:26:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoy3-0005Km-Hn for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:55 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:39443) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxx-0007zJ-Nz for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:55 -0400 Received: by mail-pg1-x536.google.com with SMTP id w31so11273061pga.6 for ; Sat, 19 Jun 2021 21:21:48 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xehCQ9vTLilSPHreJ5z6HAmdw9vSAgo0a8TpFRTr4mo=; b=uf1LXOjQlLi95vPdgt/zeewXab2w5VyDPzjECeToS0mC48/Fxv+TBn9QNS4+3Z/6QN tRBp0tD3seNFEaERPKMSkcos6OhLMh2q3FSxu4la6IXXRceWy7lsVUuHxuHTiFJ5ozbw kg7e0mjysDxzsxUDeGLkGFl6p4GzF5ZxT1iCtLSF7/ojJhwBxSKf1mDHdBhC/IeQ2ZUn L8myaDTIgFWwnJtmYPIR5OVP14DsS9DYxxFLwnNov0YWNgO3RNWmQXX+y2n4/601lZSe d1nWWnR0N407+LSZHYZrfgdor/Ws6138i/3y0LnN0xDyWRAoYYMtURd4Xqv5WqI6Wn0k Zu1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xehCQ9vTLilSPHreJ5z6HAmdw9vSAgo0a8TpFRTr4mo=; b=EZ8tHQLqRmuhgRAk12FFFijES7SwkF2O6Ti84mq/Xo989FcsRfjFHniBZiU1at3HAL 01dsqa27aNu/6ONDV4UmYUkPO7ONfhe9lfAmQiVlNvzHNanICBzLs9DzodPEmQCRUX9h Ubn+KCr+9C9vnodrgnSdxMajGyvNvl9NFzEp4cc85nEOpnokQua25zz0bg7jjC64mk8I 6xoh2iK2E6KAfhTfwbgCdMKYWlAETworcHIVE97JSawVZMWFZrcTgQGGjJbg0Ap0sZY3 SE4ykg7NOtDmFMHn1yXUYg5BFoGyP91bfUmR3U2Z4xmwDuQhtwfmPl/1HuRa0bu8wWRQ iy6A== X-Gm-Message-State: AOAM531Ra8VifS9IrNXXngVoNPHaPjCSMjXgpYKtkBsRYs9CUJyn8qkB ++mkwMuJGYjvHzpk5nxupHe0ITcrD1rTzw== X-Google-Smtp-Source: ABdhPJxjt23Cppk464+j24+FrmD5p01NjSLBEX838O7s2m7vrs7dHelddSkrfOo/d7e4ifcvItLojA== X-Received: by 2002:a63:e245:: with SMTP id y5mr17462746pgj.171.1624162907668; Sat, 19 Jun 2021 21:21:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 7/9] target/cris: Mark static arrays const Date: Sat, 19 Jun 2021 21:21:39 -0700 Message-Id: <20210620042141.1235541-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+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 | 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 8c24053f5e..3515c21b7b 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -137,14 +137,15 @@ static void gen_BUG(DisasContext *dc, const char *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 { @@ -1284,7 +1285,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" }; @@ -2931,7 +2932,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; @@ -3371,8 +3372,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 1 16:04:32 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=1624163211; cv=none; d=zohomail.com; s=zohoarc; b=aSFvrYNDdH4bvugd7KmB+P8UgQgRQ+h2uoXTQMlSHxGg+ecaoixII00DEWe43uP7fflrMrJsErJERVRePjGA+RoAV7FZD8PyMPWJhEc0GdSZWVFRdOTOEe9Y3rhH2ZYO22J1elXpm8cRJxt1iaDFmJGWpDjpfhZjoJCfrnoshn4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624163211; 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=mmktZg4SZs/Mbi17grMf/E2VN5NS9/M2R6nJtdGiSV4=; b=TGszsd4CD/nzLJ0hEprGxPAIsynw6vb+qzlDNS+QtpK7HwkNYIbiPf+HTeNBru0h1/2RIhT1vCtSkfa02U6ALuWyaGk+W+mdp1t0/Ukjs28ZaH0DZur++f4iWW+61hDztR5bVWeUn72i54VFY3qlAfXNzL0wD2XZy2fhdCQ0ubE= 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 1624163211223677.1721916943542; Sat, 19 Jun 2021 21:26:51 -0700 (PDT) Received: from localhost ([::1]:42306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lup2o-0000g1-61 for importer2@patchew.org; Sun, 20 Jun 2021 00:26:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoy1-0005Jp-L6 for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:54 -0400 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]:36657) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxx-0007zy-OA for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:52 -0400 Received: by mail-pj1-x102d.google.com with SMTP id s17-20020a17090a8811b029016e89654f93so10493960pjn.1 for ; Sat, 19 Jun 2021 21:21:49 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mmktZg4SZs/Mbi17grMf/E2VN5NS9/M2R6nJtdGiSV4=; b=ym7QMcKC+GV5NZXg0I2JSlbF3SmV7V/VbtTKR/Rd/PfyBV8W40dBM9qJaoYixATZzZ eile7f4ZGVC6L9HA0rq2BKW+teV1+RQeqKpI5/kHMcL59wIA8q5Ae+vRjSS8a9v+FRsm w/Vx99UUwzPddja5gBsQgbWaDMg8NsCb3jKPHG85cjH2bCOPurWicVj22ilWhLXM14HQ beSKTXIlP5C+3JNpidrQZTfqItgC+/DWFbZiEpf1vyYdiHNUsEDE/ORL31wrjcSqhwGB 5ajf3IBPNx6PJo0O/EU32k/eDNfTr3yjbsBx7N9emQfGRY8BOWnNNIgnKDCQtZeKzlKU YSLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mmktZg4SZs/Mbi17grMf/E2VN5NS9/M2R6nJtdGiSV4=; b=bYhgsjUwdq72+UPLlYRzeWztBhvRnKwGBxSIBsGbR0KM7YDYujFAV/c52I6Aq1oRye aCVPkrgzXbqRXjaXQ2xYHzPFI74sQqQMc5xpbw+QnDi0ldYeB8AGwQyvpeAaOLnM6Ca3 OlTItwRxgiGl6PAKnkw6FlqFZErOXB7ZYLTJ3HSEDd3vRdZiRZlnON6KOdC9mqFsRNPY pkEHZExwi2uzomOFSczyMJW4xqHD0+Yd1K/6GjAcMtIIcHodLDC2Rn0gngRKUqD3T6Z6 KoCOVuevMmyw4X/2gonMyD0Er70bQ0sm67L9ybjRtrsRVnH8OeDxXqGixhpOiH0IMSwR lk5g== X-Gm-Message-State: AOAM530f8MUmzpDZOrxiJVCVIoILUthFb2t9lKvPzIKn+Xa40PuI5IlX tsjLtGh4ABStphM5YhyaoKqtqOwfpaeftA== X-Google-Smtp-Source: ABdhPJz1nptRnDqh6tvJqOnQrFo65NdXex1JaUmsj64nSLJFSDpCqtA+Wbs7ZCsY5XnzwShv5UcUig== X-Received: by 2002:a17:90a:d598:: with SMTP id v24mr18803360pju.185.1624162908257; Sat, 19 Jun 2021 21:21:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 8/9] target/cris: Use movcond for t_gen_cc_jmp Date: Sat, 19 Jun 2021 21:21:40 -0700 Message-Id: <20210620042141.1235541-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" This is better than branch around assignment. Signed-off-by: Richard Henderson --- target/cris/translate.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index 3515c21b7b..e4cbc35ebd 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -516,13 +516,9 @@ static void t_gen_swapr(TCGv d, TCGv s) =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); + tcg_gen_movcond_tl(TCG_COND_NE, env_pc, env_btaken, tcg_constant_tl(0), + pc_true, pc_false); } =20 static inline bool use_goto_tb(DisasContext *dc, target_ulong dest) --=20 2.25.1 From nobody Wed May 1 16:04:32 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=1624163331; cv=none; d=zohomail.com; s=zohoarc; b=NX0IDP6yjC8i5HCSUaTqSz0fHKH9Y5qmWsDGXkq/u4+I3yuHUNgVNLwbZncqi9FQpefR69fVuN3TZ7amiY/Ih/MSdVtX+NDTnSuOig0aAxS59M0bZXCd4oJhxqatNv3sp19xNFmGAzirQcshhhoCuXrAndgLahjbfMAmHCxWqjI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1624163331; 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=soBxmYzIZMGH+aXCnzU66X8RLdvoKJnc1fvxigxH0fg=; b=lN+By9uQgaN3RZaEZfPFYOw83v203flS20T+E5TWa7voBT2R9EkKKMkIOcxSJ/BJutMRhNHskiiZY3F1HO+wquhBSkIorshhlstj4NkV8zzPDDlCS0Lb9Xdh1aDiXPDZDXMYv6IoFmUberu8zgMf05vwFz5tik3OhklZmkIvO08= 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 1624163331191819.369897409639; Sat, 19 Jun 2021 21:28:51 -0700 (PDT) Received: from localhost ([::1]:50798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lup4j-0006UJ-Tv for importer2@patchew.org; Sun, 20 Jun 2021 00:28:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luoy4-0005MG-MY for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:57 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:44782) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luoxz-00080l-7N for qemu-devel@nongnu.org; Sun, 20 Jun 2021 00:21:56 -0400 Received: by mail-pf1-x42e.google.com with SMTP id u18so5644019pfk.11 for ; Sat, 19 Jun 2021 21:21:49 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id b6sm11923156pfv.16.2021.06.19.21.21.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Jun 2021 21:21:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=soBxmYzIZMGH+aXCnzU66X8RLdvoKJnc1fvxigxH0fg=; b=of+tKD29OLtcKdR0OPS8PhlSF+PcG44d4in9HuN2gHtJ7sx2LTIaDNvFmHkIal2z+q iTPVPTWuKZi0/XnIhOLdeBWCpbBBVnqgHgNRQNUvVM5kU3PApsD7eaT6h9BAjMlMoT5z OozTtbsZR7qFi8+VvAHE4NlHeTx/4ZaEGIyzmKGrIlvWCl/P/yp3885WU+NclzVuldh1 O2K3nFcxKj35jhfMdPb3TX8mdIlNSzZXhivzpPkyMNNQSbV7ruYWglRweJ1PK1C9iUhj lXUwo0PU9Z0Ra2+ph8Fd4otuo4HHyqtW/ZhL2w+kJQsMXvcETRxtVvKZWjlTl4lQpBsa 4j6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=soBxmYzIZMGH+aXCnzU66X8RLdvoKJnc1fvxigxH0fg=; b=RVZ+wcnHLOBHdFRKjzeGsxn6qY1KThT0nqcjCiASvqfl3AOgLh7xgagm61SAc+dmou VogUzpGyTsDhnGWKEC6fdNErz9gRU8JN/APXGkTX+lIDdKhvANZf+LKF0Ff+/mJQaEJd fyEj16zJ/SYQQq+qRT1Agr4Ssi7G9qbB0+1s1zy30QemqaJqzf84e6SGlwauZeL+nc2I +6lE+KFGdai2u//knqygbiqOZqckMo1hrz0B9o/GqzPbEun1m3LKkOuMAmhI7F2AhsHs 8/hRL74a0OnFnuQokv+PZSuPxqGfkirwTG9k00Z76M9c283M/dCgqrqylK4fjndVk5ad NdUg== X-Gm-Message-State: AOAM530e/B9xbCZQUkXrtwZBs/MCza+vpOtcZ/KPBA1RF8HuUzhj3rrb zPMzuGS+XAAeTr+8vW9XV0exAWg8jAe/mA== X-Google-Smtp-Source: ABdhPJxPC3xV490iQ5Ap3LWhGg6J0MO636mB60pxQh/OOk76y8GfLYepEQYaZuLWpKMIfRXZV4djvg== X-Received: by 2002:a63:e04e:: with SMTP id n14mr8530781pgj.324.1624162908886; Sat, 19 Jun 2021 21:21:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 9/9] target/cris: Use tcg_gen_lookup_and_goto_ptr Date: Sat, 19 Jun 2021 21:21:41 -0700 Message-Id: <20210620042141.1235541-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210620042141.1235541-1-richard.henderson@linaro.org> References: <20210620042141.1235541-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" Indirect jumps can use this to avoid returning to the main loop. Signed-off-by: Richard Henderson --- target/cris/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/cris/translate.c b/target/cris/translate.c index e4cbc35ebd..8a8d62f11b 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -3330,6 +3330,9 @@ static void cris_tr_tb_stop(DisasContextBase *dcbase,= CPUState *cpu) gen_goto_tb(dc, 1, npc); break; case DISAS_JUMP: + /* indirect chain to the next TB */ + tcg_gen_lookup_and_goto_ptr(); + break; case DISAS_UPDATE: /* indicate that the hash table must be used to find the next = TB */ tcg_gen_exit_tb(NULL, 0); --=20 2.25.1