From patchwork Sat Dec 28 21:49:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 22769 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7F5B3202E4 for ; Sat, 28 Dec 2013 21:49:23 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id oy12sf12855441veb.5 for ; Sat, 28 Dec 2013 13:49:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=mEkF0mZgJuIidp95h6vIDV9V95AWcnY0HbBvsia3tFE=; b=W5J20hATFqpef67efSQHv3JYUIJw2GXO0rMgT9SojW/8HF0Ai3/m+d0MRw1hl0yyXY H1hVrJh69zak7abi1z30oOEJZyKAXPJg4vG+A4E/dctB+kw+C+7kM3Y3/TLggiW1Eodn Vkb+4rI0H4XBIMYJbt/JHTsTs5aq0TGAndNtZkcYRkHz/jQJ/u0aawmLR5uu2R4k70Jh /4Gy15fS/Pwmszo8pjxtLW1wqRrQzgs0SyLHEhGkQoAF/lRB4bu4ih/K5OeZEnjb1THn Up1oUzUj47PdLatwduXzypMNAe6t1fq3xwuIed9wqZuO2qQ4MyX4rDZN9hJX20KNswwE XSKg== X-Gm-Message-State: ALoCoQl4VSzUbD8OCXpVGzuzgBpgmf2o3272fHYqt7TZY2PrteroSSNeyRfAwDU3sMvnqdb6iomA X-Received: by 10.58.50.161 with SMTP id d1mr20966595veo.24.1388267362653; Sat, 28 Dec 2013 13:49:22 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.25.196 with SMTP id e4ls3081318qeg.6.gmail; Sat, 28 Dec 2013 13:49:22 -0800 (PST) X-Received: by 10.58.22.233 with SMTP id h9mr109508vef.56.1388267362577; Sat, 28 Dec 2013 13:49:22 -0800 (PST) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id eg7si6719569vcb.137.2013.12.28.13.49.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 28 Dec 2013 13:49:22 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id oy12so5330513veb.26 for ; Sat, 28 Dec 2013 13:49:22 -0800 (PST) X-Received: by 10.52.229.195 with SMTP id ss3mr9743279vdc.45.1388267362496; Sat, 28 Dec 2013 13:49:22 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.13.131 with SMTP id ey3csp529334ved; Sat, 28 Dec 2013 13:49:22 -0800 (PST) X-Received: by 10.66.164.136 with SMTP id yq8mr59971103pab.67.1388267360996; Sat, 28 Dec 2013 13:49:20 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id sz7si27054040pab.58.2013.12.28.13.49.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 28 Dec 2013 13:49:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1Vx1kt-0008I3-Ea; Sat, 28 Dec 2013 21:49:11 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Alexander Graf , Michael Matz , Claudio Fontana , Dirk Mueller , Laurent Desnogues , kvmarm@lists.cs.columbia.edu, Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Christoffer Dall , Will Newton Subject: [PATCH 06/10] target-arm: A64: Add fmov (scalar, immediate) instruction Date: Sat, 28 Dec 2013 21:49:07 +0000 Message-Id: <1388267351-31818-7-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1388267351-31818-1-git-send-email-peter.maydell@linaro.org> References: <1388267351-31818-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Alexander Graf This patch adds emulation for the fmov instruction working on scalars with an immediate payload. Signed-off-by: Alexander Graf [WN: Commit message tweak, rebase and use new infrastructure.] Signed-off-by: Will Newton Signed-off-by: Peter Maydell --- target-arm/translate-a64.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index db24c87..107f3c6 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -3494,7 +3494,37 @@ static void disas_fp_3src(DisasContext *s, uint32_t insn) */ static void disas_fp_imm(DisasContext *s, uint32_t insn) { - unsupported_encoding(s, insn); + int rd = extract32(insn, 0, 5); + int imm8 = extract32(insn, 13, 8); + int is_double = extract32(insn, 22, 2); + uint64_t imm; + TCGv_i64 tcg_res; + + if (is_double > 1) { + unallocated_encoding(s); + return; + } + + /* The imm8 encodes the sign bit, enough bits to represent + * an exponent in the range 01....1xx to 10....0xx, + * and the most significant 4 bits of the mantissa; see + * VFPExpandImm() in the v8 ARM ARM. + */ + if (is_double) { + imm = (extract32(imm8, 7, 1) ? 0x8000 : 0) | + (extract32(imm8, 6, 1) ? 0x3fc0 : 0x4000) | + extract32(imm8, 0, 6); + imm <<= 48; + } else { + imm = (extract32(imm8, 7, 1) ? 0x8000 : 0) | + (extract32(imm8, 6, 1) ? 0x3e00 : 0x4000) | + (extract32(imm8, 0, 6) << 3); + imm <<= 16; + } + + tcg_res = tcg_const_i64(imm); + write_fp_dreg(s, rd, tcg_res); + tcg_temp_free_i64(tcg_res); } /* C3.6.29 Floating point <-> fixed point conversions