From patchwork Fri Feb 14 18:15:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 183516 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp2129541ile; Fri, 14 Feb 2020 10:22:42 -0800 (PST) X-Google-Smtp-Source: APXvYqxU2981ssn06LZiAKXUAw0T8dbQ3dkby1JdRkJH1QsOynGs8gWmznr/aPYDbIJY9s8GrPon X-Received: by 2002:a37:9a4d:: with SMTP id c74mr3883632qke.18.1581704562727; Fri, 14 Feb 2020 10:22:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581704562; cv=none; d=google.com; s=arc-20160816; b=kON89zIldOVD3SF16wwKrccLbSpbks+/Dp5Oi1BDjpfUXTf76b3MX94795Hn5Kv4BY ffnSJAwXNQMLUaEa0DPgwBaKK4ylI0wJGTB62H2yohPJVd12ntcF1r0lfJNtJxqsPfBN Uqqj3/ZFccmDgsIn5HUwRfD0Q8EhGiTZC2RNwaLsqy1rbluqFkqZwdA2a1ZB5U32nJAa tRiU0ppoiqsG8gg9+J3UWH09RcPz/Yp+ZsqZ4yePEmnOqtST7D09RmK47Jwf2dezehLk B4JJuT9pwtbwxtciMWbt61W8u6rMhUU91SO1+G/kwwkpEOPuFm0nu14d9EPe/fNhH7fL p4ww== 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=08YWOW4uPN/K//8Sv/iAQdt6yoHtAxwQIa1pxOQkXxw=; b=SFwlp/xBrSm2bbHXJHHyd3nthhoh4zUkuLCaq+sJTgSNG2rnxK6JXQ2RdR8J5+Rsm7 475/lrZgxYHmzE1i5YXLggC+yRUYo61xBFBzxWTJraeDVxHhCld1UinnCkoEVfuBBYx8 RmKa0nncBuxLW53PgMM50ZqNA6AuTaXGT1sG5Fgif01PLqI1NtOIYT2o/qAaluJslUTs nvsE8cpZDTT1liCaSVG2abjjNscyghm61E08RfGLmegTy0Sl8blnC4G7GDxI1bGs/up3 ftQQowOFuLIJS+jMcktPK7alF9hLX7Icr2WwJfOEpdz7YU2xlRzFxZ7OzZVL4wSGRO5Q 22CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CmrUFjhR; 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=pass (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 k8si2924146qvp.76.2020.02.14.10.22.42 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Feb 2020 10:22:42 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b=CmrUFjhR; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fbu-0001Hi-8x for patch@linaro.org; Fri, 14 Feb 2020 13:22:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60975) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2fVc-0004jg-Hn for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2fVb-0000M1-71 for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:12 -0500 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:46225) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j2fVb-0000L1-18 for qemu-devel@nongnu.org; Fri, 14 Feb 2020 13:16:11 -0500 Received: by mail-pf1-x442.google.com with SMTP id k29so5238023pfp.13 for ; Fri, 14 Feb 2020 10:16:10 -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 :mime-version:content-transfer-encoding; bh=08YWOW4uPN/K//8Sv/iAQdt6yoHtAxwQIa1pxOQkXxw=; b=CmrUFjhRgBmeKXvH7NHnFbQpBEyRRrlSu7RRgr3lzAklwKujje0eh+AYgMgXpK6m4N TVLWc9TCl7MoM3pCMiJdrqqxOqQm44RpTr2wTO9iOD9gFB3o4eWjrWZxCGo1rFoY845U 9lWE8hrarjlIhuEKpHXDjqhRUNs2Rzqv86OLZYRMUph/vabVocw7b+PDYLeEhVZYg9cp BMVOi5HW5+IW/nLMeGMhZMSRx5thMi/Cw1w5mKg2WpXDHrNuKj+K5Zpl8sfBlJpvYId1 9jVeP/jQIZ3HUY13+F2IMHAoTwaGJ4UOX8lioPP9A3s1NyEPtv/jBtVjK147BzLISkZQ DYHQ== 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=08YWOW4uPN/K//8Sv/iAQdt6yoHtAxwQIa1pxOQkXxw=; b=iiAWhF/s9T5s/bqEjXPZfbB6smzYMOIqwfkfL6mNlhpVYxHAMRv9KWloaRxBnW6JIo 2ezEcNhFwu85JFxYem1PoXvr5HBdqyaU2vk7lQlHf8iKA/cqDEtHVg5u9KeuDdFwbOSD aHjLqMFaLEdGepog0nm+omM1Jjk9D2lFoDYtOPB7lFddX0J2SvnWIZpQa8eoHzy+nZ0D jih3VqA59W4yL78WlLXyn79qmeAqRQxdIa/Nd467F6dHK/9/DiVwpwq1MuEnBpLenqRR mTORytGlWyJA5jM8nzCHVXgDUAAV9VqmpGSMwLT6NcF2pqV47QY27UUr4kG2i9OiOltr qz7g== X-Gm-Message-State: APjAAAVDCY7fY+m5hR4FiO4qElDMFBvBkPgWak2Drw/Fo3XuGzlBxREO Nyn5FLYEfOgzEM4QfpDitsLCAfxyH/U= X-Received: by 2002:a63:7f5c:: with SMTP id p28mr4977435pgn.212.1581704169483; Fri, 14 Feb 2020 10:16:09 -0800 (PST) Received: from localhost.localdomain (97-126-123-70.tukw.qwest.net. [97.126.123.70]) by smtp.gmail.com with ESMTPSA id i3sm7525123pfg.94.2020.02.14.10.16.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Feb 2020 10:16:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 18/19] target/arm: Split VFM decode Date: Fri, 14 Feb 2020 10:15:46 -0800 Message-Id: <20200214181547.21408-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200214181547.21408-1-richard.henderson@linaro.org> References: <20200214181547.21408-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::442 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@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Passing the raw o1 and o2 fields from the manual is less instructive than it might be. Do the full decode and let the trans_* functions pass in booleans to a helper. Signed-off-by: Richard Henderson --- target/arm/vfp.decode | 17 +++++------ target/arm/translate-vfp.inc.c | 52 ++++++++++++++++++++++++++++++---- 2 files changed, 55 insertions(+), 14 deletions(-) -- 2.20.1 Reviewed-by: Peter Maydell diff --git a/target/arm/vfp.decode b/target/arm/vfp.decode index 4f294f88be..5fd70f975a 100644 --- a/target/arm/vfp.decode +++ b/target/arm/vfp.decode @@ -130,14 +130,15 @@ VSUB_dp ---- 1110 0.11 .... .... 1011 .1.0 .... @vfp_dnm_d VDIV_sp ---- 1110 1.00 .... .... 1010 .0.0 .... @vfp_dnm_s VDIV_dp ---- 1110 1.00 .... .... 1011 .0.0 .... @vfp_dnm_d -VFM_sp ---- 1110 1.01 .... .... 1010 . o2:1 . 0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp o1=1 -VFM_dp ---- 1110 1.01 .... .... 1011 . o2:1 . 0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp o1=1 -VFM_sp ---- 1110 1.10 .... .... 1010 . o2:1 . 0 .... \ - vm=%vm_sp vn=%vn_sp vd=%vd_sp o1=2 -VFM_dp ---- 1110 1.10 .... .... 1011 . o2:1 . 0 .... \ - vm=%vm_dp vn=%vn_dp vd=%vd_dp o1=2 +VFMA_sp ---- 1110 1.10 .... .... 1010 .0. 0 .... @vfp_dnm_s +VFMS_sp ---- 1110 1.10 .... .... 1010 .1. 0 .... @vfp_dnm_s +VFNMA_sp ---- 1110 1.01 .... .... 1010 .0. 0 .... @vfp_dnm_s +VFNMS_sp ---- 1110 1.01 .... .... 1010 .1. 0 .... @vfp_dnm_s + +VFMA_dp ---- 1110 1.10 .... .... 1011 .0.0 .... @vfp_dnm_d +VFMS_dp ---- 1110 1.10 .... .... 1011 .1.0 .... @vfp_dnm_d +VFNMA_dp ---- 1110 1.01 .... .... 1011 .0.0 .... @vfp_dnm_d +VFNMS_dp ---- 1110 1.01 .... .... 1011 .1.0 .... @vfp_dnm_d VMOV_imm_sp ---- 1110 1.11 .... .... 1010 0000 .... \ vd=%vd_sp imm=%vmov_imm diff --git a/target/arm/translate-vfp.inc.c b/target/arm/translate-vfp.inc.c index 8f2b97e0e7..b5f3feaf8d 100644 --- a/target/arm/translate-vfp.inc.c +++ b/target/arm/translate-vfp.inc.c @@ -1784,7 +1784,7 @@ static bool trans_VDIV_dp(DisasContext *s, arg_VDIV_dp *a) return do_vfp_3op_dp(s, gen_helper_vfp_divd, a->vd, a->vn, a->vm, false); } -static bool trans_VFM_sp(DisasContext *s, arg_VFM_sp *a) +static bool do_vfm_sp(DisasContext *s, arg_VFMA_sp *a, bool neg_n, bool neg_d) { /* * VFNMA : fd = muladd(-fd, fn, fm) @@ -1823,12 +1823,12 @@ static bool trans_VFM_sp(DisasContext *s, arg_VFM_sp *a) neon_load_reg32(vn, a->vn); neon_load_reg32(vm, a->vm); - if (a->o2) { + if (neg_n) { /* VFNMS, VFMS */ gen_helper_vfp_negs(vn, vn); } neon_load_reg32(vd, a->vd); - if (a->o1 & 1) { + if (neg_d) { /* VFNMA, VFNMS */ gen_helper_vfp_negs(vd, vd); } @@ -1844,7 +1844,27 @@ static bool trans_VFM_sp(DisasContext *s, arg_VFM_sp *a) return true; } -static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) +static bool trans_VFMA_sp(DisasContext *s, arg_VFMA_sp *a) +{ + return do_vfm_sp(s, a, false, false); +} + +static bool trans_VFMS_sp(DisasContext *s, arg_VFMS_sp *a) +{ + return do_vfm_sp(s, a, true, false); +} + +static bool trans_VFNMA_sp(DisasContext *s, arg_VFNMA_sp *a) +{ + return do_vfm_sp(s, a, false, true); +} + +static bool trans_VFNMS_sp(DisasContext *s, arg_VFNMS_sp *a) +{ + return do_vfm_sp(s, a, true, true); +} + +static bool do_vfm_dp(DisasContext *s, arg_VFMA_dp *a, bool neg_n, bool neg_d) { /* * VFNMA : fd = muladd(-fd, fn, fm) @@ -1893,12 +1913,12 @@ static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) neon_load_reg64(vn, a->vn); neon_load_reg64(vm, a->vm); - if (a->o2) { + if (neg_n) { /* VFNMS, VFMS */ gen_helper_vfp_negd(vn, vn); } neon_load_reg64(vd, a->vd); - if (a->o1 & 1) { + if (neg_d) { /* VFNMA, VFNMS */ gen_helper_vfp_negd(vd, vd); } @@ -1914,6 +1934,26 @@ static bool trans_VFM_dp(DisasContext *s, arg_VFM_dp *a) return true; } +static bool trans_VFMA_dp(DisasContext *s, arg_VFMA_dp *a) +{ + return do_vfm_dp(s, a, false, false); +} + +static bool trans_VFMS_dp(DisasContext *s, arg_VFMS_dp *a) +{ + return do_vfm_dp(s, a, true, false); +} + +static bool trans_VFNMA_dp(DisasContext *s, arg_VFNMA_dp *a) +{ + return do_vfm_dp(s, a, false, true); +} + +static bool trans_VFNMS_dp(DisasContext *s, arg_VFNMS_dp *a) +{ + return do_vfm_dp(s, a, true, true); +} + static bool trans_VMOV_imm_sp(DisasContext *s, arg_VMOV_imm_sp *a) { uint32_t delta_d = 0;