From patchwork Mon Aug 24 14:29:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 248207 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp2604489ils; Mon, 24 Aug 2020 07:30:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXVENYSNpe/4qLGrBdYaK8fP4DC/1nn6j4gVemXoF5EeG5BfQxZzdEnQ6SSiQ2FSf3Jwqq X-Received: by 2002:a25:4149:: with SMTP id o70mr7412769yba.290.1598279430516; Mon, 24 Aug 2020 07:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598279430; cv=none; d=google.com; s=arc-20160816; b=HAxzRispoUYSe6v0puz4c/4hyHptP2THmqv2/aj4IQzc1GgQ92ir2i1WfrbsR7Y15W cpjp1FRSQp3OCudkjRu87cx/06otZiZZsy5Isf7BB8veqc5i3G7P3vKRaYcFEYkZ5VAr 5yfOK4MQi0bGVIfVGPUpf0M/8WsR60ZVM0p9g/HzREhsywZMc0ic4vK4EMsIcG6tMESZ vLF//p3k56jtegWOpAHjQ/spih4fhAsYk2cDk8XqEckwTrvdPN3g1R4MgyWZZ5qvced+ /1Of9JTa2+bsQIQI9BPfg7g21cyCF9wr3TakSJ684EUGdMFSTU4oriZ5lTuOTglJ8+DV VEew== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=YdTVCHUYqmChsgF+ID02/aH4U8m+3sURh89+kDcA5H8=; b=tactVNZFbi/eZP6yTT+mZinfLS6II/Gn/WZdw8XM2wGoL6oezbhE8GROZ2faHS9FOj bZ3iEWwO+0BmA2ms3CHgZ8K4Xqu+p4gbrN4bz4sRVlgprz4VJ6vYtrnvCletRF91WTX+ 3HtYVnCfBYRECgfLYF/VyHtjcuX7PvINvtflHpyH1YVSXgo66qCO0pjbRhhNGImd/LL6 pM1bLio6hQ0YTqSzKSdGGfTrXsCyFhUVEsXJxLj4gP++QL3H0OjXuWXfVovk1Qd0SgD1 lD6ZV5h5DIQrWTLga2KvIZhor9FxNY2cqQ/NlWF9cEExGOzrfClPUdnHd6+4aiQ8ZRWO PUfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jf5Au5CE; 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 z3si11915044ybo.258.2020.08.24.07.30.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Aug 2020 07:30:30 -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=pass header.i=@linaro.org header.s=google header.b=jf5Au5CE; 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]:41220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kADUT-0000Zk-VT for patch@linaro.org; Mon, 24 Aug 2020 10:30:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kADTr-0008PV-M7 for qemu-devel@nongnu.org; Mon, 24 Aug 2020 10:29:51 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:32773) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kADTp-0002i9-Ov for qemu-devel@nongnu.org; Mon, 24 Aug 2020 10:29:51 -0400 Received: by mail-wr1-x442.google.com with SMTP id o4so4873806wrn.0 for ; Mon, 24 Aug 2020 07:29:49 -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=YdTVCHUYqmChsgF+ID02/aH4U8m+3sURh89+kDcA5H8=; b=jf5Au5CEMc3kFyO8VL66vAeTClmn83aFqvvhmOvSe7XE1jczFrNJRew1PkMRg/Mfzn cBxFgiEOTWYsnGpn49GLgbhswrLyFOIDwmUumE1Pjp0AbUkTRLayk6T4t8I8mfoWuCAT vDxe+nTV9QCvcbzF/OznJAWJQ8HnXs3C3VW30NVxSRvV66BDe9pnYxZuco9O0RwEjUun APMEzElAyfl7TT1d1XzqU5qVncMVXpwFH//zJxvPcqmf1DtmnL+9pRE0/3pKiG7X7js2 QkKOPO+UDhqvwupNCbp++xcXfDQsFOtZDTpS0IyTKqHgY1oNZjFQPKsgCy5XdnVBT30K tMMg== 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=YdTVCHUYqmChsgF+ID02/aH4U8m+3sURh89+kDcA5H8=; b=earalbRFXRDGPIWvkpLX25lac/731UZuVvxgtPjy+LpwcEqX9MtCN6N/YTnjlsliHf itcM3P/s8d5tJDxhXqsQmjSIewZdrTLWGhRlvUoPKkga55ByzpCo8J6le21f99ugg/Ip vbFA97vEgAorR6CMRza6YCVGv7EEVgRjgGiJIjATYIm0W3xl1gs0Cuea1AsHwlZj/eMA qtWSiRvCAqjZLJcyRlxIhhqx9xezNS+W9pS3o8C4GI11nz9jKE++RAV7iV18BDcPVE+m prxCSBTX06LtzgL1uXml1PYW6Ej4mbihK+oT6uQ3WDoC+xgFTyi0PECaB+Mh9QFaHXxR AV/A== X-Gm-Message-State: AOAM530vN65alNrB6/ZluLf7qgYqujMWhOt51cc5eBO97GWC93DmpNOZ 4dqLkZLih0bdgbOxB5WRG/CGzQ== X-Received: by 2002:a5d:5052:: with SMTP id h18mr6341120wrt.156.1598279388452; Mon, 24 Aug 2020 07:29:48 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id b14sm24499091wrj.93.2020.08.24.07.29.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2020 07:29:47 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 11/22] target/arm: Implement VFP fp16 VLDR and VSTR Date: Mon, 24 Aug 2020 15:29:23 +0100 Message-Id: <20200824142934.20850-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200824142934.20850-1-peter.maydell@linaro.org> References: <20200824142934.20850-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::442; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Implement the fp16 versions of the VFP VLDR/VSTR (immediate). Signed-off-by: Peter Maydell --- target/arm/vfp.decode | 3 +-- target/arm/translate-vfp.c.inc | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/target/arm/vfp.decode b/target/arm/vfp.decode index b213da4b55d..37f96e2d261 100644 --- a/target/arm/vfp.decode +++ b/target/arm/vfp.decode @@ -79,8 +79,7 @@ VMOV_single ---- 1110 000 l:1 .... rt:4 1010 . 001 0000 vn=%vn_sp 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_hp ---- 1101 u:1 .0 l:1 rn:4 .... 1001 imm:8 vd=%vd_sp 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 diff --git a/target/arm/translate-vfp.c.inc b/target/arm/translate-vfp.c.inc index 00a6363e1e1..59ef4d4fbc3 100644 --- a/target/arm/translate-vfp.c.inc +++ b/target/arm/translate-vfp.c.inc @@ -886,6 +886,41 @@ static bool trans_VMOV_64_dp(DisasContext *s, arg_VMOV_64_dp *a) return true; } +static bool trans_VLDR_VSTR_hp(DisasContext *s, arg_VLDR_VSTR_sp *a) +{ + uint32_t offset; + TCGv_i32 addr, tmp; + + if (!dc_isar_feature(aa32_fp16_arith, s)) { + return false; + } + + if (!vfp_access_check(s)) { + return true; + } + + /* imm8 field is offset/2 for fp16, unlike fp32 and fp64 */ + offset = a->imm << 1; + if (!a->u) { + offset = -offset; + } + + /* For thumb, use of PC is UNPREDICTABLE. */ + addr = add_reg_for_lit(s, a->rn, offset); + tmp = tcg_temp_new_i32(); + if (a->l) { + gen_aa32_ld16u(s, tmp, addr, get_mem_index(s)); + neon_store_reg32(tmp, a->vd); + } else { + neon_load_reg32(tmp, a->vd); + gen_aa32_st16(s, tmp, addr, get_mem_index(s)); + } + tcg_temp_free_i32(tmp); + tcg_temp_free_i32(addr); + + return true; +} + static bool trans_VLDR_VSTR_sp(DisasContext *s, arg_VLDR_VSTR_sp *a) { uint32_t offset;