From patchwork Sat May 12 00:32:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135577 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1556478lji; Fri, 11 May 2018 17:35:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr/XwKr3kejCfhRjcFg1Ru9Q5q/kJmYb5HowhD38ZWgd1nGEdgHvGqGBXfybmWCutpYvVz1 X-Received: by 2002:a37:a545:: with SMTP id o66-v6mr231634qke.316.1526085331874; Fri, 11 May 2018 17:35:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526085331; cv=none; d=google.com; s=arc-20160816; b=Dv5/kVAnWNIo9bRtIOcqol0a3dwrTEmNQieqBeF/kI8sUOYIf4V0vCvEuVzzhjSh5G qOTSJ52OtWBOpqxLU9ZrJp1Ox1udICFYHqEpx6c+JuuzImu5KVr19Z6Uh8KpXy8Bkh+T lHixeUM+SeoWKNN/Dzv9GKsXy+wi2j832TJT8QsU802pkprgixvVQqKACtR0XR5ylmXY 9gzDamKdJfTyDQBzpsG59Jo3Du1Y4k4nLgBsrVnDa6Dy9/dCpNjHlvzaooU5nlFJBB1U 0F5qRRWpwqd7hyZ7uQVv6r12PRZTt1moUHT2FgSgSKZ3iqdAtykpgmoWDDDkz/v6r9ih f0ZQ== 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=qstt3KV9XEiU6WYp5Gae8EBTk4KXlhdI+Nfr21Jhw6I=; b=QZ/zSVShWb2iqqpQcK+7z0wuoGyRgRnolmvzX7w+CIiDawgKakL42Mjyro6DIMfM5o DX/o4jV+fIWRAPcDRVLa0uQ2w5vpn6vwsANSRzVV5Ae02p2J2QSPtQ48p18aBD2nQ8L0 +3pwFsRDXLemgXwKPrB/z4NQZaCJ8NbMkLbkx6Qdc91W+GpPMHzAjcFh/haYJNR1MxYU 5cY9MEtCLs+VvZobxYKnt9c3C9WqiKF0/exSe31SMa5gsyjVvfFuA0MfglFvhyxoueP/ /AT02awJrSM2dlxhnY4SyKHbQF0rdniBayAfOyJYRhvqI7iStVyxfYTkPj+/72K7v8O7 Pc8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=J7Aed4Fi; 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 v12-v6si4364599qvj.5.2018.05.11.17.35.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 11 May 2018 17:35:31 -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=J7Aed4Fi; 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]:58516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHIVX-0002bv-8V for patch@linaro.org; Fri, 11 May 2018 20:35:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHISg-0006ak-Bp for qemu-devel@nongnu.org; Fri, 11 May 2018 20:32:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fHISd-0008C0-OQ for qemu-devel@nongnu.org; Fri, 11 May 2018 20:32:34 -0400 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:45648) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fHISd-0008Bf-JY for qemu-devel@nongnu.org; Fri, 11 May 2018 20:32:31 -0400 Received: by mail-pg0-x244.google.com with SMTP id w3-v6so3066802pgv.12 for ; Fri, 11 May 2018 17:32:31 -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=qstt3KV9XEiU6WYp5Gae8EBTk4KXlhdI+Nfr21Jhw6I=; b=J7Aed4FiFmkZAJxuzy5K5BoFs8ZtOwOnThE0GXo+4z9qnnCKXzqRS+W49J5ge+sr+M SHolf1/5VJBvpnVvshAnfkFUMTQpQbBtPnJ2LGbn5QezA913+roIOUXPe1AB5ohSgtLG SDTe4I6GkBCtP2c1VmXfJusyjQaBvYmhMcgVo= 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=qstt3KV9XEiU6WYp5Gae8EBTk4KXlhdI+Nfr21Jhw6I=; b=loxQDFoJC1hMpBkBEHvkIYBnWzngDnKC9dFcslLPAsXT8mP+jazoJeukEb8ZtXDCe0 NZlbL0UShrFYyoqK89XuoQ5s7/mA64NxE8Jpo60wyFvrulVL2hJGCTsNzwtNG8SsC2qa h9ehqjMVfsOMzxxFtSEqc9Uljx3G8vGnVCAYZ2fROkIIAhcpkxnYAI3bCXkDnRCku4Zh fSrjKbUUMNR2sEVX5+qYUB/5G3PRhEVQUlOlvhOMYmlRVph3VdDx5fTBgpQIlRDCqr7D ayD+Wnzzlnahkf5HmIoRkhHR4J7dJguHcJbRXtMFZf9t216JrkOSRfM/ERLy+j3zIaAz 2b4A== X-Gm-Message-State: ALKqPwe/HDU9+eW0KrndYW/3T9KcUkWYdO3khiohW878b0hlQY0OtjzI ukritMT3DKbNqULyIKcvW+optoI1Pa4= X-Received: by 2002:a62:1a4e:: with SMTP id a75-v6mr957733pfa.84.1526085150229; Fri, 11 May 2018 17:32:30 -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 v186-v6sm7599735pfb.45.2018.05.11.17.32.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 May 2018 17:32:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 11 May 2018 17:32:13 -0700 Message-Id: <20180512003217.9105-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180512003217.9105-1-richard.henderson@linaro.org> References: <20180512003217.9105-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::244 Subject: [Qemu-devel] [PATCH v4 07/11] target/arm: Implement FP data-processing (3 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 fma operations. Cc: qemu-stable@nongnu.org Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) -- 2.17.0 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 66607668ce..a79c09eda2 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -5477,6 +5477,44 @@ static void handle_fp_3src_double(DisasContext *s, bool o0, bool o1, tcg_temp_free_i64(tcg_res); } +/* Floating-point data-processing (3 source) - half precision */ +static void handle_fp_3src_half(DisasContext *s, bool o0, bool o1, + int rd, int rn, int rm, int ra) +{ + TCGv_i32 tcg_op1, tcg_op2, tcg_op3; + TCGv_i32 tcg_res = tcg_temp_new_i32(); + TCGv_ptr fpst = get_fpstatus_ptr(true); + + tcg_op1 = read_fp_hreg(s, rn); + tcg_op2 = read_fp_hreg(s, rm); + tcg_op3 = read_fp_hreg(s, ra); + + /* These are fused multiply-add, and must be done as one + * floating point operation with no rounding between the + * multiplication and addition steps. + * NB that doing the negations here as separate steps is + * correct : an input NaN should come out with its sign bit + * flipped if it is a negated-input. + */ + if (o1 == true) { + tcg_gen_xori_i32(tcg_op3, tcg_op3, 0x8000); + } + + if (o0 != o1) { + tcg_gen_xori_i32(tcg_op1, tcg_op1, 0x8000); + } + + gen_helper_advsimd_muladdh(tcg_res, tcg_op1, tcg_op2, tcg_op3, fpst); + + 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_op3); + tcg_temp_free_i32(tcg_res); +} + /* Floating point data-processing (3 source) * 31 30 29 28 24 23 22 21 20 16 15 14 10 9 5 4 0 * +---+---+---+-----------+------+----+------+----+------+------+------+ @@ -5506,6 +5544,16 @@ static void disas_fp_3src(DisasContext *s, uint32_t insn) } handle_fp_3src_double(s, o0, o1, rd, rn, rm, ra); break; + case 3: + if (!arm_dc_feature(s, ARM_FEATURE_V8_FP16)) { + unallocated_encoding(s); + return; + } + if (!fp_access_check(s)) { + return; + } + handle_fp_3src_half(s, o0, o1, rd, rn, rm, ra); + break; default: unallocated_encoding(s); }