From patchwork Mon Aug 24 14:29:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 248227 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:522:0:0:0:0 with SMTP id h2csp2612936ils; Mon, 24 Aug 2020 07:41:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFGsIg4DLCeEdiRbgwPjNPM2K1SAupI/etIMnCREnlGhcF3jmCY1paWpgGmhmJR+b4l1a6 X-Received: by 2002:a25:868b:: with SMTP id z11mr7834686ybk.108.1598280115822; Mon, 24 Aug 2020 07:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598280115; cv=none; d=google.com; s=arc-20160816; b=QUPcsCyXe96TB1SHx2pBQACcLtFl9tNB6seUSYpJKBmVW1WcgO/6D2S67d+sbrKPdu ExEPcQpvt91duSiXfAj23qNpozrQ9LHBlJWW9IaSt2DzUi+j6izKDAFbiyma6YNZVI4M dzcsK5hbg76t289Eo9SaNchq6UoMqHfJWmze02x7SMlCHD53FFZTTTfeIWlgB9nfEgGm +mqyKxD6+lAlgXY7AWoIabi+6RQFkxPhx35AdXeviGvU3jnET0keRmdoGs5cqWSVFvFh Bguz7Jx+VB6RjEFwlSWnw6qaSe2oCUlolAjRLjPZc3MVF4ZIXVX5maTWAKxklZdkJQrI tF6w== 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=0AGhW0MxhHcUCSNBSGpBK11L52+F5zOr0t2Vfz/+snY=; b=ivies6lX1yM+u8v16dGpPbUoWAjKxeQFMlR444cMP12COVwNsHRP9JnyAZw6ibD1Ff nrxAtC7P7GGK5O+NX9ne8CzMY2UKSMBtSCpzNr9Ne+QA4ee+6YUecOdF2ZTv+q3zwep4 GuJBOuHqZECZWWWz5qSjUkfz875XSs852xujHBVYYVO8zdv9E4szhfwv69emzXpSQe4W dCZE2jOj4/6nfVUq2LZ4+yWEnoNKYsH6oKFsJBejXKs0WtbM12OAGdhj0CuHm+oVlhqN qR63MAP9vn7r44fa1jd5oMXJ/OiunJ5kYKV1AK/Tzw1EkWb0l1p6ne4P9zbbS/CELbx0 RB0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UJpkDfwk; 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 l26si11908612ybj.118.2020.08.24.07.41.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Aug 2020 07:41:55 -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=UJpkDfwk; 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]:36082 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kADfX-00057W-6T for patch@linaro.org; Mon, 24 Aug 2020 10:41:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43508) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kADU5-0000MY-O5 for qemu-devel@nongnu.org; Mon, 24 Aug 2020 10:30:06 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:53432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kADTy-0002kz-6j for qemu-devel@nongnu.org; Mon, 24 Aug 2020 10:30:04 -0400 Received: by mail-wm1-x343.google.com with SMTP id u18so8544369wmc.3 for ; Mon, 24 Aug 2020 07:29:57 -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=0AGhW0MxhHcUCSNBSGpBK11L52+F5zOr0t2Vfz/+snY=; b=UJpkDfwkX7erAH9325bqppJ7xu97l0Y8+a5z4ihjHS9mD8xMApc+aci1tb1zqKbibQ 3DLdFuniFHMqDmPeFmnc2juAe46YZ1E4/RWuQWIzCSAgBWuaku+tX9ibHD8k9sPeSKCF /jVU3Z1vr/IHcgPdpMIpdooOEaTRWI767SQ9VIkICFHfYie0J+qdgPgLWZbeX9BaVKrG Tg4Ci2tNB+o86hDntYLbcbXRKWePct8IDAqhMShhAY2GC5byxHsDfc+m7aiwl4lFyd1H cQmNa5zohwNyw62uL9zRDfdYmpxNicnkEJqxN5dh9PHzyKwj4Qj3JAN3ht1H3QAVDY1x Xepw== 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=0AGhW0MxhHcUCSNBSGpBK11L52+F5zOr0t2Vfz/+snY=; b=qONKaFqng/spcUWlpe5JZwH0TcxMx7atGCMxjnjWyReijdcZSBCyaOhsyDxjKJ5IMR T18yd0+oPYd6CKq46w350Q51A/Tv+XcobmFROQLna6Zv+2Kz1tQKXuQcO/zBwwNA6J4m W1gcL0GXNX2IqL1+hMmMIMPVhgwunZa9C7CvZKhacfOnn18xossnu/tMT2P0osatgntt Znv9FPsYD3B9ybtLWeHzOHxTmNtVTuovk+jVBEF5COdaykluFtC8ry6CeB2rxdzsgIWi zDFcdX/EaoacKTHHTh98Q/qhFIer41/QVJ0Y//5mwBxmfsXnBpTOOGOaOti/Fb9lD6Ap cKMQ== X-Gm-Message-State: AOAM532lBLeWCr+1q0Ujfik/qJxNfBEaEJhekkCJ0hEkHA7SgGGQnuoP gRS8F6lC/uHwyexKckwm6K+SK/qs5vQGWkeB X-Received: by 2002:a1c:283:: with SMTP id 125mr6262891wmc.12.1598279396899; Mon, 24 Aug 2020 07:29:56 -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.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2020 07:29:56 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 19/22] target/arm: Implement new VFP fp16 insn VINS Date: Mon, 24 Aug 2020 15:29:31 +0100 Message-Id: <20200824142934.20850-20-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::343; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x343.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=unavailable 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" The fp16 extension includes a new instruction VINS, which copies the lower 16 bits of a 32-bit source VFP register into the upper 16 bits of the destination. Implement it. Signed-off-by: Peter Maydell --- target/arm/vfp-uncond.decode | 3 +++ target/arm/translate-vfp.c.inc | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/target/arm/vfp-uncond.decode b/target/arm/vfp-uncond.decode index 9615544623a..39dc8f6373a 100644 --- a/target/arm/vfp-uncond.decode +++ b/target/arm/vfp-uncond.decode @@ -74,3 +74,6 @@ VCVT 1111 1110 1.11 11 rm:2 .... 1010 op:1 1.0 .... \ vm=%vm_sp vd=%vd_sp sz=2 VCVT 1111 1110 1.11 11 rm:2 .... 1011 op:1 1.0 .... \ vm=%vm_dp vd=%vd_sp sz=3 + +VINS 1111 1110 1.11 0000 .... 1010 11 . 0 .... \ + vd=%vd_sp vm=%vm_sp diff --git a/target/arm/translate-vfp.c.inc b/target/arm/translate-vfp.c.inc index 7ce044fa896..bda3dd25136 100644 --- a/target/arm/translate-vfp.c.inc +++ b/target/arm/translate-vfp.c.inc @@ -3454,3 +3454,31 @@ static bool trans_NOCP(DisasContext *s, arg_NOCP *a) return false; } + +static bool trans_VINS(DisasContext *s, arg_VINS *a) +{ + TCGv_i32 rd, rm; + + if (!dc_isar_feature(aa32_fp16_arith, s)) { + return false; + } + + if (s->vec_len != 0 || s->vec_stride != 0) { + return false; + } + + if (!vfp_access_check(s)) { + return true; + } + + /* Insert low half of Vm into high half of Vd */ + rm = tcg_temp_new_i32(); + rd = tcg_temp_new_i32(); + neon_load_reg32(rm, a->vm); + neon_load_reg32(rd, a->vd); + tcg_gen_deposit_i32(rd, rd, rm, 16, 16); + neon_store_reg32(rd, a->vd); + tcg_temp_free_i32(rm); + tcg_temp_free_i32(rd); + return true; +}