From patchwork Tue Feb 27 14:38:37 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: 129809 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp366183edc; Tue, 27 Feb 2018 06:51:33 -0800 (PST) X-Google-Smtp-Source: AG47ELtjyLEAoQLGD8KXu8xchydQzgOPouLSFETyJjkj1KsqiZQ1MOYg9DZXhtix+BRYjqG/5X2s X-Received: by 10.13.247.2 with SMTP id h2mr9773969ywf.23.1519743092968; Tue, 27 Feb 2018 06:51:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519743092; cv=none; d=google.com; s=arc-20160816; b=WO0xr6K68i4WcF3RVtLiE2fZ53pHM151AAcHEzR4xhf38VQcBVGsYZ83yBouLzxkUY ZzzzJoMGbVUZqlChBKGukju0LmDmwu6vfxooWn+zavacfb2FFrhFnFugOSBbH2EzYBDt zK/1k6GxVzCHKogAgxxHSfPVRE5vURellrabFrnYL93IAye29ZRBadd8s8F4cr5FnSFA gcRULRYi8rjV8EqBWsWBOFkvfzsBafObv8m7wuBexnIBBtroAgbR+J0hMhTWsni6Hpgy irSgXHITtv3La/5ekyalOT3PSydWFh5GP7ANP+c8aDz7nxVRbtckTUA5NPpRA+s5A3IY 1gtA== 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=mEsuHeARpZCu6I78SZuzHFH/Yo4lg3kr6uQ6N0s+YNY=; b=sluky5vCfUq38Gg6X5705mE5lVhO4Ba/Rms5IE9Ve3Qavf8bFTTalRxiF+3PH8J45U 5eDOshb5XGex+V1kBmvN43lazPUXETf1mnUxMYWNEbbtycW+vboCgYdh8mHXoOMy98i9 08yAVAXplFG39azR8xb9nGypfYBx5CqfvMqS7DLZoipEuwKGpNWthDPhCbSFSImXofR3 NE/g29a1LrOnf9JZYS36R80b6ToSYcm/5UscYtxgXl8H0fcvPJusJf0bnSe79mfHVwte 8OG7vDuFOwMTyeeLUh4kWUqTyhROUqg/iokgZK3SqGzQUks6Ca4aCb3XZaFpD1aWeZ+B 4ypA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=k2s1kq5Y; 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 f78si1960799ywb.236.2018.02.27.06.51.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 27 Feb 2018 06:51:32 -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=k2s1kq5Y; 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]:37739 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqgbM-0005Ek-Cm for patch@linaro.org; Tue, 27 Feb 2018 09:51:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eqgPS-0003lS-99 for qemu-devel@nongnu.org; Tue, 27 Feb 2018 09:39:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eqgPQ-00083y-Ue for qemu-devel@nongnu.org; Tue, 27 Feb 2018 09:39:14 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:38867) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eqgPQ-00083G-M2 for qemu-devel@nongnu.org; Tue, 27 Feb 2018 09:39:12 -0500 Received: by mail-wr0-x241.google.com with SMTP id n7so25120637wrn.5 for ; Tue, 27 Feb 2018 06:39:12 -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=mEsuHeARpZCu6I78SZuzHFH/Yo4lg3kr6uQ6N0s+YNY=; b=k2s1kq5YIl7Pid/fIAuIe0w7h9mjtRm2DLEhmbkoIy/s4siALHTPz7P5AANM4JuWWF V5quuXElMR77H8jj/fzoWRBPY6yD432wRA0EKzKL5OivOxwd3JvWtNiRzsHNUGSee4b7 lNWKvmcDDvAptt/tt22OHmENGeaF3YNcALYo0= 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=mEsuHeARpZCu6I78SZuzHFH/Yo4lg3kr6uQ6N0s+YNY=; b=O9LgYODVi2UMpCSrFkyrWcC4p8LnPvqDw0oeUax/35ZjBZAHNGFAg/jqIQrWPznD9W PpbM/5lLAx1GZTnmTqpdeMiZuJxt/VqSxishhMbv2c0rjjKvrHWIlEojmVA2q0+LdR0X ikczajGU+XvYKMV2HPNRiPgX2AJf4xtQ96EzlfbquyVBzgc5qXcSo8hKmKfISpJttKTb WXSULjQgtAaUpxXv3irzEZZ3mgGsCq3ZND8H+sgzNCalqLPZ3o3+eL7RAiQCH4Ke6wlm M9Kym8p47ABxFWUNSvJvTCJm0rxH9k1cB7TxGBaat3MQU4PcMPCivkeC5/qI8RxRIgGN Kh4Q== X-Gm-Message-State: APf1xPCSP0sNJELUclUKecmFvGunNT55AiQg1OlEjf+wbQFdf0qce8rE bRuYpkNEx1990ODeoaN2nywBB0SLah8= X-Received: by 10.223.157.131 with SMTP id p3mr12546611wre.278.1519742351526; Tue, 27 Feb 2018 06:39:11 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id v8sm9188933wmh.25.2018.02.27.06.38.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 06:39:05 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 1DF473E0C29; Tue, 27 Feb 2018 14:38:54 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-arm@nongnu.org Date: Tue, 27 Feb 2018 14:38:37 +0000 Message-Id: <20180227143852.11175-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180227143852.11175-1-alex.bennee@linaro.org> References: <20180227143852.11175-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::241 Subject: [Qemu-devel] [PATCH v4 16/31] arm/translate-a64: initial decode for simd_two_reg_misc_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: =?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" This actually covers two different sections of the encoding table: Advanced SIMD scalar two-register miscellaneous FP16 Advanced SIMD two-register miscellaneous (FP16) The difference between the two is covered by a combination of Q (bit 30) and S (bit 28). Notably the FRINTx instructions are only available in the vector form. This is just the decode skeleton which will be filled out by later patches. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- v2 - checkpatch cleanups v3 - update comment on group from following patches. - rm left over debug fpf --- target/arm/translate-a64.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) -- 2.15.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 3487c0430f..9c1892c49a 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -11164,6 +11164,45 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) } } +/* AdvSIMD [scalar] two register miscellaneous (FP16) + * + * 31 30 29 28 27 24 23 22 21 17 16 12 11 10 9 5 4 0 + * +---+---+---+---+---------+---+-------------+--------+-----+------+------+ + * | 0 | Q | U | S | 1 1 1 0 | a | 1 1 1 1 0 0 | opcode | 1 0 | Rn | Rd | + * +---+---+---+---+---------+---+-------------+--------+-----+------+------+ + * mask: 1000 1111 0111 1110 0000 1100 0000 0000 0x8f7e 0c00 + * val: 0000 1110 0111 1000 0000 1000 0000 0000 0x0e78 0800 + * + * This actually covers two groups where scalar access is governed by + * bit 28. A bunch of the instructions (float to integral) only exist + * in the vector form and are un-allocated for the scalar decode. Also + * in the scalar decode Q is always 1. + */ +static void disas_simd_two_reg_misc_fp16(DisasContext *s, uint32_t insn) +{ + int fpop, opcode, a; + + if (!arm_dc_feature(s, ARM_FEATURE_V8_FP16)) { + unallocated_encoding(s); + return; + } + + if (!fp_access_check(s)) { + return; + } + + opcode = extract32(insn, 12, 4); + a = extract32(insn, 23, 1); + fpop = deposit32(opcode, 5, 1, a); + + switch (fpop) { + default: + fprintf(stderr, "%s: insn %#04x fpop %#2x\n", __func__, insn, fpop); + g_assert_not_reached(); + } + +} + /* AdvSIMD scalar x indexed element * 31 30 29 28 24 23 22 21 20 19 16 15 12 11 10 9 5 4 0 * +-----+---+-----------+------+---+---+------+-----+---+---+------+------+ @@ -12236,6 +12275,7 @@ static const AArch64DecodeTable data_proc_simd[] = { { 0xce800000, 0xffe00000, disas_crypto_xar }, { 0xce408000, 0xffe0c000, disas_crypto_three_reg_imm2 }, { 0x0e400400, 0x9f60c400, disas_simd_three_reg_same_fp16 }, + { 0x0e780800, 0x8f7e0c00, disas_simd_two_reg_misc_fp16 }, { 0x00000000, 0x00000000, NULL } };