From patchwork Wed Sep 4 19:29:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 172964 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp352361ilq; Wed, 4 Sep 2019 12:33:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1hsE62SJvqzzByYIxdeeV9HgliQuiQUrJPrnmszqyap9rVX5p0Q/AeHBqISag3JCvFImP X-Received: by 2002:ac8:3389:: with SMTP id c9mr25686682qtb.391.1567625610453; Wed, 04 Sep 2019 12:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567625610; cv=none; d=google.com; s=arc-20160816; b=PVsMBAGOCUXwK3TDwu+xkYKUD7Y6WQ9m8hZPS6zBhpQDho1j0FShbZIbPKoi8XcFhE Z4IQ0UtC8x8Sl3rJTHKTMrsp9YbGilHyfSaS5ujDLYfMS75sKnFGyo/DHfvPzSyCHS0Z MTjI6HNmHtw5lAX8FaC7TegmI2TM2QHvz9z8KEsUQ0YnozxPo7cG3IG2vuI4QKMebOoY 08YHrUwavt7WxISYZK3zhDiZvZZNbHwakiDODRFxjJ4j63aQZfUst/nfRgwa7G6Qb8HM LUatxTsOd92sMpSG/8k0LpdsSCwmmymjOeFSVv+0aS7eqwiJi0R2Jx69QBGDq9odqT9n lShA== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=FjDIKcJDagE4KvmbL7+MpEBImmBNGJkd778M5x6AXXs=; b=gygjVdjft+WYfhgKZVXKi3ocQUUk86A1FwOt/XJqV0//rRRaqq33qzoIHva8UHZ2o+ nFkym2MKthf75ECmfFiNI6zh8dgabao0MU5b/yMHXYWrfd5+6lfLvxOMxF7A2XzvTmuw vFaasjqfOfIymZ2z/tbUsamcTLN6iVlJ78OSgRg5DO3JGFoGm/wrxSKd0Q/E5/hRIXWJ gTVhsNIP/a2NMiVXaRH3CAGtlytkpd74s0+g5oMmEp41C1wmxOpT6Mc8aMZFMq4WbexP 1a66oQBvzZ3fpS7BCwj+G3TlMWCbXUxUX+lE3famvEexOshCqQXWChXzcUDU3ESwYein qf7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UGBjdgwL; 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=fail (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 e3si15588706qtb.241.2019.09.04.12.33.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Sep 2019 12:33:30 -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=fail header.i=@linaro.org header.s=google header.b=UGBjdgwL; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5b21-0004XH-FN for patch@linaro.org; Wed, 04 Sep 2019 15:33:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39654) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i5azh-00042B-GS for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:31:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i5azg-00021b-Be for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:31:05 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:33358) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i5azg-00020z-68 for qemu-devel@nongnu.org; Wed, 04 Sep 2019 15:31:04 -0400 Received: by mail-pf1-x441.google.com with SMTP id q10so8851736pfl.0 for ; Wed, 04 Sep 2019 12:31:04 -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; bh=FjDIKcJDagE4KvmbL7+MpEBImmBNGJkd778M5x6AXXs=; b=UGBjdgwLFxZQx/7pCfVP8X7GevREYhNUXRnu5/WhhS3Dsv/v5o4cV4hg2C57d8LLK9 WemmVHXsSrwYfz6RZq7JkIWRNh3EoG3qdTis/hP4Euey8urPGn/7fbFaVddiXPvnPg6y qbavQnIApVlH1A50cgjvtr+dylOE/8x5OT75eidBdTUvDZWws17i1u1+pGhTYL37dA5A tHIMgUkSojAZiWhT0nxdlCTksQfTRzyjmgNl0vOzHvxaMnCuFz1KpctmTxqc3vRloKhD KCYQYEvtIoLk8YxGujIxkmEKE7zjDmhUZUhZ7FeEIlbAMBC9mQuPUxbOiiz2cPzfoo/M qweQ== 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; bh=FjDIKcJDagE4KvmbL7+MpEBImmBNGJkd778M5x6AXXs=; b=pxMbrcJN2upH5yxOwWgpu2/488/YlWN6zHCYBmSmzC0JNORPVGvkMSUkkhkX2JDEXt hD3PJ1f0e/yj21iWCcMClthcPoZxBV7gDJWlCmAQdierIZjijyyMgYqo/F3vaCxdJbCA sCFhkaS6M6yP6mMN6HrIvNq827kx4Dr+YT9WaP74ugW4Gl5jnBEN0EzZ3dpIlTXUL2R2 LRNyQhM2856wewnUCCM6quJ8CbFW9ovixFas4N42GU473Kj61FMMoNlNPBNc5+GtTkZo V85aSepT353oqMe1muFp/xtfYZJaRYiMv3qK+PWRE0RLzizunBb6kOEXrfvanydCqF9U z1Fg== X-Gm-Message-State: APjAAAVqJXci8ShJyo5LHpapqC7SX6F8dxQsduTtvvEIp/6yeCsPaDnp SQfuZ5fbFBUEdUtd9BEvMyyxRSU17OQ= X-Received: by 2002:aa7:9508:: with SMTP id b8mr31570203pfp.36.1567625462903; Wed, 04 Sep 2019 12:31:02 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id f6sm18999174pga.50.2019.09.04.12.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 12:31:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 4 Sep 2019 12:29:51 -0700 Message-Id: <20190904193059.26202-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190904193059.26202-1-richard.henderson@linaro.org> References: <20190904193059.26202-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::441 Subject: [Qemu-devel] [PATCH v4 01/69] target/arm: Use store_reg_from_load in thumb2 code 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: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This function already includes the test for an interworking write to PC from a load. Change the T32 LDM implementation to match the A32 LDM implementation. For LDM, the reordering of the tests does not change valid behaviour because the only case that differs is has rn == 15, which is UNPREDICTABLE. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/translate.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index b0d32ff8c9..a39f792463 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -9742,13 +9742,11 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) /* Load. */ tmp = tcg_temp_new_i32(); gen_aa32_ld32u(s, tmp, addr, get_mem_index(s)); - if (i == 15) { - gen_bx_excret(s, tmp); - } else if (i == rn) { + if (i == rn) { loaded_var = tmp; loaded_base = 1; } else { - store_reg(s, i, tmp); + store_reg_from_load(s, i, tmp); } } else { /* Store. */ @@ -10889,11 +10887,7 @@ static void disas_thumb2_insn(DisasContext *s, uint32_t insn) tcg_temp_free_i32(addr); goto illegal_op; } - if (rs == 15) { - gen_bx_excret(s, tmp); - } else { - store_reg(s, rs, tmp); - } + store_reg_from_load(s, rs, tmp); } else { /* Store. */ tmp = load_reg(s, rs);