From patchwork Sat May 12 00:32:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135582 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp1561346lji; Fri, 11 May 2018 17:41:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr28uAoiyV4sq3e0YJTOfRgtCfg1PkSr/N1daIPL0PJ8jnWs5vgYZitvhMsGQFrphv5m0AQ X-Received: by 2002:ac8:678a:: with SMTP id b10-v6mr217594qtp.327.1526085674631; Fri, 11 May 2018 17:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526085674; cv=none; d=google.com; s=arc-20160816; b=pVt6wXsi2OORn3pv7D07UAWIiGWJlpngX6weC6FSQTK3sekrAgMf4y245yAumw0xaJ uk4tDinvuH6HEUxVpHHBUdjfWlttldlRxpa5NOTgIlr3r9xe4TaSnp3BIsEeghWLWY3+ 4QJec/Hx63mb6hfKXlFhzLZs8SGi2KYOUvMtJtqGofu9B/IHC80AdOFJ08HJpW8sDpA/ uxkrjhhD7UsTFl7Z8WFObLk0b/uqAVAUYVYtJpMwTCB9owJdMOnkSWku6z+IQAAVsUL4 I1OCmp38rXxLOwF43+sAqhVykDMy0uFS9S62ozn4A9HnFciAGqx1kUbdrgu0IDuoJK+z p2wA== 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=z7RHRgG2s+F0ZUK/4NX4wdUU/J9Oz5lKrqYK8foQtYA=; b=defPFjJpyKAAsFhPaljqUg0XsMAGZOFV+8u3//xOZfpKQYqNOds9GFAyx32gwLybKA r4tyKcE/frt56CR/RYdV7woBUTTgF6pE4BGRh69kN6voCSntjQMDDPD45oO+slUJxu/A RrdB0yKxbqZCoAcYjraPv6ya5Y2PO+caL94iEYPtQ1u5Y25RAxEYJk1SzyzHyuZh3mIS tngmoHjKWxkltWpRtTdb7TbOAmzmScCN7soNoFPejN2Cu35wwaIEKYGiJ12MDrSaAJFi Tf9NdW/Moamfkr+2CVKbLz5pW7eHCWcVcztxUMzCnEiAZXKw6Dq6nup3Pt+FkYJ3dCDk z49w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PYE1+Caj; 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 f16-v6si4222532qvm.80.2018.05.11.17.41.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 11 May 2018 17:41:14 -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=PYE1+Caj; 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]:58696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHIb4-0002ec-2T for patch@linaro.org; Fri, 11 May 2018 20:41:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fHISi-0006lj-HW for qemu-devel@nongnu.org; Fri, 11 May 2018 20:32:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fHISh-0008Dh-Ok for qemu-devel@nongnu.org; Fri, 11 May 2018 20:32:36 -0400 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:44939) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fHISh-0008DM-Jo for qemu-devel@nongnu.org; Fri, 11 May 2018 20:32:35 -0400 Received: by mail-pf0-x242.google.com with SMTP id q22-v6so3423122pff.11 for ; Fri, 11 May 2018 17:32:35 -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=z7RHRgG2s+F0ZUK/4NX4wdUU/J9Oz5lKrqYK8foQtYA=; b=PYE1+CajTqcoTC4/9YssfdssPNSrAXzy5MABPjlZSqPiVYDWrWBZEOpy7rKLhGE76Z VFBYMOJhCr+OOTPQdo0vwyV2bIJ3pi1JnSVUFVdr4oA45tg0yAPUA+JXiEGufLf1g8LU 6SqeT6U5VmuXUVGPP4ICk7yur6z6OK7N4MAXo= 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=z7RHRgG2s+F0ZUK/4NX4wdUU/J9Oz5lKrqYK8foQtYA=; b=Oadhdg6pvDNu+qPoEINEBybYjjHDBjLv+G91QTdvcpKxG5xwzANJx8rUW3xiuFm/5t lJB+FOcxDZiC1NQudcOEjNJ9gaOY1oLItC7Gn3hj281M+ef9Zb4BJA3j79rDCMr2DZTT o5HxFVVUaqeXATQw7BWHuBPEvM8S/0Bg11/E9Qlqq1wUa+WDbjJTFbqjAICngK9jyUeU /cINqngEtR3uYKZswCMKwF72FoBkTGjY4SppjQU4HPmd0/0urKQ9sdDw8cI/OvAVZsq8 I4Tu3JNM+3/O0+XMHA3r172eHuMsMSrIY40+Up+ARf+HpER8h2er6W4sAN8olX4HdnAI O8+w== X-Gm-Message-State: ALKqPwfHlkndF0BEqtrehNtcFGCl3yanZCVEnuH6uGyVyTrr22/Mzzhv n539aNDfVZlHrqAKU/01qm3ARGMT1NA= X-Received: by 2002:a63:6016:: with SMTP id u22-v6mr980103pgb.284.1526085154328; Fri, 11 May 2018 17:32:34 -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.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 11 May 2018 17:32:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 11 May 2018 17:32:16 -0700 Message-Id: <20180512003217.9105-11-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:c00::242 Subject: [Qemu-devel] [PATCH v4 10/11] 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: 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" 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 [rth: Merge unallocated_encoding check with TCGMemOp conversion.] Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) -- 2.17.0 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 9dacb583ae..35997969b4 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -5674,11 +5674,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; } @@ -5687,7 +5701,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);