From patchwork Mon Oct 14 10:49:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 176162 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp4359045ill; Mon, 14 Oct 2019 04:09:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwoEjekOyTBjpz7tIQ5SNlyqec/s9z1qS2JkHirn9+fGK0KgFdHutQA98uWgzcOsaoXc4OL X-Received: by 2002:a05:6402:28c:: with SMTP id l12mr12446059edv.145.1571051343681; Mon, 14 Oct 2019 04:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571051343; cv=none; d=google.com; s=arc-20160816; b=ecMmORCwmD0NN8mgpZZ/kdVxErXG2prmtkQ0zdfFTyu/BkNXUf5PKBQx7gQGs8J22Y c010AnruL0b7RtHsdg3QPtt1P8udh5ifRKo5hT9BC38VLmbP46bmG3W2nr5x/OEmMco6 HuqxRqZsDL1Bw21Bbe/2dhgTGjV5vAnYBbTNL88X2R1ssmzsu9eWsf4dr15oaajkK/j/ n9hnXgdebbPzEK2RmIkhuZMzWB2H+XSQs3jZz1pZkTspBuUhjbc1IVwOY2XZQWLUOuuv OcFRpzc6Ex3z3y7on7ZrJZpU4IMSf9w0q2XxS58LohrqhdMVy99E3VTtPLCcss/9iD5E EASA== 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=m4scFyBAux7omI9dWRwoni82M9uy+xh8rsre9KWj8Gc=; b=B3gbFlgQjjLGPOZJUYp+eDWez8iFGoepTX6HamqAdd3XnGNwU0YJoxp5qVCI/I6iwe neosaWuTyfRPLHzfn3ihCZtCUL/O3GsOrIWYP7bbCzl1/S5HsdhLFwb6qP+lKKCihLa2 u5WzPiHZteqV3khQf/ZOmAbTNUWkLk3zFnpnD2DET+j7GJu6hsdjRlRqwa+7g98U2qHh mhtf7XkmuOfHtCa8U2Apzqf6ONpKRK8kNlIMNl7gNU20r/TbEApy9a1gbVa2eM4xS8To DeMnJ18jIRoDysVAHM3tsWD7dc0PrI0iNkC7nLuuBNU019HHXeb2+L1ZWVmlnom+z16t tkwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ixzKDEDq; 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 l22si10239435edq.174.2019.10.14.04.09.03 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Oct 2019 04:09:03 -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=ixzKDEDq; 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]:47440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJyDm-0001HL-3f for patch@linaro.org; Mon, 14 Oct 2019 07:09:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44568) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iJxvQ-0007PQ-0z for qemu-devel@nongnu.org; Mon, 14 Oct 2019 06:50:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iJxvO-00069e-JN for qemu-devel@nongnu.org; Mon, 14 Oct 2019 06:50:03 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:35669) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iJxvO-000676-9t for qemu-devel@nongnu.org; Mon, 14 Oct 2019 06:50:02 -0400 Received: by mail-wr1-x444.google.com with SMTP id v8so19151213wrt.2 for ; Mon, 14 Oct 2019 03:50:01 -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=m4scFyBAux7omI9dWRwoni82M9uy+xh8rsre9KWj8Gc=; b=ixzKDEDqwTfH2etxANMqaOVs1pohVls0R5oSxR4AItQcP65hF/1gn8eyJpQyNmR/qy Ow0NiVv15FZLuDw+6UV4gM17Yj9ayWZYLeljmkH6l4RkdlD/AmwoYodIiRWdQfv1Yhqz e6Yjseq5yZgVd5PHNtM868lt4Wr/QmfUWkdRyjw89hW4XxnwItjM5pBGZ4LBgZYtOxK9 tOp/zzk5+P5HJ2Z73Fz0/WMWau9brkPoI+526urBDXvmHAHTTPnvaXl6IMdrNgslNkBU w/IoLmrOALBWd9906EO0vSlfz0bqVJ0UW711SU3HRUXpZpX4Zpx9y5Qpl4yxHUFh+NhN LOBw== 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=m4scFyBAux7omI9dWRwoni82M9uy+xh8rsre9KWj8Gc=; b=cn3J6ZWccHz3M7K5RjAt3veHjCFTeuy8wuuGBTn0IZIgfgh0HfjoeJ5YAWW2JkRfe+ yiHdnloaa6n5Ko32BL1M0Fy7rYdVOstUClzey8C78o5UVUBKYfj79cXDoeJtPD8ayxtx 6bHr5MG8WuELpbOElb9iHOt6b0R3dp8lk2LG+stHveXeFU7k+OgcWLj94I27n4NqEBQo 2MqAOQu7Q89fRIsCd3RI7SELLRMWJaC+DpG9VcthriUwfQowHEEUbO7VxwpXY9Z0pMxz BOuTfdhvVxu7SLW2oitw2ko7Wo9AkU0L3DNKcty8Vkajv0ATqrlmMVZqgpE89+QkDllF F2Sw== X-Gm-Message-State: APjAAAVmkw7RZJMmppf02b8/eftt+1F6rD8FgJMIohLz98DSPbW+SPoT m9GPkx+v5MpnLEGCBiGBv4IUQg== X-Received: by 2002:a5d:50c9:: with SMTP id f9mr24181232wrt.36.1571050200337; Mon, 14 Oct 2019 03:50:00 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h17sm14980217wmb.33.2019.10.14.03.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 03:49:55 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DB45F1FFAC; Mon, 14 Oct 2019 11:49:54 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v5 24/55] target/arm: fetch code with translator_ld Date: Mon, 14 Oct 2019 11:49:17 +0100 Message-Id: <20191014104948.4291-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191014104948.4291-1-alex.bennee@linaro.org> References: <20191014104948.4291-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 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 , robert.foley@futurewei.com, Richard Henderson , peter.puhov@futurewei.com, aaron@os.amperecomputing.com, cota@braap.org, "open list:ARM TCG CPUs" , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Now the arm_ld*_code functions are only used at translate time we can just pass down to translator_ld functions. Signed-off-by: Emilio G. Cota [AJB: convert from plugin_insn_append to translator_ld] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v4 - use translator_ld like the rest of them --- target/arm/arm_ldst.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) -- 2.20.1 diff --git a/target/arm/arm_ldst.h b/target/arm/arm_ldst.h index 5e0ac8bef0..45edb108f6 100644 --- a/target/arm/arm_ldst.h +++ b/target/arm/arm_ldst.h @@ -20,25 +20,20 @@ #ifndef ARM_LDST_H #define ARM_LDST_H -#include "exec/cpu_ldst.h" +#include "exec/translator.h" #include "qemu/bswap.h" /* Load an instruction and return it in the standard little-endian order */ static inline uint32_t arm_ldl_code(CPUARMState *env, target_ulong addr, bool sctlr_b) { - uint32_t insn = cpu_ldl_code(env, addr); - if (bswap_code(sctlr_b)) { - return bswap32(insn); - } - return insn; + return translator_ldl_swap(env, addr, bswap_code(sctlr_b)); } /* Ditto, for a halfword (Thumb) instruction */ static inline uint16_t arm_lduw_code(CPUARMState *env, target_ulong addr, bool sctlr_b) { - uint16_t insn; #ifndef CONFIG_USER_ONLY /* In big-endian (BE32) mode, adjacent Thumb instructions have been swapped within each word. Undo that now. */ @@ -46,11 +41,7 @@ static inline uint16_t arm_lduw_code(CPUARMState *env, target_ulong addr, addr ^= 2; } #endif - insn = cpu_lduw_code(env, addr); - if (bswap_code(sctlr_b)) { - return bswap16(insn); - } - return insn; + return translator_lduw_swap(env, addr, bswap_code(sctlr_b)); } #endif