From patchwork Fri Oct 13 16:24:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 115811 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp943260qgn; Fri, 13 Oct 2017 09:51:15 -0700 (PDT) X-Received: by 10.55.162.73 with SMTP id l70mr2702631qke.29.1507913475784; Fri, 13 Oct 2017 09:51:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507913475; cv=none; d=google.com; s=arc-20160816; b=LwZgtUyrrgaxBxlXiPR+uDqCVEQCpSMhpUZZBhlOz1/hfSlLtOAa+uDGVJVdY8yx6k JM5DcFQttAXqL9jPIrcB22es36qgF5QWZhHS9yJebUjmYaUS1AzxxcWqWeR/JLOExgiG fIOFWvr87VNF+crvKbVPePGU2rJpMqGeylJO258WhphX6E3BTN/gk7bGNWG9oCKAbPb2 HrmUTuKD+X2gYE3/S34HN7+e0jnusEgRC20OhZMc52Kf82YKP5leHcK3m47nkF1ac3zc sKOLeXvQuIBx5vgcvPyYHTHRjvwsjhuoF2MGJ4X9jjcOFZjxraCmJ/ClUxFTrguQsUGi 6kzg== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=/h8XKayeoXJsQgrzKkClLe/QicmBHHpv4TzgELdjS3U=; b=klN/0ZL0XwnV6DxRmSCX+kCdt/eVbcE/rQ3EIueVy8/S1WNt7P9ky+LficD6JlFET1 PnS3KgYfECxmWvEiOIiDGj5yfmFzSJAbpElPojM3N6slna/YD5INq5aaeSaifaeeydcp Y0Q2RHl3DQE6glftjL1OEC3jP8TAQwd5QCZ1kfFyHQ1i1fwqoOuqRmayfZa9dkqCl0p5 J1snDOTEU/0PEpYj92+3r/mKWgtuyrc/eH2fVUeN/iCXOcGu80PswRrPWxftT1n+rm+l /uG3DCGr7HHaRqJ6ok80H9L3VkWtJsr/L8oPlBPxQOONa4qzBbg90zZ2iub27hwXm1/t LeYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=W7JjesUm; 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 4si418253qke.380.2017.10.13.09.51.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 13 Oct 2017 09:51:15 -0700 (PDT) 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=W7JjesUm; 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]:51171 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e33B3-00077q-8I for patch@linaro.org; Fri, 13 Oct 2017 12:51:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e332C-0000U6-VC for qemu-devel@nongnu.org; Fri, 13 Oct 2017 12:42:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3329-0001hB-2Q for qemu-devel@nongnu.org; Fri, 13 Oct 2017 12:42:05 -0400 Received: from mail-wr0-x229.google.com ([2a00:1450:400c:c0c::229]:54073) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e3328-0001gI-S5 for qemu-devel@nongnu.org; Fri, 13 Oct 2017 12:42:01 -0400 Received: by mail-wr0-x229.google.com with SMTP id y44so1456830wry.10 for ; Fri, 13 Oct 2017 09:42:00 -0700 (PDT) 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=/h8XKayeoXJsQgrzKkClLe/QicmBHHpv4TzgELdjS3U=; b=W7JjesUmYEQCwuO9jP0r+85Aeocf2czoYgXmtFMSQmq2rl5F3qepYVqOYf4Z1rEEQ8 +GbJGww7JF2JVaAGV4dEIXya3VqVQ25NBwfXYSJDMVrzPDKy5Qd9G+FGdUP9AdlvKYtS ZdULOXFCabvKlz/zohM9E2FRD8oHA3QBKHmcU= 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=/h8XKayeoXJsQgrzKkClLe/QicmBHHpv4TzgELdjS3U=; b=Jqfn9YjJL/jQmz1EhGDGO7AflVo0GQiHBzJi1XJov/ihUwMmx7dLfsYQL78ioapyGI I7SkR0Tt1wgwf9wC3XzeMtH9gsoxyuzixadEHEHBtWiQYFrRRmozdQkViUXWgneS00Ed p5pQtTZsP8pkqB5IVjjkypyN0F2LZ3/3gXYdLuBIRLl7pyu04ccekIQX4H6zkRGtqvXp Ln0j6HN+v+THstOI9eSK/iea9ikNNLvlEqIFzt0UnbePE4WV7GcuMywrf4LJXUnBMeQa WSghKNnzM3toeZowkSY6SmzsJfYKrR3InHOHexVvohnLhCmCJbEgY1IIDC5BU6uMwQQZ yLBg== X-Gm-Message-State: AMCzsaXslTKXVXvg8Wjf9ftdGZA1WH2wLzSZTGIfJRUAcWF7y43y0EA/ z8+TzdKpUStMRJ9x3ITk1aLmHA== X-Google-Smtp-Source: AOwi7QDFnQ1hgr3e3IInTQVLE1OXJcL2KKP0gVAASMW9iBMYef4CTT2cl5e1Ig509gJBshJ8DtDsmg== X-Received: by 10.223.154.70 with SMTP id z64mr1758425wrb.220.1507912919568; Fri, 13 Oct 2017 09:41:59 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id v80sm1300129wmv.37.2017.10.13.09.41.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 09:41:58 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 9073A3E0D75; Fri, 13 Oct 2017 17:24:39 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: richard.henderson@linaro.org Date: Fri, 13 Oct 2017 17:24:24 +0100 Message-Id: <20171013162438.32458-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171013162438.32458-1-alex.bennee@linaro.org> References: <20171013162438.32458-1-alex.bennee@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:400c:c0c::229 Subject: [Qemu-devel] [RFC PATCH 16/30] target/arm/translate-a64.c: add FP16 FADD/FMUL/FDIV to AdvSIMD 3 Same (!sub) 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: peter.maydell@linaro.org, qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The fprintf is only there for debugging as the skeleton is added to, it will be removed once the skeleton is complete. Signed-off-by: Alex Bennée --- target/arm/helper-a64.c | 4 ++++ target/arm/helper-a64.h | 4 ++++ target/arm/translate-a64.c | 12 +++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) -- 2.14.1 diff --git a/target/arm/helper-a64.c b/target/arm/helper-a64.c index a0c20faabc..8ef15c4c45 100644 --- a/target/arm/helper-a64.c +++ b/target/arm/helper-a64.c @@ -551,6 +551,10 @@ float16 ADVSIMD_HELPER(name, h)(float16 a, float16 b, void *fpstp) \ return float16_ ## name(a, b, fpst); \ } +ADVSIMD_HALFOP(add) +ADVSIMD_HALFOP(sub) +ADVSIMD_HALFOP(mul) +ADVSIMD_HALFOP(div) ADVSIMD_HALFOP(min) ADVSIMD_HALFOP(max) ADVSIMD_HALFOP(minnum) diff --git a/target/arm/helper-a64.h b/target/arm/helper-a64.h index b774431f1f..a4ce87970e 100644 --- a/target/arm/helper-a64.h +++ b/target/arm/helper-a64.h @@ -44,6 +44,10 @@ DEF_HELPER_FLAGS_3(crc32_64, TCG_CALL_NO_RWG_SE, i64, i64, i64, i32) DEF_HELPER_FLAGS_3(crc32c_64, TCG_CALL_NO_RWG_SE, i64, i64, i64, i32) DEF_HELPER_FLAGS_4(paired_cmpxchg64_le, TCG_CALL_NO_WG, i64, env, i64, i64, i64) DEF_HELPER_FLAGS_4(paired_cmpxchg64_be, TCG_CALL_NO_WG, i64, env, i64, i64, i64) +DEF_HELPER_3(advsimd_addh, f16, f16, f16, ptr) +DEF_HELPER_3(advsimd_subh, f16, f16, f16, ptr) +DEF_HELPER_3(advsimd_mulh, f16, f16, f16, ptr) +DEF_HELPER_3(advsimd_divh, f16, f16, f16, ptr) DEF_HELPER_3(advsimd_maxh, f16, f16, f16, ptr) DEF_HELPER_3(advsimd_minh, f16, f16, f16, ptr) DEF_HELPER_3(advsimd_maxnumh, f16, f16, f16, ptr) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 5e531b3ae4..f687bab214 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -9806,8 +9806,18 @@ static void disas_simd_three_reg_same_fp16(DisasContext *s, uint32_t insn) read_vec_element_i32(s, tcg_op2, rm, pass, MO_16); switch (fpopcode) { + case 0x2: /* FADD */ + gen_helper_advsimd_addh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x23: /* FMUL */ + gen_helper_advsimd_mulh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x27: /* FDIV */ + gen_helper_advsimd_divh(tcg_res, tcg_op1, tcg_op2, fpst); + break; default: - fprintf(stderr,"%s: insn %#04x fpop %#2x\n", __func__, insn, fpopcode); + fprintf(stderr,"%s: insn %#04x, fpop %#2x @ %#" PRIx64 "\n", + __func__, insn, fpopcode, s->pc); g_assert_not_reached(); }