From patchwork Thu Apr 21 17:31:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 564413 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp638164map; Thu, 21 Apr 2022 10:32:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzY0Hg/KP8W/tLvMTw4rY9SFSOigPEs/1BrzUHa97cXWtNYHk/TL+OPH1vvM+lbMo748duQ X-Received: by 2002:a25:1ec5:0:b0:641:1bf5:d4ba with SMTP id e188-20020a251ec5000000b006411bf5d4bamr787086ybe.410.1650562353608; Thu, 21 Apr 2022 10:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650562353; cv=none; d=google.com; s=arc-20160816; b=dOtB+9P1jOMVZ0d+aM6vzPtFZluVGGcB5+H/VDVhSbIzqkLK+rrcTyLqg/N9ACjN6w 3CFVOuETTmI5OnISBDGe05zNuqKFgEpzigSWjZhkTQ6Olk9xlGgMRivu0UzORSITcOh3 2fRk6PxFeaOlOGwUX6vVY7KVHGCJEuEHEny3riVKDpcdB8pElmcDHrixov2O/u93guRN RUntlH7p4q1bGX0tFFgkgC8TdX1Fp/OH0kUjjNJTA+1QYu+ZbhdZ7ZuCcnVvWJflcrF1 NFR80zd1/TMmwOqQ569g6vPO1UmKMfEQS0Ta/YLvR5BqDF71Z2ucEVG7G3OmiPODwz4S iuKA== 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=OmK70uiREJ2EhU4Lvb4b2S9qA2vGg02nV1Dgbo7HTZ4=; b=Lgwd1cL1reQjWw+sMI/6Aw32rwjPGDEV0QYQUjYvLa4As05SHF7NP1jFYm/P9ZaMTX qEDyKSo4Aoq7aGox2oO2NYw0G1Unl7FnopIHRQxY0nNNYK/WZPrLqaHgPhzvdkqsvdIh CBDcmrSeQf8LV0geYhXx+nHGJ3Bvos10DtnfYNm4u8q5wkuS7rBpDFiqQ8Izfyk3QU5A wX3XxJrwHanXFowhT7WMNnmnPyeDvWxLT3YU7mz9SbHms8dvScamuh+dMOhkC8BLHCky XA/gdt00S4poO2mOXpMQC+cog+HiydqurYEX7BpWUQ8jEPgJWKP+9TJdXWvyUZvySU8M pPPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NW1/SYwp"; 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 s35-20020a252d63000000b0063dc271cfafsi3037314ybe.30.2022.04.21.10.32.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Apr 2022 10:32:33 -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="NW1/SYwp"; 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]:45878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhafR-0000NI-3I for patch@linaro.org; Thu, 21 Apr 2022 13:32:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhaeO-0000Eu-E7 for qemu-devel@nongnu.org; Thu, 21 Apr 2022 13:31:28 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:54173) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhaeM-0002vu-Jn for qemu-devel@nongnu.org; Thu, 21 Apr 2022 13:31:28 -0400 Received: by mail-pj1-x102f.google.com with SMTP id bx5so5570555pjb.3 for ; Thu, 21 Apr 2022 10:31: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=OmK70uiREJ2EhU4Lvb4b2S9qA2vGg02nV1Dgbo7HTZ4=; b=NW1/SYwpjh52t+Nj2ETfEJo05opBXq1DI+yxhb/jC9OlLBH80QgWOXIRQaYaZO3RQp GE2FH0uL1L7ZlMKBNCwzWSreYwS4DC1F3zqZ0MeUjM8w81f4DziWc0RUVMiTaL+UgAE1 OP0zJM6gEI6jCyeoZ9dUNUMzM/REJ751kmuDk/QqYTQVAn16BpNxVkNErokYxHJem2+Q fMqXSCh4vpkhft7bxPZvBYNWhFnxCoblYjV5/wGEjzFfiitujZrrNNGtMGzInIuhuiQu wmT+F50k5Qf+hGCtfxzpsarxASKJOALcBbTdK6ma3FQD50Fah7/7Yy/k6xUe2i9XriCq n74w== 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=OmK70uiREJ2EhU4Lvb4b2S9qA2vGg02nV1Dgbo7HTZ4=; b=7PIwZSlf/1yMy0ktpOBOr4c6qlkAKgfMWwtpHhrXvTIsIw+Nhg9/U66+4hvQdflQCO r/d+AVMcYl9PVTD/vMVgB0oayMb5ytNoZY5eC4Hvidik+/uwlhqfVGnhqZwbmJqJXrl7 s0oFDn4mQ0w0lkug5v+W7DxMJR1BQgHEiq46wehtiW2TMh9LBmwFBvNzFw1eMEvZql9O +zEGfHgKdZykMbbUF0C3b7FgzXdvh9mjJcRyvqIia61F+Py9QO4EWnNH8OLABf8bjNYd AeQWrxIBbnTC37ubFbrLjieYp03aHY+PsDQV1WTfNMJcgm3eT1u8Mc3pACaPzdEvCJy8 xGSQ== X-Gm-Message-State: AOAM530vfUkeX/LlW59CBiVtiaaatcsPxYJ/YfFxlJ5r9kL6jlrhPC5S 4Iqji7wF5832sYc/+czzGQr1MKz3RQWt3i48 X-Received: by 2002:a17:903:1252:b0:154:ca85:59a0 with SMTP id u18-20020a170903125200b00154ca8559a0mr552890plh.169.1650562285278; Thu, 21 Apr 2022 10:31:25 -0700 (PDT) Received: from stoup.. ([2607:fb90:80c1:f8a5:3d1f:84a9:7713:bf09]) by smtp.gmail.com with ESMTPSA id 204-20020a6302d5000000b00385f29b02b2sm23557644pgc.50.2022.04.21.10.31.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 10:31:24 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 3/7] target/rx: Move DISAS_UPDATE check for write to PSW Date: Thu, 21 Apr 2022 10:31:10 -0700 Message-Id: <20220421173114.48357-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220421173114.48357-1-richard.henderson@linaro.org> References: <20220421173114.48357-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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: Yoshinori Sato Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Have one check in move_to_cr instead of one in each function that calls move_to_cr. Signed-off-by: Richard Henderson Reviewed-by: Yoshinori Sato Message-Id: <20220417165130.695085-4-richard.henderson@linaro.org> --- target/rx/translate.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/target/rx/translate.c b/target/rx/translate.c index df7a8e5153..bd4d110e8b 100644 --- a/target/rx/translate.c +++ b/target/rx/translate.c @@ -368,6 +368,10 @@ static void move_to_cr(DisasContext *ctx, TCGv val, int cr) switch (cr) { case 0: /* PSW */ gen_helper_set_psw(cpu_env, val); + if (is_privileged(ctx, 0)) { + /* PSW.{I,U} may be updated here. exit TB. */ + ctx->base.is_jmp = DISAS_UPDATE; + } break; /* case 1: to PC not supported */ case 2: /* USP */ @@ -631,10 +635,6 @@ static bool trans_POPC(DisasContext *ctx, arg_POPC *a) val = tcg_temp_new(); pop(val); move_to_cr(ctx, val, a->cr); - if (a->cr == 0 && is_privileged(ctx, 0)) { - /* PSW.I may be updated here. exit TB. */ - ctx->base.is_jmp = DISAS_UPDATE; - } tcg_temp_free(val); return true; } @@ -2205,9 +2205,6 @@ static bool trans_MVTC_i(DisasContext *ctx, arg_MVTC_i *a) imm = tcg_const_i32(a->imm); move_to_cr(ctx, imm, a->cr); - if (a->cr == 0 && is_privileged(ctx, 0)) { - ctx->base.is_jmp = DISAS_UPDATE; - } tcg_temp_free(imm); return true; } @@ -2216,9 +2213,6 @@ static bool trans_MVTC_i(DisasContext *ctx, arg_MVTC_i *a) static bool trans_MVTC_r(DisasContext *ctx, arg_MVTC_r *a) { move_to_cr(ctx, cpu_regs[a->rs], a->cr); - if (a->cr == 0 && is_privileged(ctx, 0)) { - ctx->base.is_jmp = DISAS_UPDATE; - } return true; }