From patchwork Tue Aug 25 20:58:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 248264 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp3766059ils; Tue, 25 Aug 2020 14:03:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc1JwyBzt6sqPc/gFbGnG6AoQwQJYaoLdMTkbgAVxDANaZqqP51s3kHvlry5zjv+Ese8JM X-Received: by 2002:a1f:9651:: with SMTP id y78mr7403612vkd.5.1598389397861; Tue, 25 Aug 2020 14:03:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598389397; cv=none; d=google.com; s=arc-20160816; b=D27CcsUBCeAzY6sRxGZiIdImUNblT9GvmdO9yB5+gG4ruZofjCo895cUF1LKj4qG73 Kox1Z3yTKHcdfPT+rnppXGHvWBz/GhJ2E+4uo4okQMY2jgm9x0r3WCvYWeVasejxkUVT IFO8xMawNfVhAQvhPg5p5Qn+5PX4XeNhsLUVr1W9lPXv3dyd4JPGFXjIMRWhUZijnFgN KgCA3Rziz9tgW7EejHGWFWs1p+rotPH71hu3BvcXjKbJkI8QHprCq3+xyOArYpkTagu6 HLWaDsXv+iFWYkbVCD3rwOfyZ/eYRTE9vXFmttQfAl+9KhJRD4QCidfkuta+8ONNcyPF ntMw== 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=qXpLGSkTUh0l6cihbLBx2yxjRuaY4I2Cb0zQBnRmSlQ=; b=Nebub911oBGmpyKMhV5GUwbTdozydGmdmol+8Q7NhbkMTQF4gxmAspyS4eS0cucPRL /51qlPG7dUGSXcpCW4fekggGiW8ytwP6Tq4lFC4MeQi+6HYRf55eVDpBEudizk/6XlfD F3jsY1/2fMn6m++lXvAXKCtv4lCZTeDJwSDDND3WQEGbxgfGd3ZVfavTGa93X6FVHAJG ImBVmXpn0deyYl0eED9Ff+AsRH8njtXDHX4ReDf0DezTXtFNlFNtFG1LC+3vpL174ZTf 9yRNfpO0l+h2e+tYdO2QBgnhD6JYOrWF3CMTsLJtwzcUTAKawq5MSirU+d2dIox77D3W lJuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xt5JE9G8; 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 d21si18229uaf.49.2020.08.25.14.03.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Aug 2020 14:03:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Xt5JE9G8; 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]:50534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAg69-0002cp-9A for patch@linaro.org; Tue, 25 Aug 2020 17:03:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAg3V-0007iz-2Q for qemu-devel@nongnu.org; Tue, 25 Aug 2020 17:00:34 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:41480) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAg3Q-0001ml-JH for qemu-devel@nongnu.org; Tue, 25 Aug 2020 17:00:32 -0400 Received: by mail-pf1-x444.google.com with SMTP id t9so4126902pfq.8 for ; Tue, 25 Aug 2020 14:00:26 -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=qXpLGSkTUh0l6cihbLBx2yxjRuaY4I2Cb0zQBnRmSlQ=; b=Xt5JE9G85i3eZDXw3qRDWezs0DmH9p+/MSYAdzrtej6Sg6TLoDd4707qXx5UoZq95y 1uB+WZ/v+7ywlZbL8AB9+InqkWeGIRjlMOWvaVoj482u83u/uokVxXWUQw8xAGAgQE68 BIZ+IJ8et30Jiq+DAsFAiEZsVQcnzXmjw6+pSZ5DKaVIktlPGLJ8dWfeSbBJ8ALgfR1N PSBkAhuNjFi4n/bfQORYAcYwjbr4j7iX7PHmp8tUZFarszV8AjSSpMfCt8RDVN1hViNx MtCu6k4gqNHZRD5RsHtrTLOjwyHFR4JcdzyKaqmSWyeUdZIT0mlFeWUnQX9CsOJBlUTy E5tw== 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=qXpLGSkTUh0l6cihbLBx2yxjRuaY4I2Cb0zQBnRmSlQ=; b=D4PTx6+DL2ZrMQvX0tR0PkZHxmxEDGHJ45ortiMe7/lAZlZzzxZUQKdu5b+jIpzfFR sS8cs9dLcOMc721OK0XJ5G2I1AavcdM1XPIxH5ojd9r77rfUorhRGz7MjoZP8ESXaQ26 YTLW+Iiidbg88P5kxxHM4DZQzs2DjEahZpo7O3HUnduwbUP/ENQqaPcH48pWCqp+DNzV z29S6pSEjP+z8MDQORWX00mhfxy2upBj2IgXh6flInbtI1A9/R1F5XFRFh6y0oPXqfeh Z/SwwBxY2KPwDrW62H0B/utn8/FzIM5XNEUwF8hA4HKdC4HpDBinlLBJTQOsTYJKKo5D EimA== X-Gm-Message-State: AOAM530gGeXx6i6+bUEcR3IQ7REBLGua+8msBMoIzsjXWIgnO0kiYVx/ RJbhEhJE47pKM2tvg9JewpLMRTLbB8CqDA== X-Received: by 2002:a17:902:c212:: with SMTP id 18mr9018374pll.250.1598389225716; Tue, 25 Aug 2020 14:00:25 -0700 (PDT) Received: from localhost.localdomain (h216-228-167-147.bendor.dedicated.static.tds.net. [216.228.167.147]) by smtp.gmail.com with ESMTPSA id k4sm16074pgr.87.2020.08.25.14.00.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 14:00:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 26/77] target/microblaze: Use DISAS_NORETURN Date: Tue, 25 Aug 2020 13:58:59 -0700 Message-Id: <20200825205950.730499-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200825205950.730499-1-richard.henderson@linaro.org> References: <20200825205950.730499-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::444; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Both exceptions and gen_goto_tb do not return. Use the official DISAS_NORETURN enumerator for this case. This eliminates all use of DISAS_TB_JUMP. Signed-off-by: Richard Henderson --- target/microblaze/translate.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 0c9b4ffa5a..53ca0bfb38 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -51,7 +51,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 */ static TCGv_i32 cpu_R[32]; static TCGv_i32 cpu_pc; @@ -111,7 +110,7 @@ static void gen_raise_exception(DisasContext *dc, uint32_t index) gen_helper_raise_exception(cpu_env, tmp); tcg_temp_free_i32(tmp); - dc->is_jmp = DISAS_UPDATE; + dc->is_jmp = DISAS_NORETURN; } static void gen_raise_exception_sync(DisasContext *dc, uint32_t index) @@ -149,6 +148,7 @@ static void gen_goto_tb(DisasContext *dc, int n, target_ulong dest) tcg_gen_movi_i32(cpu_pc, dest); tcg_gen_exit_tb(NULL, 0); } + dc->is_jmp = DISAS_NORETURN; } /* @@ -1675,7 +1675,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) } else if (dc->jmp == JMP_DIRECT) { t_sync_flags(dc); gen_goto_tb(dc, 0, dc->jmp_pc); - dc->is_jmp = DISAS_TB_JUMP; } else if (dc->jmp == JMP_DIRECT_CC) { TCGLabel *l1 = gen_new_label(); t_sync_flags(dc); @@ -1684,8 +1683,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) gen_goto_tb(dc, 1, dc->pc); gen_set_label(l1); gen_goto_tb(dc, 0, dc->jmp_pc); - - dc->is_jmp = DISAS_TB_JUMP; } break; } @@ -1717,7 +1714,9 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) } t_sync_flags(dc); - if (unlikely(cs->singlestep_enabled)) { + if (dc->is_jmp == DISAS_NORETURN) { + /* nothing more to generate */ + } else if (unlikely(cs->singlestep_enabled)) { TCGv_i32 tmp = tcg_const_i32(EXCP_DEBUG); if (dc->is_jmp != DISAS_JUMP) { @@ -1730,16 +1729,14 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) case DISAS_NEXT: gen_goto_tb(dc, 1, npc); break; - default: 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_TB_JUMP: - /* nothing more to generate */ - break; + default: + g_assert_not_reached(); } } gen_tb_end(tb, num_insns);