From patchwork Wed May 2 22:15:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 134870 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1206919lji; Wed, 2 May 2018 15:24:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqOuPQu2Nrcv7ZqEOv9Iz0LFUtjl9f141wgBD5fWRKd3PpEcrzeE8145sWwXGA+VTHwCpHH X-Received: by 2002:ac8:668c:: with SMTP id d12-v6mr17382754qtp.344.1525299896052; Wed, 02 May 2018 15:24:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525299896; cv=none; d=google.com; s=arc-20160816; b=PqrQ67UqSQmmQIUMo507M/gev06m87CfOseABbmjqVx989/o/3fF46PUiLkxxitTfq cEKCP5dk6HWy1VDo6pk0A3K/Zah6lzyKQumz8nvW9DWmo1C0869REEb4rRZJfIhDWtQU jb87UiCQuHErwS7i/LaSGR+KiMqvQHCkVLzzuDK/At3em1KlOHxFgHQCRE1UhGmVh7ML c2zhIJmaboKCaMvm3pMleQBijxNhBSkLFVu3/d+kVR5mf2zV/m9PqSc7HcSzRXce2UE9 PFZ47ICAWGX5pbqB5yPPnHl0BO2/4tdp7Un+7aAxbFz/wbadsAUFcxg/U3+fEHchEd8j iP6g== 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=WdCxTa5pgWvjIsEE2akqA9yOnPVSsIbNJWqXsUkxDak=; b=t+MY+JZzwflSftIuOAqc7Hws+lvie1yQlkyEDhr+NjFQbuq9/TU3E+Mj6gbUhqSTQp xOaHRLjFvTZN0rRA3UN2xkxfjTls/T2e2+YX+unf+dV8JX1VxgUE7IOubk+DIIEriYDn vuhx/fJtoPX/O7tgBuzaV7LX9g+E83ETcxvu7mNbY3HMciSQpTz4JQecvoRL6+2g57AV Wlnhdi7LIB/F3Rlbau+o8FuM/6p3+PYQVdhW/l51gWLXE0O+3E2vBmiNETKzbpM4UNjn woRetUslZ/DWNxZ/NR6MaZwQSKF8cTG4tDeo72jQbnI9NCy9NqtmEKch7P/HCeFpWvxa Vrtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Wkv3xhCH; 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 y7-v6si1515845qvl.90.2018.05.02.15.24.55 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 02 May 2018 15:24:56 -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=Wkv3xhCH; 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]:52843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fE0BD-00081O-Gn for patch@linaro.org; Wed, 02 May 2018 18:24:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fE02j-0000lk-9i for qemu-devel@nongnu.org; Wed, 02 May 2018 18:16:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fE02h-0007wv-PF for qemu-devel@nongnu.org; Wed, 02 May 2018 18:16:09 -0400 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:33605) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fE02h-0007wT-JQ for qemu-devel@nongnu.org; Wed, 02 May 2018 18:16:07 -0400 Received: by mail-pg0-x244.google.com with SMTP id i194-v6so11634147pgd.0 for ; Wed, 02 May 2018 15:16:07 -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=WdCxTa5pgWvjIsEE2akqA9yOnPVSsIbNJWqXsUkxDak=; b=Wkv3xhCHfVS2BVCCpwYkw9knikADuJp/4otyphPboxDxwzhDRloZCRUDft7jeHx3RZ EBjMQIB6mC0G47W9pppW10fxQql0TVy80B4Z0fp7uIoVUx8fb6lajbQRiDqvQC69zxRo HniQxf6IhOrV8+98kw7TLlrmpI4nfWUGaRSyE= 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=WdCxTa5pgWvjIsEE2akqA9yOnPVSsIbNJWqXsUkxDak=; b=QYsodELDv54CmtMuCW9ikSRmPfgfRVVCaPbD5DnqR8olJuCinzgXDzfxGgz2ujyXKH JVMmEeEKAB9j9spN7iwvW6wz1iZDEKEybRlfhW4BytWBcGkvdhZZMt8t1c75xLQDLbdq ElzPTj6ntva1yREPYv34lDwtf9eGNICwC8LwBRfIFpjZutEsi+QZUq6tF1lKsfiT7UrJ JeJx4EQKOieGTP9ddl6dbP0+edu/tYuPW4sz/5fvlv3VqOJy8Dl+2Q4oRvcWBylwhxeo JsG6fr/Fns31IlHwC4H7fT4QyDQf/4VisEprjY8lOcPx4I6VijCH2v5g96CS/36ntHfU dvBA== X-Gm-Message-State: ALQs6tDtLY0HGMc3DiDmNOE2iPllG94ZXEeEJMW/CxRPoSaYm7QpEBt0 PYkk3NnkBkdkmqxghFWKui0irwL1sdg= X-Received: by 10.167.133.206 with SMTP id z14mr20763807pfn.2.1525299366423; Wed, 02 May 2018 15:16:06 -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 65sm26170145pft.74.2018.05.02.15.16.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 02 May 2018 15:16:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 2 May 2018 15:15:47 -0700 Message-Id: <20180502221552.3873-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180502221552.3873-1-richard.henderson@linaro.org> References: <20180502221552.3873-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 v2 09/14] 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, qemu-arm@nongnu.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.14.3 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 8c63d5e743..d7a49ef2e4 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -5062,6 +5062,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 * +---+---+---+-----------+------+---+------+--------+-----+------+------+ @@ -5094,6 +5149,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); }