From patchwork Thu Oct 17 13:15:44 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: 176625 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp945518ill; Thu, 17 Oct 2019 06:41:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbRG0uF5cB1Uvfyh7KP4lVOyfYJRKV7c3cxkDS8iYXthXUDJM86E7ynImi0LaBUvvJiPA1 X-Received: by 2002:ac8:363b:: with SMTP id m56mr3931114qtb.22.1571319713541; Thu, 17 Oct 2019 06:41:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571319713; cv=none; d=google.com; s=arc-20160816; b=DayWikMVFf2Y1gz5+fkr3RBTU0anm6KrDktZ0YPljako0Xej0B9HGJL9SGk5T+7lbR 2V8y6qDOvB3LgNX02TfhaI4P21bDSjqxPx8kJkIvuz7OdNUPNsqlS53qPi2YpzH58cuO U6oZUIb5hU9qRRrxA2io8qmzoK0uybhVLo6oJIQHYxVKmLclDJFRvrMd1S7PSjRYLBez xtHgNkqO6PqDAatL/RlsJudjmtHX0tj2PvScd4QV8HZLGg4qzeH6l22nEsMmh4AIdW6L IzlELt51Gwj+MjbdzAqNAo1d7fymBdJdl/Xbp2Qe0sMuojGrKBo9H9kI61oh6kBIqYQj D15A== 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=yS72b19HdIEeUw0g2ykHZ9qRzc5Rbz6SYOP5nsOCPtoH2fkamvNZf9QOxwBdqua3wf ercLsSsVfOuelGOe9fY4kfr9vX03VNvOv3BNd0PKYFDR/mEEiy3/XpgY5ze/L3h6o+Kk vEguDd6bb2fVqQlvKyBA5iF344yYvDKPS7jQ6mPCrxzprXNiKrm5KQHif3zE9PQIcgFU 5xWo91jbJ8YknCkqhcFZyzmMNKNcQ56tAgCAjjxzLiTJuhWU/3n8oy3C9HphQa0mUb2+ Qj0r/5wxkfct3Ara78X27YkxMsERMkiLBASiyqABjr4YyKthhMRIBO1pyEZAUKla9r5e gqUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=d7iit7GE; 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 g48si2324106qvd.146.2019.10.17.06.41.53 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Oct 2019 06:41:53 -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=d7iit7GE; 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]:48176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL62K-0005JW-FB for patch@linaro.org; Thu, 17 Oct 2019 09:41:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33982) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iL5dl-00088E-Su for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:16:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iL5dk-0005UY-Eb for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:16:29 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:39881) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iL5dk-0005UA-8M for qemu-devel@nongnu.org; Thu, 17 Oct 2019 09:16:28 -0400 Received: by mail-wm1-x343.google.com with SMTP id v17so2489104wml.4 for ; Thu, 17 Oct 2019 06:16:28 -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=d7iit7GETkguplVjVDK03X4AncYDzTUIS06y+tddHAa7DpB0mxXcW95msDS4wuBsW1 tcc8Gorj54E8srltNxdoPb+LFFR31jKTAxyk7Qxigr8eVRgktV3Te2TWy6IG9Zrl7xbY 3HEBezqm4cR6GmSgzzMzeDQzpZ0JOzivxmt6cHosXFrY8aBt6pDm17muDBvdLPk7ojFL /MsIj5gmBU37jH375hw0spuZCcuZnv41jwLjBHOQhi5+EOQ44Jj955XTsE5pm9Fy5/FN dPxsjbJe1g0YKZnmYk0OSbnfNFg7yXgvjb7t5yyrUQDE844LfNFO6k429xX5twsPR6yS XwfQ== 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=Kegx+JXwEzWS8bT3oUducbNjuXzPNz9ivMIlj6U137gv+8Qb41rUEprGpnnNZHsmMl 7QmH3w6kvEKLvR3QSU0/dqcI3UIw0oi8HxRJquD3gnqYFjWDvzkdhgneI8h+SfvlZNnV Sq8q5xYX7R1oxJmoUwUOVu7WSexaivaaAzHjemPL0fXd4LyINqsw6BstJPn1o4VV9qF6 n/tI4dz8e2msI8hbSHiB0jDSwMK3B6eeadekq7Ecfe+b7+GtiS+Ne6/+M9FyGjNpqaUt 71nn4TJqdR/9EtGXE0lpQ+lkMLNGg5aizUOxW/DooNcuXxv5yE4RyMJzGldYasSWFevu +VOA== X-Gm-Message-State: APjAAAVRVf2qKYmhoxFUxQ8yzW/e3dhhfZZ6uOQ0ve906rG9qjGsWcl0 igsHRYNJFSkhUqgtvUAq596KiA== X-Received: by 2002:a1c:6308:: with SMTP id x8mr2901372wmb.140.1571318187069; Thu, 17 Oct 2019 06:16:27 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id u4sm3062810wmg.41.2019.10.17.06.16.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 06:16:26 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 207D01FFAB; Thu, 17 Oct 2019 14:16:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v6 23/54] target/arm: fetch code with translator_ld Date: Thu, 17 Oct 2019 14:15:44 +0100 Message-Id: <20191017131615.19660-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191017131615.19660-1-alex.bennee@linaro.org> References: <20191017131615.19660-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::343 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