From patchwork Fri Feb 23 15:36:34 2018 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: 129407 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp752379lja; Fri, 23 Feb 2018 07:49:00 -0800 (PST) X-Google-Smtp-Source: AH8x226Kw36eNfs/ymywWwg7LDrSCZsPZfhJgmgfvGpDsv32FZrAzYX6HwRH1ifvv6jbUdYamURh X-Received: by 10.129.84.69 with SMTP id i66mr1346572ywb.264.1519400940129; Fri, 23 Feb 2018 07:49:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519400940; cv=none; d=google.com; s=arc-20160816; b=rWxjOj3KyJs/NXR2aDpJ7EppruL92yYypkDij7L/6yE3bvmIyubKuHBXPFnWu1KWpv 7nRGliKMdMzOB/EO8Eg0coG58Dd5Ke6/bbBRIJR/hydn8skAyHQF5bHR5IQN6CLZCK0Z uNiaC3IANK78h/wTSsBEgqDUaOJiFKGynD60INeqVFbnZXmw5d31iPRzBcj4lb4uQOoA KH4W6bf7L2A/z8vtPTecvyqtjHYucOJstp7IP70Lbh5nXWL3ip4BsUjzIYS4ioHXe2vO QhjdVrujRNRsok0d8LHeF9G/YRoQ3ugLlHkwdJ9ZZBldUUEfjcEObMScVn2W4SVI7Hkm VLLw== 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=2sJS4SPIgf9LPK+mz7WOjOgC2VxMjop3Z+OqbhUt11c=; b=GevD2t5FVc+HIsXxvr8k+9piDFLdb4WsLVXTz4vTPJhf1Sr+CVoI4WDI09egJM9e5u MreUdSWGhZgXNmPwSrA0Bw/QoLqNGpzCpLqiPu0tkqlUlophmYw+UMMwtVEB6I7hzlcY SY8S14dw9hLy6h/QZJc2N4K0l4DxsH6BlC+fxurwJHhgQQ03Yz5tSODnK+YAHkpppeBW lBDgOvSeIw26rNujz19bHcrd+bvIVr1CxfG9IItpRlU8RKT3Pn6Y54VRyygHLiFRnEPB k/q38etZAdPQmiypx2QYHkecy+AoyaA5iOKdBnUThUEiXri1DbXz2x485d2zXfBxKuwY Y/aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jv+4J0Iq; 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 b132-v6si451998ybc.264.2018.02.23.07.48.59 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 23 Feb 2018 07:49:00 -0800 (PST) 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=jv+4J0Iq; 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]:45314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epFal-0005kN-95 for patch@linaro.org; Fri, 23 Feb 2018 10:48:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1epFUh-0008Rj-Pj for qemu-devel@nongnu.org; Fri, 23 Feb 2018 10:42:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1epFUg-0005gT-24 for qemu-devel@nongnu.org; Fri, 23 Feb 2018 10:42:43 -0500 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:44722) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1epFUf-0005ei-OC for qemu-devel@nongnu.org; Fri, 23 Feb 2018 10:42:41 -0500 Received: by mail-wr0-x242.google.com with SMTP id v65so14510731wrc.11 for ; Fri, 23 Feb 2018 07:42:41 -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=2sJS4SPIgf9LPK+mz7WOjOgC2VxMjop3Z+OqbhUt11c=; b=jv+4J0IqcAXvdwQcsJu+wYlfTHUkcwE0qEW9AMrII9oLQUyfG31+Ocpv3da1yd39J3 3sY+v3GNsJY3lxHQHV1i5WQsOUhqWu7WY/iiY/xFrUHUvC1Vm1Wy/MwZJST9mhO638Y+ WnoCuT88J9TlRvPnuHmTV4VjyIXaqjB63OkoA= 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=2sJS4SPIgf9LPK+mz7WOjOgC2VxMjop3Z+OqbhUt11c=; b=sme6qKoYuQthaOxPR6dU+SECfcxRjYkOApboIuY9b2U+LCZ7auEkZPvoy9HIzh0wav fIlKLqVopzclcSKzG3lapo4O+JCfXAkPPeqcfdLEVGl1DOt99jl4TYB7P5a6PoiHOWEi +EUA/QzAEOXwaooUDvrsG60DTlyomy6zGOqjDE/riR/JTj2ytoC7jq8nx7b7Q9uw2zfO JeqeAnnLzPJgAWzJAeApSOLjlyFePbhdRM/tl8fbwWH7P5cQ0oAEza2HY5nH0vR+SgPK 8T9hwPh48MIJVxRWmPFB+156D1m4RrWRqs9E8AOlq3nFFRB63eOxD1EJthH5oV4oQkRh uqvQ== X-Gm-Message-State: APf1xPDnw6lpEdZlINm7Nlmzj157S+I1o9HLUgq9onNufti0pFbI7SVG c8PhvUKAGolBsbZ1lpokcOaQxe39dzE= X-Received: by 10.223.152.141 with SMTP id w13mr2083399wrb.12.1519400560600; Fri, 23 Feb 2018 07:42:40 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id t141sm2395157wmd.34.2018.02.23.07.42.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 07:42:38 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id B4A4F3E165C; Fri, 23 Feb 2018 15:36:38 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-arm@nongnu.org Date: Fri, 23 Feb 2018 15:36:34 +0000 Message-Id: <20180223153636.29809-30-alex.bennee@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180223153636.29809-1-alex.bennee@linaro.org> References: <20180223153636.29809-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::242 Subject: [Qemu-devel] [PATCH v3 29/31] arm/translate-a64: add all FP16 ops in simd_scalar_pairwise 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: =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, qemu-devel@nongnu.org, Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" I only needed to do a little light re-factoring to support the half-precision helpers. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- target/arm/translate-a64.c | 80 +++++++++++++++++++++++++++++++--------------- 1 file changed, 54 insertions(+), 26 deletions(-) -- 2.15.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 806f2eb34a..6eae8bd8b1 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -6416,24 +6416,30 @@ static void disas_simd_scalar_pairwise(DisasContext *s, uint32_t insn) case 0xf: /* FMAXP */ case 0x2c: /* FMINNMP */ case 0x2f: /* FMINP */ - /* FP op, size[0] is 32 or 64 bit */ + /* FP op, size[0] is 32 or 64 bit*/ if (!u) { - unallocated_encoding(s); - return; + if (!arm_dc_feature(s, ARM_FEATURE_V8_FP16)) { + unallocated_encoding(s); + return; + } else { + size = MO_16; + } + } else { + size = extract32(size, 0, 1) ? MO_64 : MO_32; } + if (!fp_access_check(s)) { return; } - size = extract32(size, 0, 1) ? 3 : 2; - fpst = get_fpstatus_ptr(false); + fpst = get_fpstatus_ptr(size == MO_16); break; default: unallocated_encoding(s); return; } - if (size == 3) { + if (size == MO_64) { TCGv_i64 tcg_op1 = tcg_temp_new_i64(); TCGv_i64 tcg_op2 = tcg_temp_new_i64(); TCGv_i64 tcg_res = tcg_temp_new_i64(); @@ -6474,27 +6480,49 @@ static void disas_simd_scalar_pairwise(DisasContext *s, uint32_t insn) TCGv_i32 tcg_op2 = tcg_temp_new_i32(); TCGv_i32 tcg_res = tcg_temp_new_i32(); - read_vec_element_i32(s, tcg_op1, rn, 0, MO_32); - read_vec_element_i32(s, tcg_op2, rn, 1, MO_32); + read_vec_element_i32(s, tcg_op1, rn, 0, size); + read_vec_element_i32(s, tcg_op2, rn, 1, size); - switch (opcode) { - case 0xc: /* FMAXNMP */ - gen_helper_vfp_maxnums(tcg_res, tcg_op1, tcg_op2, fpst); - break; - case 0xd: /* FADDP */ - gen_helper_vfp_adds(tcg_res, tcg_op1, tcg_op2, fpst); - break; - case 0xf: /* FMAXP */ - gen_helper_vfp_maxs(tcg_res, tcg_op1, tcg_op2, fpst); - break; - case 0x2c: /* FMINNMP */ - gen_helper_vfp_minnums(tcg_res, tcg_op1, tcg_op2, fpst); - break; - case 0x2f: /* FMINP */ - gen_helper_vfp_mins(tcg_res, tcg_op1, tcg_op2, fpst); - break; - default: - g_assert_not_reached(); + if (size == MO_16) { + switch (opcode) { + case 0xc: /* FMAXNMP */ + gen_helper_advsimd_maxnumh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0xd: /* FADDP */ + gen_helper_advsimd_addh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0xf: /* FMAXP */ + gen_helper_advsimd_maxh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x2c: /* FMINNMP */ + gen_helper_advsimd_minnumh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x2f: /* FMINP */ + gen_helper_advsimd_minh(tcg_res, tcg_op1, tcg_op2, fpst); + break; + default: + g_assert_not_reached(); + } + } else { + switch (opcode) { + case 0xc: /* FMAXNMP */ + gen_helper_vfp_maxnums(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0xd: /* FADDP */ + gen_helper_vfp_adds(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0xf: /* FMAXP */ + gen_helper_vfp_maxs(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x2c: /* FMINNMP */ + gen_helper_vfp_minnums(tcg_res, tcg_op1, tcg_op2, fpst); + break; + case 0x2f: /* FMINP */ + gen_helper_vfp_mins(tcg_res, tcg_op1, tcg_op2, fpst); + break; + default: + g_assert_not_reached(); + } } write_fp_sreg(s, rd, tcg_res);