From patchwork Fri Dec 29 06:31:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 122903 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4330757qgn; Thu, 28 Dec 2017 22:45:03 -0800 (PST) X-Google-Smtp-Source: ACJfBosier3R/JNZ/y1Fv7l4n7hgvhlxqfkezrSlO75yCdR5vfXPIGQf19ARk3Ofqk+a8nEABiti X-Received: by 10.37.209.143 with SMTP id i137mr24690011ybg.335.1514529903830; Thu, 28 Dec 2017 22:45:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1514529903; cv=none; d=google.com; s=arc-20160816; b=I2OG20y1sErF9i89c+hhL5AxFYs6I0YYZAAmcO9h3s+0PFbqSGEI4uTH494HLfLrGb FNVnv4r3vZ2tFZUuOZOhbvoylnQugFz0MNInbfmsr9opI7xVsXyroEmnpjgK10Bm3gbw TZ1jSyuBTi1BkRFld2QyMfAy9uUTZW3xrZ5b0t4MElQxE8CIYvqH+olylRgDKBKjHQwQ tqESABwIXbCTAtOFSfG9BXpo3h5L0H3Njlb04zYZPkLwCIje4dP96cQw16uUNvN0h4xx xPqsNgUgmX9a/hCZ/jWxj/D9ILux/xGSn+kKmdnpibne5U4nrooIcmrkF0Xs/+rR97Hg BWrg== 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:arc-authentication-results; bh=I0br1naNpnDN6lCA/58eSfRFYNThk3/IKjXVF+G5RjE=; b=BkL17ap/r9p2jNtzBOGR4LTT3YPJgz3MszzBO2eoDRquGzTlpECt/IHwRStrbsk1sE nM5+2GtHQmu2bD3nz1UIEDUdu/wmW9hXYB7ykY05ypwD5OPsVBzJ8F7SfvqKll8xjsWh qSYLP8aIcW+vpgO9BPCGNtRANWrC31x8x4C1yxoMXkXvGk/3jRz1pS9b7OdoAfnClE0Z tU7ph+om+15OJQwBCyhl3d25QzEIa/w3nPqXokotLq77mlJ0xCYn/1WVFKOReyg2mhs5 5QgpOlwe7jSTlvn4SuiWaUdbnp4tuB6thlqiBKlHxiXQQ1npal+6Xz3wrRzrzpLhPt1p 12Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=a+5f2jmo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id r196si6766484ywe.581.2017.12.28.22.45.03 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 28 Dec 2017 22:45:03 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=a+5f2jmo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:57000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUoPf-0005IQ-7M for patch@linaro.org; Fri, 29 Dec 2017 01:45:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUoDO-00038S-AU for qemu-devel@nongnu.org; Fri, 29 Dec 2017 01:32:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eUoDN-0004nh-Ac for qemu-devel@nongnu.org; Fri, 29 Dec 2017 01:32:22 -0500 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:33813) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eUoDN-0004nT-4o for qemu-devel@nongnu.org; Fri, 29 Dec 2017 01:32:21 -0500 Received: by mail-pf0-x242.google.com with SMTP id a90so21833556pfk.1 for ; Thu, 28 Dec 2017 22:32:21 -0800 (PST) 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=I0br1naNpnDN6lCA/58eSfRFYNThk3/IKjXVF+G5RjE=; b=a+5f2jmouOna2I+A91mJuoPFF1C3u2zVufnM1w80KRWTuP+RkYV5zGTg5WxI6hOAv4 E0kJjrmLpBKutswuxZu3TaXpBbOvWzWFN5gYY0vKzVvRNsQyjO2cNXJWv9B2EGbVe738 OlJwRXedQUXH6uhhpX0ry7AXX9UWd5Wzv92X8= 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=I0br1naNpnDN6lCA/58eSfRFYNThk3/IKjXVF+G5RjE=; b=Pw8mqdG7S3zRiML0E21CW5bCuK0Q5mcDzQL188aq1tXdYWSuijiFBJzXP2GgTt/QQV iGajdKg76UJH3cn9MSfc8tVpc1NEaE22rgbaQKdroBNAx3XonuvYuLpSfUv6Qo0N9h7j 7BUe8f2s0io+3q3PQDSRFz1N3MltVW7c6lyE0m2ZwUX1p10+9vu00uZVTDnE31XC7gzH l7SzMmVFjG0NRWkERWPw8tH1qSzZvarD7LJp2u6+3QJnuTJyLhZCMzPAmsFI/HPFrLky iiydShfl1DXN+eqBr27isq2UxoxNs8OYiyb37OaJsHsl4ZhQDbFVu41jNStlwIU+RHaM Gb9w== X-Gm-Message-State: AKGB3mIpNbSzJJZPDnaZpf+2CC1dwh0jUU6ANAGRNgFcrdb3ANYj5Jbp U6mu77zYPoLel4XonOWgUJjmX1pbjoo= X-Received: by 10.98.58.29 with SMTP id h29mr34193316pfa.121.1514529139928; Thu, 28 Dec 2017 22:32:19 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-183-164.tukw.qwest.net. [97.113.183.164]) by smtp.gmail.com with ESMTPSA id c28sm76539063pfe.69.2017.12.28.22.32.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Dec 2017 22:32:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 28 Dec 2017 22:31:31 -0800 Message-Id: <20171229063145.29167-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171229063145.29167-1-richard.henderson@linaro.org> References: <20171229063145.29167-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::242 Subject: [Qemu-devel] [PATCH 24/38] target/hppa: Implement LDWA X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: deller@gmx.de Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/hppa/translate.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) -- 2.14.3 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 2c3c582913..ef953cd1d5 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -2945,12 +2945,50 @@ static DisasJumpType trans_stby(DisasContext *ctx, uint32_t insn, return nullify_end(ctx, DISAS_NEXT); } +#ifndef CONFIG_USER_ONLY +static DisasJumpType trans_ldwa_idx_i(DisasContext *ctx, uint32_t insn, + const DisasInsn *di) +{ + int hold_mmu_idx = ctx->mmu_idx; + DisasJumpType ret; + + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); + + /* ??? needs fixing for hppa64 -- ldda does not follow the same + format wrt the sub-opcode in bits 6:9. */ + ctx->mmu_idx = MMU_PHYS_IDX; + ret = trans_ld_idx_i(ctx, insn, di); + ctx->mmu_idx = hold_mmu_idx; + return ret; +} + +static DisasJumpType trans_ldwa_idx_x(DisasContext *ctx, uint32_t insn, + const DisasInsn *di) +{ + int hold_mmu_idx = ctx->mmu_idx; + DisasJumpType ret; + + CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR); + + /* ??? needs fixing for hppa64 -- ldda does not follow the same + format wrt the sub-opcode in bits 6:9. */ + ctx->mmu_idx = MMU_PHYS_IDX; + ret = trans_ld_idx_x(ctx, insn, di); + ctx->mmu_idx = hold_mmu_idx; + return ret; +} +#endif + static const DisasInsn table_index_mem[] = { { 0x0c001000u, 0xfc001300, trans_ld_idx_i }, /* LD[BHWD], im */ { 0x0c000000u, 0xfc001300, trans_ld_idx_x }, /* LD[BHWD], rx */ { 0x0c001200u, 0xfc001300, trans_st_idx_i }, /* ST[BHWD] */ { 0x0c0001c0u, 0xfc0003c0, trans_ldcw }, { 0x0c001300u, 0xfc0013c0, trans_stby }, +#ifndef CONFIG_USER_ONLY + { 0x0c001180u, 0xfc00d3c0, trans_ldwa_idx_i }, /* LDWA, im */ + { 0x0c000180u, 0xfc00d3c0, trans_ldwa_idx_x }, /* LDWA, rx */ +#endif }; static DisasJumpType trans_ldil(DisasContext *ctx, uint32_t insn)