From patchwork Mon Jul 23 20:17:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 142663 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp6522958ljj; Mon, 23 Jul 2018 14:39:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd9R3ehFkNiPjhYaD+8aqqBgqWVEA4gCxZNrn+AEn3+JghZVjSwSOVcpufNg9ctY2mLKqJh X-Received: by 2002:a37:c88b:: with SMTP id t11-v6mr13061241qkl.426.1532381971287; Mon, 23 Jul 2018 14:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532381971; cv=none; d=google.com; s=arc-20160816; b=ha+cfAj+DR5JzUk50aHQQ5K78xJo/dt89MZCWuN1M9fOaZIwyxUQYs7hvlVXIaIqeG fdDS+Utz9zUGIF8ap/szmW+DKbhahoQMRUWbv7/vRMi/sGD/xUyqgTRtkE7RpLqMw5qe Y5C1XIw9FISKhF2pOgiGHrdntOJ6/F3wANO5no3/M4Yzd0bZC/VF3sohVFn+l7jrvUqC izpTRt80nwa6OHFc5Io7KUyP9+kjGE1T6Prt2sA1LcWldCwFDRmBpo9cD1egdKB1pd7i MBA1Yc/F28NXqxHATqgvKdmRa5uey8Q352y7VrOx7igLd+wG6zVZazIPmDtkQFK/s2dA Uo3g== 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=9tH4pupl7s1gkH526KWx8Yj77S7uAqfJTbdOKzq4alk=; b=IuWDExhxaB963fUo5nhfE65JzX1qYg4nOq740scQ6Vl8+6Enyz3xb9TRzeJ22pUoxD rix5i0xRrbANtZMiEaB1g0WHvQfa3gpznYo04UfyIZ5Pl32v913Y5wRL2NdKz1IPqTse Blpe2ZO9Z/yhq+6Cxr65xjTpsrRh8g2WM17Er3bjvpIM0UubidCdQEmM42AJnOMFU/+9 B9PFLHBBHRoNSS8AHUswNJuuoYjKW0VtoLD6HBHj1Qdvf3WALh5LIV0uvjymVFKnK2jD rJCxi1mspG3jU2uYUCM7QEYyVeZ1/ezdNgIJdxfyIoVt99nVWjJd8PveaiAw61oZtCZ0 1HsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=IKye51sg; 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=ibm.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id l23-v6si4589758qtc.78.2018.07.23.14.39.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 23 Jul 2018 14:39: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=@gmail.com header.s=20161025 header.b=IKye51sg; 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=ibm.com Received: from localhost ([::1]:36853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhiYE-0007t9-OP for patch@linaro.org; Mon, 23 Jul 2018 17:39:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhhKw-000488-V7 for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:21:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhhKw-0005Ub-07 for qemu-devel@nongnu.org; Mon, 23 Jul 2018 16:21:42 -0400 Received: from mail-oi0-x230.google.com ([2607:f8b0:4003:c06::230]:35556) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhhKv-0005UP-Qn; Mon, 23 Jul 2018 16:21:41 -0400 Received: by mail-oi0-x230.google.com with SMTP id i12-v6so3508334oik.2; Mon, 23 Jul 2018 13:21:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9tH4pupl7s1gkH526KWx8Yj77S7uAqfJTbdOKzq4alk=; b=IKye51sgDP8+fme/s08wDIyStNwflkUtM9wxquPff2kOWrBGG6A/nFuYxa3ryOxEWZ JD2VRx/EslNq93nlRxDlC8E0H0+U/ENr1lvc//gmUFg29i5lriDCmtv3Qc0a3GKwfu3B T0FXo7fUHzmmRtp9vywraNbALgvrkfFt5ZrjlwiNIVDWiY6cGx/hSxmOq4bD3N5yqpnH Sd0eKLp4wQumHbwoPzAYs0qqLQeb+Moin+P8vDfH3HryLTkhZECYwU1MANWRzrNZNcG4 mT5LJFC3P2AagsLNrx4Ab1OSRnn7nnE1R0J0q9lKQpdWzNMVw5YEB6zc5dhhMO3U28u3 QBxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=9tH4pupl7s1gkH526KWx8Yj77S7uAqfJTbdOKzq4alk=; b=cvS5/3MLJ/67YUevK+FxfZqK7Q/4c1yxpgtCTZz3J54OHCt9mcYGfJr3gaI6a9TyMO 5/J6eFUxArwsXvuU4aonsvFFS10MXGDARNj7mThHiSIiP89gZcBP2TBUCK6Iu2FLloQv S29qoX2Vm3x05REZtt9eM7CxkrYTdswiH8NWjgjJ/bQrgGb4xurDAfsgZN/1dWawN76u tdEUgl7s5CMVyVfUoqqYCMIJO9hGlEAuDlJ0HiwreNnhFJHx8Nl+1K4IkxTxBDZQZD14 AG2XowiqRDH5fKyYcPX0c29lhGHgnsAVeNVppDMA1HTgc6AN+o97YjYnvcp6IhT+slkZ uTVA== X-Gm-Message-State: AOUpUlHWBDNrGz+fkrtYDvcsduN+4pVuSPWtrZWZNtUWS3Ot6giASWpq gj3yNEVPlbxUXzWunkMQ4eB8Bb3uTMmlhQ== X-Received: by 2002:aca:f58f:: with SMTP id t137-v6mr331453oih.244.1532377300682; Mon, 23 Jul 2018 13:21:40 -0700 (PDT) Received: from localhost (76-251-165-188.lightspeed.austtx.sbcglobal.net. [76.251.165.188]) by smtp.gmail.com with ESMTPSA id m7-v6sm7929283oia.32.2018.07.23.13.21.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 13:21:39 -0700 (PDT) From: Michael Roth To: qemu-devel@nongnu.org Date: Mon, 23 Jul 2018 15:17:33 -0500 Message-Id: <20180723201748.25573-85-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> References: <20180723201748.25573-1-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::230 Subject: [Qemu-devel] [PATCH 84/99] target/arm: Implement FMOV (immediate) 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: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-stable@nongnu.org, Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alex Bennée All the hard work is already done by vfp_expand_imm, we just need to make sure we pick up the correct size. Cc: qemu-stable@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Alex Bennée Tested-by: Alex Bennée Signed-off-by: Richard Henderson Message-id: 20180512003217.9105-11-richard.henderson@linaro.org [rth: Merge unallocated_encoding check with TCGMemOp conversion.] Signed-off-by: Richard Henderson Signed-off-by: Peter Maydell (cherry picked from commit 6ba28ddb9be37bdb67e3e38007a53ccbdcd010df) Signed-off-by: Michael Roth --- target/arm/translate-a64.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 7075f27e05..f4587c3814 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -5431,11 +5431,25 @@ static void disas_fp_imm(DisasContext *s, uint32_t insn) { int rd = extract32(insn, 0, 5); int imm8 = extract32(insn, 13, 8); - int is_double = extract32(insn, 22, 2); + int type = extract32(insn, 22, 2); uint64_t imm; TCGv_i64 tcg_res; + TCGMemOp sz; - if (is_double > 1) { + switch (type) { + case 0: + sz = MO_32; + break; + case 1: + sz = MO_64; + break; + case 3: + sz = MO_16; + if (arm_dc_feature(s, ARM_FEATURE_V8_FP16)) { + break; + } + /* fallthru */ + default: unallocated_encoding(s); return; } @@ -5444,7 +5458,7 @@ static void disas_fp_imm(DisasContext *s, uint32_t insn) return; } - imm = vfp_expand_imm(MO_32 + is_double, imm8); + imm = vfp_expand_imm(sz, imm8); tcg_res = tcg_const_i64(imm); write_fp_dreg(s, rd, tcg_res);