From patchwork Sun Apr 17 17:43:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 562827 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp1858028map; Sun, 17 Apr 2022 11:00:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy40Sq6wXHK8HSmYt72WMCl7a71XjZlxe7nA7AV4j3Rf98WNxCrqc0w58eDp0N5Hab3wB6p X-Received: by 2002:ac8:5c85:0:b0:2e2:3211:92e9 with SMTP id r5-20020ac85c85000000b002e2321192e9mr5095765qta.386.1650218452948; Sun, 17 Apr 2022 11:00:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650218452; cv=none; d=google.com; s=arc-20160816; b=POmsd+FsPRikq1NZeMWBulRVo7Xrg+ra9mUVbS6AlMtVqFT3PX4YzbXv2JchAPvrhJ XptAVsBVxDkIrg30jh5Zd8H3zwvt0SjAcf2UJlierMVG32ANzdYXQZOBmkNu+pF6/2Nu 08VotRmAvidLZEYrJxBlUHgD1uwAPoJXHgqxoBPwFAEaY2Sh2RDDVZQ2VvQQguf75o/E iCGhUL7962x/u30TLiowhyrLru32uWGRSqJYehxvVS5riT+LP8vhctRzglO09lLSAwO0 q9WMfYLc3lq2mXLLz8s3Yh7h5sWQ/rS1g2Guji5omNfkQTWjp0EahdvpQvSo9Pt93PGk dxnQ== 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=T+qbueQADK/vfjH9sg1vNkUW9Au5lmMPxG4EP03Vc/s=; b=YCoM4bosPuCcAxo4erSh7Fq1nEKzMqC4ndq7ItDQfrTPtehsRyrn6EymRFZc2LuEnh MPWuI9oRZkf5pRKjRGiWBgyan5bQ4SdGAyV95Aj3+9YGCP+L2JSC1eZW9YxZy/cNJ/bs TqIqsMVGu/lxd87J5Y5n8mSz4z4RsXr6uJ8gwfJB+SY3eNJm6a6L4vuDVEh/Afi3laJt iuyqKFTw2IABqzYsI9DgEgAjup0ZKyR3SHyxbBIGaEhwqC0gsuao19+WnlDx9sE5aHwE WVBz91kRGjlwORMJ4PlA4oGBR8UJE9kJhDusM90BvS2boIcs+rNg+0nHItP24KlP+til soCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aySD4yBw; 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 s15-20020ac85ccf000000b002e2051a44fbsi2650198qta.286.2022.04.17.11.00.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 17 Apr 2022 11:00:52 -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=aySD4yBw; 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]:57172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ng9Ce-0004dr-GN for patch@linaro.org; Sun, 17 Apr 2022 14:00:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ng8x5-0000iq-7g for qemu-devel@nongnu.org; Sun, 17 Apr 2022 13:44:48 -0400 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]:43921) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ng8x3-0003Jm-3E for qemu-devel@nongnu.org; Sun, 17 Apr 2022 13:44:46 -0400 Received: by mail-pg1-x532.google.com with SMTP id u2so14950417pgq.10 for ; Sun, 17 Apr 2022 10:44: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=T+qbueQADK/vfjH9sg1vNkUW9Au5lmMPxG4EP03Vc/s=; b=aySD4yBwds8m94r8eX+fNpZnJzukavDjz6GWEEYQXcYuhW+SoTf11yPk9b9FSLiRvQ /dQMLgqdOKfTCSyYfG8lWeS3HNNyZH6WiBiFBElJrP3xx1ttzlWfGvNxv7ke2dFCWwMy lEcoZ5auKUOCfGKLqw5Y1akblshYbXERu95YWjXYXvWftvuWQboERDOLvLB3/R09h/rg LNo2O17hMSrvV06vy7OYmCl2yKSdFcujSkET3q/XodSs0nQe4b+VmEZJLky+xgWDmBK+ jV/On1JngCVBw9VBqGYDrTuoRYDhxNJNqgnHcv3TQyNT6tUQIZFyoOruIagcYiSZFSG4 LiwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T+qbueQADK/vfjH9sg1vNkUW9Au5lmMPxG4EP03Vc/s=; b=0MXRHiUMoTlHyz8mAmOtu9YRI9sh0R5otays0b85mPjWBEpPFkaKCtNhG/jm+LBPoN 9n1hVj88TtF1SPaUR3gnzKBbo2NUAc4Oduu/VlgV8xlHN99evBRFc/NP2hXH+9ZOWB0r ChxmtbaoW92XakWiLSxE7GZ1VNGJTQQbv5dK9SlDzNQOweE4RBpq8kysvMixxzcXOUxF MNy29FFf3quIYphhdtelsEJL+Vk8gB8z+WI3C+p92GR81XNxA2kYQ5kEawk3UmxKxmLv 166TagvDwn4PWgonubbDuJ6//Nk44Y1k+z5dC+eoTzemADtm9t7uGl2fsbx69xT2J7N9 CVHg== X-Gm-Message-State: AOAM531waYB1GAqgiRJm6Q6jJJSZaaYnoh16YYIxXUJGxTCuTYsNdTAm 6TwnSbuPydMqX6Ch5quxYeiksoJtds3jvA== X-Received: by 2002:a05:6a00:b46:b0:508:2d0f:9f83 with SMTP id p6-20020a056a000b4600b005082d0f9f83mr8308075pfo.80.1650217483604; Sun, 17 Apr 2022 10:44:43 -0700 (PDT) Received: from localhost.localdomain (174-21-142-130.tukw.qwest.net. [174.21.142.130]) by smtp.gmail.com with ESMTPSA id i2-20020a17090a138200b001cb6512b579sm10372119pja.44.2022.04.17.10.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Apr 2022 10:44:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 16/60] target/arm: Simplify aa32 DISAS_WFI Date: Sun, 17 Apr 2022 10:43:42 -0700 Message-Id: <20220417174426.711829-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220417174426.711829-1-richard.henderson@linaro.org> References: <20220417174426.711829-1-richard.henderson@linaro.org> MIME-Version: 1.0 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The length of the previous insn may be computed from the difference of start and end addresses. Use tcg_constant_i32 while we're at it. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/arm/translate.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index 8d6534f9a5..e1c1dbc563 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -9870,18 +9870,14 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) /* nothing more to generate */ break; case DISAS_WFI: - { - TCGv_i32 tmp = tcg_const_i32((dc->thumb && - !(dc->insn & (1U << 31))) ? 2 : 4); - - gen_helper_wfi(cpu_env, tmp); - tcg_temp_free_i32(tmp); - /* The helper doesn't necessarily throw an exception, but we + gen_helper_wfi(cpu_env, + tcg_constant_i32(dc->base.pc_next - dc->pc_curr)); + /* + * The helper doesn't necessarily throw an exception, but we * must go back to the main loop to check for interrupts anyway. */ tcg_gen_exit_tb(NULL, 0); break; - } case DISAS_WFE: gen_helper_wfe(cpu_env); break;