From patchwork Fri Oct 25 06:36:40 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: 177658 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3272396ill; Fri, 25 Oct 2019 00:20:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvRyo5+cCW0iJlpD0R32QZLGqUmuiCvRJ2KvKo0MQDUReQX9sNDv+XKoCnWkL3j15vHk5F X-Received: by 2002:a50:aadc:: with SMTP id r28mr2274502edc.107.1571988011278; Fri, 25 Oct 2019 00:20:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571988011; cv=none; d=google.com; s=arc-20160816; b=AXv5fWZkQHTtY+NVowrfV7LBUBfbOLtOi63XGqmLBKuLj7eCBrkUcIJkcSSQXQt/UO jjZNUtzJPRsewGBlDXYfPfWKHh3EX4Art5P+kXZPW0hDkyVViL1HYNEk1EgaTxncPrAb FS52wAiJRf0PQ7Ie1xAjRaMR1lR5pSFYAmABddnXCkRPDNUAZ8QwpmsbO4bqvosl8srL zv/kmIgGxJDyL7pD43lcfNUU70abDz0e2puiy4eshz12RQxDvExoEoynw5CTEwjl01qw /VEWk3uGvj8XavM8GF/gB52IuDsmj0UJP21Tlk26lm3kXUhz4u2uTN2OxIx3p4nT42/n ICtQ== 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=U/q1GG1kwgwOT4ErsA8UxTYQsC7aPfxd1sGDgtCJFgc=; b=YYa/8AtEiOi6Srq2FJjW+GKF3qT5ApK8F4uTyan9gJWraCcsgqVsTdjOAMc9Aw6zHc JxEZZ/JVPH2iJ2WskPEULKkDyImgsoaThDkxL14oVAomXRb7JplDV26wm0IrcX2jNYW5 v3o1ngV4t2QB6drwixakMYdu9M5oy2FPUJRKrCusxre1rV0g4iIEZw0x6MShKVzfz9cd WoPafe9YhjMK1ypUjefOJXOJ/EOTfizp1mARpNMk44+CGgWM9u5jYWdtAAzO61OP8ah9 +h8jAHcRvO0ATXjhvqk/aVgKpeh3LpldCHEmu2TMoCLHLt/Nesd62Xgt45GOjIPH+dPz UCrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KLIDlxNU; 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 d6si675157ede.119.2019.10.25.00.20.11 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:20:11 -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=KLIDlxNU; 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]:56658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNttJ-00051d-LO for patch@linaro.org; Fri, 25 Oct 2019 03:20:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36912) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtMr-0007nU-57 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtMp-000384-R6 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:37 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:52999) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtMp-00037V-K4 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:35 -0400 Received: by mail-wm1-x329.google.com with SMTP id p21so785890wmg.2 for ; Thu, 24 Oct 2019 23:46:35 -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=U/q1GG1kwgwOT4ErsA8UxTYQsC7aPfxd1sGDgtCJFgc=; b=KLIDlxNUJlIxZFmWN1MrzXnVXNZPTZlJuSNIKa5NtxLSL7TcSOy5XqPrMYB2nzCrWA N6kWE1j7IcD335igkmzUbRz4akfz0FgvyEt5AunuEAr/QQpnGW8Ow78gAR/NqFMzdSaE qJb7LBP/9/IvAob81XZx2mynxOqUf8TnxU3fYz5Xy7sN11hjzuey+D46PXD3AFtSzp2s MkYUPVhzz9HYXW93AW/N3zmnl1WsG7DryHH/oHnW4GnDvvGUOXh0S2AI6TVb4q7rWfDZ A5zM4zaWxxG1n3B7n195XV5Me5zhMQ3qtA4TFqriyQfBvdpWapNi2xVS3BzjhFKuFH+y /f8w== 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=U/q1GG1kwgwOT4ErsA8UxTYQsC7aPfxd1sGDgtCJFgc=; b=nirL+tCPnS8KQeM1QKgC6UBWW+bSQhVbrR1Adll2t4uxsLkUeNQ2djTmK2OdXHUbYY VNjni0RpYTC0gWXseLBnR7KGNP4murckrwve8s2i8g86UZpusCMprKFvfzGcJU4sI+vr JHUkEcrJb+2qFCREi/4ACVfO6JAN96yVetYLx+NO8Q1u2mgBUss2TkqgiSOLfTz/dr4j Lf4dXuI9sXeyepnNnfy1Fn1laBcZ3x61+qaE+rjllPYbXqAS0Jy7WpfUJTkfRzsjq+d3 0fbj26TZ7u1ARapsEvmG1qCynhoj+X+kehYwH5i90l1Gz+CShKDj59HSw5hrQ8019PXp XjIg== X-Gm-Message-State: APjAAAVTpmGoTKTWS33vw9Sfjf3fVdIEZuKBKQA2SFv/QYTCSk6dUZwS o+UY+CCTuBgIVLZVMDzswiXpFQ== X-Received: by 2002:a1c:7e57:: with SMTP id z84mr1964935wmc.84.1571985994414; Thu, 24 Oct 2019 23:46:34 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q25sm2634668wra.3.2019.10.24.23.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 93FBE1FFC0; Fri, 25 Oct 2019 07:37:17 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 40/73] target/arm: fetch code with translator_ld Date: Fri, 25 Oct 2019 07:36:40 +0100 Message-Id: <20191025063713.23374-41-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-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::329 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: Richard Henderson , "Emilio G. Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, "open list:ARM TCG CPUs" 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 -- 2.20.1 diff --git a/target/arm/arm_ldst.h b/target/arm/arm_ldst.h index 5e0ac8bef06..45edb108f6a 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