From patchwork Tue Jun 29 18:54:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 468319 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5242760jao; Tue, 29 Jun 2021 12:13:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEtIHOpal2GRVcDj7psVsJczlFpqChaiU0dp+mqdPQih4+9IEtocWNf99HZnF3Uhv4kEN7 X-Received: by 2002:a05:6902:70c:: with SMTP id k12mr27442420ybt.125.1624994022088; Tue, 29 Jun 2021 12:13:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624994022; cv=none; d=google.com; s=arc-20160816; b=Lsd36aDQi1igkhe15VlT4rM/Xm0sN/11JaGcWeOpXIJdCctm6tIIfjeNrTKVCeRGV2 fJx0TN1Tw7BGT72Jt82tdjcid0rWrmCq5nG87DzrYBVlnrGyuJlR9Jqy1MaW9VD0Irr4 rYiDM3eXxA7eicJCcOGY+bXBJNxB2A+lFhnJ/7HQhdA3FyBhx6nGTMyqLw8AOztg9aMV iUn344BxuBBzWpwd3YKKZWE9aNTd5RvML0yhmpy5ejRSgAyclXtHANUfwiUSO9iFTCY2 3KLFbKZFn9aP5lcjFYSPY9B8nDtjtYyD9sY10fVEWPzBfGhjfJTJknePrpXre8mt0qXt M6dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=kqh2og0wEwr/ALN9/Tn9edLBUCiuTurWoZvmUbX68qE=; b=upbjYxOQUawQyFuqy3Bd/bUViE+HnACJ9kN2fps9yV1oSKpOKQNWxuku801fNV9KzR RqQdYytnWxa39Ih9a7phMSJ9GUVtPlM2MU4pRbJyXbWfP4wqPKannP9qMB51894Bx5SB SBxcwJhDQKohI8GZUMwgAPQyfc/RkIrmHfa+oDEW7AwG8p9IJ7mgVL9CAwnxrUo3+Qcs ruf1NQQwXsJ/GHWmf6jZFqAWAVAyN5Vlrmoy8aCh30pItewttRHCp85HQykYniY/b6yB KyaL6ByDHmf0+YXERRENTuW62/DZE4lYSRCTaXvXmITgeDwjXN+buFCq4YS7kD0zwbVY EFNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Uirq0MEO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y78si13271286yby.492.2021.06.29.12.13.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Jun 2021 12:13:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Uirq0MEO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyJAz-0000TE-Gb for patch@linaro.org; Tue, 29 Jun 2021 15:13:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyItE-00088x-Ha for qemu-devel@nongnu.org; Tue, 29 Jun 2021 14:55:20 -0400 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]:41818) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyItA-0000to-26 for qemu-devel@nongnu.org; Tue, 29 Jun 2021 14:55:20 -0400 Received: by mail-pj1-x1032.google.com with SMTP id cx9-20020a17090afd89b0290170a3e085edso3117314pjb.0 for ; Tue, 29 Jun 2021 11:55:10 -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=kqh2og0wEwr/ALN9/Tn9edLBUCiuTurWoZvmUbX68qE=; b=Uirq0MEO+S57FBVOSqsnn2dIQ6e9YWmQqobQyxfk0HGH0WGHbdEuOKYDowVwk6xCyX Mqka5vHs2OahvM9XdpzsJAMx4lAG4ZgNMloYhloh5M91h1W6TsuAojA8hP4wlOAysQL5 +edBKPUsgUZSYQpSzilio9ecALPexu6LrWALGMc+Vx6lh690NnrpV/3tK5SaBVZMkUn2 MU9iUY9M/txGVg9GdOievZ6KyEML49lZvmtZ3Cjjh9bu/RuZETkT3CqQNa/c/qUTjSqx Yj9kp8aXgB0IJr6478FtF44u7jbM8C6r6IW0xp4RCOdhmuPrNaiNgcgp/p6V4GzBZ5tc EsHg== 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=kqh2og0wEwr/ALN9/Tn9edLBUCiuTurWoZvmUbX68qE=; b=SwYx0t6bi5pU9q2lq69588XM7U0yfGC/mjPrTcHoKlAnWjvLwUubnM2Y7dEIJ3qPul T4fzMlAX7y5eoG62ADPpEXJo+5AeOz3k9Pro8A3j2Qx7+IKvG129q/mVvJGU8OUT9Wp5 o2y7FR6k4BMs3DEbrZ4aut7x/DT2GWH5hY8DXf6+m+u4r7WhsLH6kbhR4IWBuuAHmPHP h1vTfgHoaob4YSftqyAPCPzC1psrPz00pSfExAtaLbiUhFaFNQ8dnxSRj+cfaVwdrGIO UDPeYvuIoZTbGDcjlycA1ncLluyl19KkEwZwQ1X0apYCcXvKJTlGRmeOzA1o6YeUcVvQ 0JCw== X-Gm-Message-State: AOAM532db4ImyRC16HothEsROqkR15YVWLLAMOegDJAz3dAT6TqTG/gg 3Q8LiS0fphtx/ju/4BRwbsszoVsn5lA0ew== X-Received: by 2002:a17:902:8e88:b029:11c:51bc:def8 with SMTP id bg8-20020a1709028e88b029011c51bcdef8mr28537709plb.57.1624992909166; Tue, 29 Jun 2021 11:55:09 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id j2sm18811253pfb.53.2021.06.29.11.55.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jun 2021 11:55:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 23/63] target/cris: Add DISAS_UPDATE_NEXT Date: Tue, 29 Jun 2021 11:54:15 -0700 Message-Id: <20210629185455.3131172-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210629185455.3131172-1-richard.henderson@linaro.org> References: <20210629185455.3131172-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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 E . Iglesias" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Move this pc update into tb_stop. We will be able to re-use this code shortly. Reviewed-by: Edgar E. Iglesias Tested-by: Edgar E. Iglesias Signed-off-by: Richard Henderson --- target/cris/translate.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index df92b90d4e..a2124ffcd5 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -52,9 +52,15 @@ #define BUG() (gen_BUG(dc, __FILE__, __LINE__)) #define BUG_ON(x) ({if (x) BUG();}) -/* 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 */ +/* + * Target-specific is_jmp field values + */ +/* Only pc was modified dynamically */ +#define DISAS_JUMP DISAS_TARGET_0 +/* Cpu state was modified dynamically, including pc */ +#define DISAS_UPDATE DISAS_TARGET_1 +/* Cpu state was modified dynamically, excluding pc -- use npc */ +#define DISAS_UPDATE_NEXT DISAS_TARGET_2 /* Used by the decoder. */ #define EXTRACT_FIELD(src, start, end) \ @@ -3268,8 +3274,8 @@ static void cris_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) /* Force an update if the per-tb cpu state has changed. */ if (dc->base.is_jmp == DISAS_NEXT && dc->cpustate_changed) { - dc->base.is_jmp = DISAS_UPDATE; - tcg_gen_movi_tl(env_pc, dc->pc); + dc->base.is_jmp = DISAS_UPDATE_NEXT; + return; } /* @@ -3311,6 +3317,7 @@ static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) if (unlikely(dc->base.singlestep_enabled)) { switch (is_jmp) { case DISAS_TOO_MANY: + case DISAS_UPDATE_NEXT: tcg_gen_movi_tl(env_pc, npc); /* fall through */ case DISAS_JUMP: @@ -3327,6 +3334,9 @@ static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) case DISAS_TOO_MANY: gen_goto_tb(dc, 0, npc); break; + case DISAS_UPDATE_NEXT: + tcg_gen_movi_tl(env_pc, npc); + /* fall through */ case DISAS_JUMP: case DISAS_UPDATE: /* Indicate that interupts must be re-evaluated before the next TB. */