From patchwork Fri May 11 02:44:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135468 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp325581lji; Thu, 10 May 2018 19:46:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqguewga51HN/qEiO1pQocuEEb4nTHHl9L2IRpLAK+zPVfmKhhiA3M6PYMsZW1LvYDX+1Yv X-Received: by 2002:a37:9342:: with SMTP id v63-v6mr3663836qkd.40.1526006779595; Thu, 10 May 2018 19:46:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526006779; cv=none; d=google.com; s=arc-20160816; b=ZFwtNBMOeaDVgKI2a+d3mXwrOPeka7p/LzwDPYA2cIyLCdkG044ucekocBUF52wvhG rMsrI1YE0QH0t9OsixJMc/ENdrM3Ws3osswJjjgf8draQIY26A4fvnxTJePwXl476fG3 dxMFAWYy1/Ch4l+7fHwhaLuUQCAQV7dMzNkg3n+S+08FCt/9XzcFy4H+gM15cxK+l9av h3UZyu72Iy5xI+0fWsVq5XYsnqV+y3i74EYIwPhfKvb4Da5bAyvqIgzd6ijNneznmOrO t549VtikLswDRhBRBlTZGBxZq+yRmrKDJEh/hx70yYAhUy5rTakT369/buFYCqGmMB3C giMQ== 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=syQxlWTmbSK8Q3TAku1LWmkyym/aXYqXxRnVattmjbE=; b=Nxhu0yxPjsjL4QUwGkd0wSm8oybZP5qDphsitBKbRdBH0FSiLZfyqn5kwGXhPnhOeE HoxIKADz2kCcJ4nIqlDpyeENu9PfRkUHL7EJ+WDlJqvgGU2dyyBS0GGK07MXWRo2vPgx aGW8/u2r5N3fz78VOo6gyEAmoJMJ8YjYBJG1SX1OGyfnSCXpNh+D3fegj7yDeTPjBBI/ 9VUWtNwW+z5TVwnkQIcMJnxxJ8KnoNNtutFKKZn8xHEcKz4YhgQn4HLFm/MwauEBDEnS YFxCcear+8Rj3W+QJC6PAFMbaUa4Ar5hJ0XoVgBrNLgsg7Zw1H+W+y17Nx/NUoNsTJ/e HWeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=dRKiyUiy; 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 b31-v6si1844199qtc.325.2018.05.10.19.46.19 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 10 May 2018 19:46:19 -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=dRKiyUiy; 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]:36437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGy4Z-00031b-0T for patch@linaro.org; Thu, 10 May 2018 22:46:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43876) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGy3d-0002OP-5P for qemu-devel@nongnu.org; Thu, 10 May 2018 22:45:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGy3Z-00063V-VU for qemu-devel@nongnu.org; Thu, 10 May 2018 22:45:21 -0400 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:38048) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGy3Z-00062W-Qh for qemu-devel@nongnu.org; Thu, 10 May 2018 22:45:17 -0400 Received: by mail-pg0-x244.google.com with SMTP id n9-v6so1792591pgq.5 for ; Thu, 10 May 2018 19:45:17 -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=syQxlWTmbSK8Q3TAku1LWmkyym/aXYqXxRnVattmjbE=; b=dRKiyUiyERApql10SWqEKjDf9hwIGEjEBS4UjH2agZ+uYC4yDA1RgJNv5CQ2iL0Ihw ndELn83h/VkymlDUprbKNV1+6ZgcD8wGmOcMFKpxg3xGNGhwk2VeT5keBBmCE7dGNZEK i+OczS1hw5KBnfKfmnuXOkYAsRY/VWIQNo9fo= 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=syQxlWTmbSK8Q3TAku1LWmkyym/aXYqXxRnVattmjbE=; b=RmVx0yYJ1mjn4wIvM/FnZtC+dn9Urgv7TtVXt6EeQTJe5TKaQrxlKnrzX5kZM1t+xm NxbrsdgwGLmVumcX/FUbYlmbL9paVV9SyIjZVDllt4ba6utnUPNgy4j6N7ldmlcCo3o1 oB1vrmQ/T5A3AKKuJ1hYJx+++5hd83JaEkl1q0RzaC77IA8zwTiBckI6Xq421H8KsudZ zVNf9nQntFxIl9aqg832/6Wq2fyT4bXj89sQLLPmpt8aTJ5+ASyclv1+JA5R+Vb9cBgz 8LRwII3F6tPy2+vyHEzOBPqf/6T3wUVabc0JHXp9e/HSW9A7Ds9U7MXJ9a1g9VKC8RHl O+EA== X-Gm-Message-State: ALKqPwehJTf0vo5N0Cg5GnBqEOhUa6q/UBhDjAtXUfYDETaU4Klzv+z3 wL26uzdYRtSEhJNzLcSJp/HnaqBTLYQ= X-Received: by 2002:a62:a50c:: with SMTP id v12-v6mr3657368pfm.237.1526006716542; Thu, 10 May 2018 19:45:16 -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.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 May 2018 19:45:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 10 May 2018 19:44:50 -0700 Message-Id: <20180511024454.31679-8-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::244 Subject: [Qemu-devel] [PATCH v3 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 1264e798a7..523fcf4801 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); }