From patchwork Thu Jun 13 12:14:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 166626 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp712531ilk; Thu, 13 Jun 2019 05:44:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqz49alq3e+ERD+F7/Va/NZDDE7ATz47NmUQn8Y1igmAuSTQ2D15nBHc6JcZpovmCObpbfku X-Received: by 2002:ac8:6984:: with SMTP id o4mr74534172qtq.122.1560429862924; Thu, 13 Jun 2019 05:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560429862; cv=none; d=google.com; s=arc-20160816; b=LNxN3cyD0zdzaRzMnSwLH7SkvgGwWNnDJmopbDVU+PIMaILf6wuOhu9kK7V/A8CRxS hjSEvroVBDjkiFp+TrZ9UTp7fuwpdkgoBRUhvJS/htxFn6YIH6gWtG+uWts/r50B9Xw+ ed9SKanK243/9RtfqjlG+EvxLRp5lCRS4woKIzKtCELNVjZlfkV2gZnAMMUMwa6nhR/J f0RJcjOdjGbWJltA7iWXulm7SPLYm4KlOB/gWNrETAPWqSu13RCl5yQNdHl/6WOxqKBw Um2yvTyL7XL3iSMnvDJzId3eCayoNuZ2FcBLc8XXPo4XyLV/Z36ms6FdGh3H2A+XyP1p p6AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=yJiv1hSo+fvJ6FJSmb7ni56s0cGOEaImkCLppkFYZ5s=; b=Ynnz3CfbHeQ6jFq3vyzSkb+MxqTswKZIQiS5WlzCqUEP/0G+ymQrh1bCW84P7Qi4CJ ovfYXJ1YNLZDk5UwyO8c0J2EMpOErvCatft1iAe/ICS1tbIG+1oX20bK1KFxV/zLNoJh uW5eC7nBGwFn5QakErtyH/c/IZzZPO/E7WlPdnY5irKEjmTBA/68EewvlV9v5Zdgj3Uw 2vQd9yfWBFCiL9YaNNlonRMaeDWmwrWkUeIe4wxtgNozfN+khIVMjuWsUiiWbZ+lYkGw xCh7Szzlzu4MXqBW2SkxZA2MHuljpOS4dvn2f7llYSD3VwuDyz9cmzhp4r9mGdXHDN0J 92aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EZUM8ALG; 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 w19si1848573qtk.184.2019.06.13.05.44.22 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jun 2019 05:44:22 -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=EZUM8ALG; 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]:39470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbP5a-00017B-FT for patch@linaro.org; Thu, 13 Jun 2019 08:44:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59024) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hbOdL-00080W-Bu for qemu-devel@nongnu.org; Thu, 13 Jun 2019 08:15:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hbOdH-0004Kp-GC for qemu-devel@nongnu.org; Thu, 13 Jun 2019 08:15:10 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:43689) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hbOdF-0004BZ-Cf for qemu-devel@nongnu.org; Thu, 13 Jun 2019 08:15:06 -0400 Received: by mail-wr1-x443.google.com with SMTP id p13so10426556wru.10 for ; Thu, 13 Jun 2019 05:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=yJiv1hSo+fvJ6FJSmb7ni56s0cGOEaImkCLppkFYZ5s=; b=EZUM8ALGzK54Lij/0VYowMLWDOZdXqSa67ANbDXhuAqsbOkDXbGLpCoU4LBsgmD5Mo 2iIiK7yLkZV1Ttjy+5Qtf9Sje8JiTxyfzgctb0aPgYZXH4ofucEHddhjlYBceG453YME aDIphsMJZcl3Cbiv/OOAHM0hGRCUBTmt3o1ddH6mTMZlunxnehmW8FqfjbEQFxbveSoh viacgCkRmGaP5rj6Kuxe/dN3jbq/6GXZW03e0do4yftUC7XDD7GeZL0ipydINdXAEXBe UQWnYgTiP7mnZ4/tVQX8qnUWc+X6jKRwthikzTYhUvVo1f1xBAAY2NbO4h9Kf84HJhE6 NlkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yJiv1hSo+fvJ6FJSmb7ni56s0cGOEaImkCLppkFYZ5s=; b=MvHJizA80hgkYmMgx/GsuIupWNXLIFhau0zfnjmeZoJ58mAtZfrdfuDzV22hxLUQjN UmFcR9bHtYVc6WKgYn/AnfqjcXTmzOqgUjtLMpF6trx2clevXLV9+aVYMrCRnVfpWF4I 0C46r9MeuSsOInW1bLP3Lj1kYka2qZg5rPOo2b1ivZZJyiDQboAQr6fyGtztAywEgB+v OxMsXsnzGjJFrrAi6eqiFr6LB9vYbNOMB5zGT/U9xc2lK4/cCtgeymQTghaye+4OcKG0 D+QKLYQC24J7r9V0c2jDqImGX6yiy8Ao4pVpCIx34R410eo9B5yi1/7vxAEPtwuy7Ojd Ax4g== X-Gm-Message-State: APjAAAW5e5i+tcjdVfeebIZPVus+ROi69+KhsHaCDCQDWc5MIXje/E4S vvRHElRK4O6fY5IsO/H2f1Z2QxMKzc87vw== X-Received: by 2002:a5d:4949:: with SMTP id r9mr751651wrs.289.1560428098932; Thu, 13 Jun 2019 05:14:58 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id y6sm2010576wrp.12.2019.06.13.05.14.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jun 2019 05:14:58 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 13 Jun 2019 13:14:06 +0100 Message-Id: <20190613121433.5246-22-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190613121433.5246-1-peter.maydell@linaro.org> References: <20190613121433.5246-1-peter.maydell@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::443 Subject: [Qemu-devel] [PULL 21/48] target/arm: Convert VFP VLDR and VSTR to decodetree 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Convert the VFP single load/store insns VLDR and VSTR to decodetree. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/translate-vfp.inc.c | 73 ++++++++++++++++++++++++++++++++++ target/arm/translate.c | 22 +--------- target/arm/vfp.decode | 7 ++++ 3 files changed, 82 insertions(+), 20 deletions(-) -- 2.20.1 diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 5f081221b83..40f2cac3e2e 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -853,3 +853,76 @@ static bool trans_VMOV_64_dp(DisasContext *s, arg_VMOV_64_sp *a) return true; } + +static bool trans_VLDR_VSTR_sp(DisasContext *s, arg_VLDR_VSTR_sp *a) +{ + uint32_t offset; + TCGv_i32 addr; + + if (!vfp_access_check(s)) { + return true; + } + + offset = a->imm << 2; + if (!a->u) { + offset = -offset; + } + + if (s->thumb && a->rn == 15) { + /* This is actually UNPREDICTABLE */ + addr = tcg_temp_new_i32(); + tcg_gen_movi_i32(addr, s->pc & ~2); + } else { + addr = load_reg(s, a->rn); + } + tcg_gen_addi_i32(addr, addr, offset); + if (a->l) { + gen_vfp_ld(s, false, addr); + gen_mov_vreg_F0(false, a->vd); + } else { + gen_mov_F0_vreg(false, a->vd); + gen_vfp_st(s, false, addr); + } + tcg_temp_free_i32(addr); + + return true; +} + +static bool trans_VLDR_VSTR_dp(DisasContext *s, arg_VLDR_VSTR_sp *a) +{ + uint32_t offset; + TCGv_i32 addr; + + /* UNDEF accesses to D16-D31 if they don't exist */ + if (!dc_isar_feature(aa32_fp_d32, s) && (a->vd & 0x10)) { + return false; + } + + if (!vfp_access_check(s)) { + return true; + } + + offset = a->imm << 2; + if (!a->u) { + offset = -offset; + } + + if (s->thumb && a->rn == 15) { + /* This is actually UNPREDICTABLE */ + addr = tcg_temp_new_i32(); + tcg_gen_movi_i32(addr, s->pc & ~2); + } else { + addr = load_reg(s, a->rn); + } + tcg_gen_addi_i32(addr, addr, offset); + if (a->l) { + gen_vfp_ld(s, true, addr); + gen_mov_vreg_F0(true, a->vd); + } else { + gen_mov_F0_vreg(true, a->vd); + gen_vfp_st(s, true, addr); + } + tcg_temp_free_i32(addr); + + return true; +} diff --git a/target/arm/translate.c b/target/arm/translate.c index eb217af579a..0c92f3ed4ec 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -3713,26 +3713,8 @@ static int disas_vfp_insn(DisasContext *s, uint32_t insn) else rd = VFP_SREG_D(insn); if ((insn & 0x01200000) == 0x01000000) { - /* Single load/store */ - offset = (insn & 0xff) << 2; - if ((insn & (1 << 23)) == 0) - offset = -offset; - if (s->thumb && rn == 15) { - /* This is actually UNPREDICTABLE */ - addr = tcg_temp_new_i32(); - tcg_gen_movi_i32(addr, s->pc & ~2); - } else { - addr = load_reg(s, rn); - } - tcg_gen_addi_i32(addr, addr, offset); - if (insn & (1 << 20)) { - gen_vfp_ld(s, dp, addr); - gen_mov_vreg_F0(dp, rd); - } else { - gen_mov_F0_vreg(dp, rd); - gen_vfp_st(s, dp, addr); - } - tcg_temp_free_i32(addr); + /* Already handled by decodetree */ + return 1; } else { /* load/store multiple */ int w = insn & (1 << 21); diff --git a/target/arm/vfp.decode b/target/arm/vfp.decode index 134f1c9ef58..8fa7fa0bead 100644 --- a/target/arm/vfp.decode +++ b/target/arm/vfp.decode @@ -71,3 +71,10 @@ VMOV_64_sp ---- 1100 010 op:1 rt2:4 rt:4 1010 00.1 .... \ vm=%vm_sp VMOV_64_dp ---- 1100 010 op:1 rt2:4 rt:4 1011 00.1 .... \ vm=%vm_dp + +# Note that the half-precision variants of VLDR and VSTR are +# not part of this decodetree at all because they have bits [9:8] == 0b01 +VLDR_VSTR_sp ---- 1101 u:1 .0 l:1 rn:4 .... 1010 imm:8 \ + vd=%vd_sp +VLDR_VSTR_dp ---- 1101 u:1 .0 l:1 rn:4 .... 1011 imm:8 \ + vd=%vd_dp