From patchwork Tue Dec 17 15:12:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 22584 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gg0-f199.google.com (mail-gg0-f199.google.com [209.85.161.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A0D1224005 for ; Tue, 17 Dec 2013 15:12:38 +0000 (UTC) Received: by mail-gg0-f199.google.com with SMTP id e26sf311261gga.10 for ; Tue, 17 Dec 2013 07:12:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=7YPBgmvTKYJrB49aBuIBEF0gE2m4t3Au9a2h8wskG+Y=; b=X7AHiek3589HdJpNNmxKtOzORqfru9Sw/v+BwXy8HFHt0Os6LrEULwvtTHBCNN2TkV mJB7vHQcpDHb+1WCXrPpRMOiL6UVJvuPolcRMNgqKFN+8LUsy6irJ+t9WtC+HLopkR4C TMa05lO8A2Kq15Tpb6z+I8kYQ1sea7e2vmQY+hxXyPxc0bOuChTHMwpt8XtKkanlDoYL HsTuVl9eeyfBe0tRQvvTM+f4/d4v6VUy6qJIo4Uqgiyc7XjE0CWS6/j3JSWyMgJvumrr +ND3NtMRY5wHrFesF2Beigd0UW8nWp9NoVhlGjODaOVEitXMW8Mc1lRklL8AM/zw8cKD VXww== X-Gm-Message-State: ALoCoQnU4R7GdN/NmuYDWl8VqJNk4gGvqO5njp6RYv2IO8VY1mrVmH2m4kSCikFPzkhlYc3fZu8F X-Received: by 10.236.82.206 with SMTP id o54mr6778898yhe.25.1387293158354; Tue, 17 Dec 2013 07:12:38 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.73.40 with SMTP id i8ls2456212qev.12.gmail; Tue, 17 Dec 2013 07:12:38 -0800 (PST) X-Received: by 10.58.48.162 with SMTP id m2mr393708ven.77.1387293158212; Tue, 17 Dec 2013 07:12:38 -0800 (PST) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id td8si4981759vdc.105.2013.12.17.07.12.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 17 Dec 2013 07:12:38 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id lc6so4273610vcb.13 for ; Tue, 17 Dec 2013 07:12:38 -0800 (PST) X-Received: by 10.58.216.133 with SMTP id oq5mr98729vec.80.1387293158105; Tue, 17 Dec 2013 07:12:38 -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.220.174.196 with SMTP id u4csp74961vcz; Tue, 17 Dec 2013 07:12:37 -0800 (PST) X-Received: by 10.194.61.84 with SMTP id n20mr13415214wjr.61.1387293152984; Tue, 17 Dec 2013 07:12:32 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id lz3si7057776wjb.123.2013.12.17.07.12.30 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 17 Dec 2013 07:12:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1VswJt-00031z-QZ; Tue, 17 Dec 2013 15:12:25 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, 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 18/21] target-arm: aarch64: add support for ld lit Date: Tue, 17 Dec 2013 15:12:21 +0000 Message-Id: <1387293144-11554-19-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1387293144-11554-1-git-send-email-peter.maydell@linaro.org> References: <1387293144-11554-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 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.220.182 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 Adds support for Load Register (literal), both normal and SIMD/FP forms. Signed-off-by: Alexander Graf Signed-off-by: Alex Bennée Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target-arm/translate-a64.c | 47 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index 3c18d6f..e4bca31 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -1117,10 +1117,53 @@ static void disas_ldst_excl(DisasContext *s, uint32_t insn) unsupported_encoding(s, insn); } -/* Load register (literal) */ +/* + * C3.3.5 Load register (literal) + * + * 31 30 29 27 26 25 24 23 5 4 0 + * +-----+-------+---+-----+-------------------+-------+ + * | opc | 0 1 1 | V | 0 0 | imm19 | Rt | + * +-----+-------+---+-----+-------------------+-------+ + * + * V: 1 -> vector (simd/fp) + * opc (non-vector): 00 -> 32 bit, 01 -> 64 bit, + * 10-> 32 bit signed, 11 -> prefetch + * opc (vector): 00 -> 32 bit, 01 -> 64 bit, 10 -> 128 bit (11 unallocated) + */ static void disas_ld_lit(DisasContext *s, uint32_t insn) { - unsupported_encoding(s, insn); + int rt = extract32(insn, 0, 5); + int64_t imm = sextract32(insn, 5, 19) << 2; + bool is_vector = extract32(insn, 26, 1); + int opc = extract32(insn, 30, 2); + bool is_signed = false; + int size = 2; + TCGv_i64 tcg_rt, tcg_addr; + + if (is_vector) { + if (opc == 3) { + unallocated_encoding(s); + return; + } + size = 2 + opc; + } else { + if (opc == 3) { + /* PRFM (literal) : prefetch */ + return; + } + size = 2 + extract32(opc, 0, 1); + is_signed = extract32(opc, 1, 1); + } + + tcg_rt = cpu_reg(s, rt); + + tcg_addr = tcg_const_i64((s->pc - 4) + imm); + if (is_vector) { + do_fp_ld(s, rt, tcg_addr, size); + } else { + do_gpr_ld(s, tcg_rt, tcg_addr, size, is_signed, false); + } + tcg_temp_free_i64(tcg_addr); } /*