From patchwork Fri May 11 02:44:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135471 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp327721lji; Thu, 10 May 2018 19:49:38 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqDgaAw2p90JYiMrdP8CIbhLKZRrAuxNL4pSR436WBIW7HAHUvZEXfhc1PjrpkQiAPpQNND X-Received: by 2002:ac8:6753:: with SMTP id n19-v6mr3785398qtp.68.1526006978193; Thu, 10 May 2018 19:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526006978; cv=none; d=google.com; s=arc-20160816; b=cuFSur/f7oYBbdXEFL+3E4xn7s0bOkXiI6mcjlLBgb51X6sFu1Tc15Edb2TeWBN2B2 gJd4ilgqgQYVq4yskpgYOFWad6gJmha39yK/0rD/y0gv/Iy6EPgaGhZ272UZaFL/bMfI +chkKozlmKevvErm/Zy0gfz1e9xCjRPdr88HjeW8d/EfffYqvJUrPZceUjyAAYx5SJm/ 1e9RmFWGERvLEDCYDofE9Y2nFHKf4RprUCNPJ+pNPAexlpdxUQzOe0nBh4Lhp7pduhvx diXR1C/4ktHSkus9tEYLvEzlbGZ8OzNZ3VjF7rWvKHxaHJ/jAKjAYB0hRgfS2u7Loq9m j6Bg== 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=7MNyMFHvx58ZXGFdXLFB2Vf0VyV5CoW7cXdjX/jA+Sw=; b=WSdZLn9jUUeCII6cqiIq1lM3QtKX6/I1IoJMMmoxcMXAlPi/R9XsfgoR9Bl4KxDfBV VoHIqa6/7b9rx1iEa7TbujcnWgbz9EcGa3sVuaAOTpW7UtYqYDpkBo0Bf8W93FgbMfxD vpbARhEOi87hWNL3U1wexb+zzyr+ZsH8whmVrYPx3BZ4bPEtaFwSbl+00gldMq0VcDR/ 0wjb4j4oVvNpXlmZVUlfDBaQIoA57Wwrt7LrCUAsi1EtryDcNKrvD2o+9wQHwKkHrpuU t1g+Tt4t8a37J/IZicq3ql3pm1f4hbudEB+aZw0afBw+zFhZwvbacR2NBLgq8UNJzrza 5vGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Vz5TkaQv; 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 h7-v6si2135773qvk.34.2018.05.10.19.49.38 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 10 May 2018 19:49:38 -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=Vz5TkaQv; 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]:36450 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGy7l-0005fN-LV for patch@linaro.org; Thu, 10 May 2018 22:49:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43829) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGy3Z-0002AP-JX for qemu-devel@nongnu.org; Thu, 10 May 2018 22:45:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGy3Y-00061C-Ro for qemu-devel@nongnu.org; Thu, 10 May 2018 22:45:17 -0400 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:34235) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGy3Y-00060R-Mu for qemu-devel@nongnu.org; Thu, 10 May 2018 22:45:16 -0400 Received: by mail-pg0-x241.google.com with SMTP id g20-v6so1799713pgv.1 for ; Thu, 10 May 2018 19:45:16 -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=7MNyMFHvx58ZXGFdXLFB2Vf0VyV5CoW7cXdjX/jA+Sw=; b=Vz5TkaQvuHxBKC5yaEju8MCFr16aQa+gZd2OdoTOYbCevWjY9o9IbtaJKn0esTyg5u AQyuMofcd23PSdEyfyH9+GA+JDNDofpbEVzg+icUepqy1i15FJGw9shTvmddp0SI8LM7 byGwl15agulrutBIHKV/snfEAPhmXDX+dV0VI= 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=7MNyMFHvx58ZXGFdXLFB2Vf0VyV5CoW7cXdjX/jA+Sw=; b=BXJXvXJITL7zDgJ7ciL2D6yrtl/EvZtsPXcpkARR+Xgij6GeEaRS8eOAcUd8ctA6CX mg/y4bh7jmmA6mCp3xs2Qf2kFg7TdYu4aO3xnS6P2vqpAdK5iQDnlQnwtt+6rEpRN8oz bQUhj+bIfeukJq8Qp6WDU1w+Ilt4DsUCHM74+10fCCc9XgkJu8h29uBSc/qlBxLTbBJc fzCUplu7MLtny9RmU6lpokv9j3hITxdbev9yNHqduaXiJfROzLqqci0W8GbjVvN4Kb84 +4sgtePDWwG4WG4Whhc3R2Gxyt1ei/sXStbjrFw5P2MY/DRy4rwyWcUErNH3+Zd2onDM IXnQ== X-Gm-Message-State: ALKqPwd2Wt673vVHRyuWTlbWJwGPjNxmiw8PPNrDkBGWvJTHgAe5Zb1R ASNJ8n6SkCSNv8dABFvIOX3wxA2N0p4= X-Received: by 2002:a62:ec6:: with SMTP id 67-v6mr3682256pfo.36.1526006715286; Thu, 10 May 2018 19:45:15 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id n18-v6sm5420915pfg.36.2018.05.10.19.45.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 May 2018 19:45:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 10 May 2018 19:44:49 -0700 Message-Id: <20180511024454.31679-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180511024454.31679-1-richard.henderson@linaro.org> References: <20180511024454.31679-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:400e:c05::241 Subject: [Qemu-devel] [PATCH v3 06/11] target/arm: Implement FP data-processing (2 source) for fp16 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, alex.bennee@linaro.org, qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We missed all of the scalar fp16 binary operations. Cc: qemu-stable@nongnu.org Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 65 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) -- 2.17.0 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 031213bb06..1264e798a7 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -5299,6 +5299,61 @@ static void handle_fp_2src_double(DisasContext *s, int opcode, tcg_temp_free_i64(tcg_res); } +/* Floating-point data-processing (2 source) - half precision */ +static void handle_fp_2src_half(DisasContext *s, int opcode, + int rd, int rn, int rm) +{ + TCGv_i32 tcg_op1; + TCGv_i32 tcg_op2; + TCGv_i32 tcg_res; + TCGv_ptr fpst; + + tcg_res = tcg_temp_new_i32(); + fpst = get_fpstatus_ptr(true); + tcg_op1 = read_fp_hreg(s, rn); + tcg_op2 = read_fp_hreg(s, rm); + + switch (opcode) { + case 0x0: /* FMUL */ + gen_helper_advsimd_mulh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x1: /* FDIV */ + gen_helper_advsimd_divh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x2: /* FADD */ + gen_helper_advsimd_addh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x3: /* FSUB */ + gen_helper_advsimd_subh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x4: /* FMAX */ + gen_helper_advsimd_maxh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x5: /* FMIN */ + gen_helper_advsimd_minh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x6: /* FMAXNM */ + gen_helper_advsimd_maxnumh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x7: /* FMINNM */ + gen_helper_advsimd_minnumh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x8: /* FNMUL */ + gen_helper_advsimd_mulh(tcg_res, tcg_op1, tcg_op2, fpst); + tcg_gen_xori_i32(tcg_res, tcg_res, 0x8000); + break; + default: + g_assert_not_reached(); + } + + write_fp_sreg(s, rd, tcg_res); + + tcg_temp_free_ptr(fpst); + tcg_temp_free_i32(tcg_op1); + tcg_temp_free_i32(tcg_op2); + tcg_temp_free_i32(tcg_res); +} + /* Floating point data-processing (2 source) * 31 30 29 28 24 23 22 21 20 16 15 12 11 10 9 5 4 0 * +---+---+---+-----------+------+---+------+--------+-----+------+------+ @@ -5331,6 +5386,16 @@ static void disas_fp_2src(DisasContext *s, uint32_t insn) } handle_fp_2src_double(s, opcode, rd, rn, rm); break; + case 3: + if (!arm_dc_feature(s, ARM_FEATURE_V8_FP16)) { + unallocated_encoding(s); + return; + } + if (!fp_access_check(s)) { + return; + } + handle_fp_2src_half(s, opcode, rd, rn, rm); + break; default: unallocated_encoding(s); }