From patchwork Sat May 12 00:32:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135584 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1563083lji; Fri, 11 May 2018 17:43:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZouljdSQlE8Zvqu8MFGRdHSV0KimNdyE/xUINFnEFPh01XVCLk1BCmLcsi0lC9Mwe+4+TWa X-Received: by 2002:ac8:34e7:: with SMTP id x36-v6mr258565qtb.416.1526085790896; Fri, 11 May 2018 17:43:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526085790; cv=none; d=google.com; s=arc-20160816; b=DI/nO8shWgDCtNzl/eIELKBAzo0Mcem4q39UWjSm+uu0GmXDg4JVxmmvVF8FYcwUgn jwb2mahVeRM5RQOAUXIDypm+5+H0frW+BlQxB6AI28n/ANCeNR0Hft+ZBuCQRQs6poh3 26sxWirzLJhDvXKh2WwjC3YyclxvXQKjXeWkySPo0zs6Ciu1VqmgP4j7boe6zdxMgD6X SG6JGtN1/pxhcqEqF87R/BxL8CzvX3lXbrYs0lPHOO8pFgSE5M3FMDsagX1TkzGb+V7B JDQbqpj9zCOPEZTcn2UBzR7grZ935J0eQJflje749Jg3cDOO9t0D0Cr/rQFjGF2DMqq8 400A== 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=go/aa16PzRx4OtSxW2YHgX7wkUGXn+mUkmEp3rEJhGE=; b=ZO2O7wJXdXM9APssf8tqZJO74CDXR27wMCDPCv8P9nGYkmi6XY5g2cCVQdgLfIYmal OkvgS4WLyRVAzRixS3C8VYC3eljerprrl3KjcLKI3+kbnU8CynfEmLUcrVcc+0n+wmAo srky05iTnFrtKhXhOKm2jamUy/xc0eiusKphWFFKQiFQOeeNF3PZQ4/yQnmbA1J2+sGx 7EDyf3UPmB/4NJzFFF6wQB8+0mutL+CzbRKH+JOM40htQ5xlKFcJ9izD40kKEZkPfyro GpwCTQFhox4g0ULPA3edK0xOqyuN9ChnttB4IrEdrZkoPuoVtyXAfFj3jjn0OhpTlj4h kmbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UoV2zyeL; 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 w13-v6si4162640qto.314.2018.05.11.17.43.10 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 11 May 2018 17:43:10 -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=UoV2zyeL; 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]:58918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHIcw-0000on-DH for patch@linaro.org; Fri, 11 May 2018 20:43:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHISd-0006Ld-BO for qemu-devel@nongnu.org; Fri, 11 May 2018 20:32:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fHISc-0008BP-CB for qemu-devel@nongnu.org; Fri, 11 May 2018 20:32:31 -0400 Received: from mail-pl0-x241.google.com ([2607:f8b0:400e:c01::241]:41330) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fHISc-0008B4-7C for qemu-devel@nongnu.org; Fri, 11 May 2018 20:32:30 -0400 Received: by mail-pl0-x241.google.com with SMTP id az12-v6so4127474plb.8 for ; Fri, 11 May 2018 17:32:30 -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=go/aa16PzRx4OtSxW2YHgX7wkUGXn+mUkmEp3rEJhGE=; b=UoV2zyeLlzur0/5PPJV5TxBzNN8WmTGl2ALZ9S8boL4QkwhC0Aj6ePxUiO1NWFb1lH 3zihocrkwpY7x2m+bVnTIkF+endGnetdKO1t0ONagF3/fGCwp+xm/qxI0jhgE8YxdG+U TYgHtc/+RugHOqN3TegAtMxjClehmxL3PhUyY= 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=go/aa16PzRx4OtSxW2YHgX7wkUGXn+mUkmEp3rEJhGE=; b=csLb7NyhJOWUFZxNkTjgJQfIaEOJzQULwNSrxmE6FDC4smOYqtRe9ozyIwd1dHfoDZ DFEmJSfVCEGhYCircGtCz20nsMhPyvQXSjG4Nq1Y/Mv/xbAdyl9iuvFuAtnv9C7sR2sZ MMhgQk8l6/5UsRWk0K5innY56BB/0gcGB2RTtWprHTm9Q5f4KG3XuLinROwc5wLXGeAX m4nDFqedOab98+Y4Ha6AcRjW+AUiiY0LXFyhoYs8O5rZAX0KBHZxpxRG1Xwm2Jhtwyg8 Z53b3P0MmGouZKuZhAZ6KgiM0Cg97Z0CR3pVFLM85K1kRMvIxqhMCtcdzGbCLEFRMv98 pTXg== X-Gm-Message-State: ALKqPweU0oW7RJ4hCT9pbtEDrbPwjC5rehWmjC0fGJuff8RRcPWX8OCa 9CQKY4u94/PF8cwsq/07n26K0CMqJck= X-Received: by 2002:a17:902:5a88:: with SMTP id r8-v6mr281475pli.78.1526085148965; Fri, 11 May 2018 17:32:28 -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.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 May 2018 17:32:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 11 May 2018 17:32:12 -0700 Message-Id: <20180512003217.9105-7-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:c01::241 Subject: [Qemu-devel] [PATCH v4 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 78f12daaf6..66607668ce 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); }