From patchwork Mon Jan 13 14:13:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 23166 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 03D47202DA for ; Mon, 13 Jan 2014 14:13:29 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id a41sf14261133yho.8 for ; Mon, 13 Jan 2014 06:13:29 -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=mSGwp+K/ZDvTCaL+MfIOxDaZXqWBH/EMF2nKg2pxG/M=; b=h6+2GigviBlum3YKzCeJWSZVHOR58KNKgyE97HG6zv3QvQ7R4fqasASW7XNtS1TMhR v/AoOFIYeXTTwt2dhi3Gf2MEYMAH4RIe0q1EGqKHEK7pTQlVDf2Ge6De/iV70owtMgws FUUj5f8Ey1dzHU8x0ict1/CcgCEz7hgAJNZJq/YJ+Cv46lvCclU+w549e9ai+8SFMzlN HzrKn9Va3KfILXKvyZyqsKLkWBNtXfSeFBs55bMcL/M2BSanB27plEX+15G8nCzPju4v HBVUGoCV6BuRvGAMdWci8XFGJz+OSKnRSuSoFEneQFYtRjZojK67CTgOvybAD2KzQh1U wE1w== X-Gm-Message-State: ALoCoQnP1RHWQqJ7TIZiJJ9QFo/OTTPUjVzi71VwjbxEKIhLhqszcHd2TNNexUPe+LjNFcgtjC2B X-Received: by 10.58.189.73 with SMTP id gg9mr913664vec.34.1389622409212; Mon, 13 Jan 2014 06:13:29 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.59.49 with SMTP id w17ls2573172qeq.68.gmail; Mon, 13 Jan 2014 06:13:29 -0800 (PST) X-Received: by 10.52.244.49 with SMTP id xd17mr15150063vdc.26.1389622409107; Mon, 13 Jan 2014 06:13:29 -0800 (PST) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id x16si526649vct.105.2014.01.13.06.13.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 13 Jan 2014 06:13:29 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.176 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.176; Received: by mail-ve0-f176.google.com with SMTP id jy13so952502veb.7 for ; Mon, 13 Jan 2014 06:13:29 -0800 (PST) X-Received: by 10.52.27.170 with SMTP id u10mr273502vdg.74.1389622409023; Mon, 13 Jan 2014 06:13:29 -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 ey3csp130957ved; Mon, 13 Jan 2014 06:13:28 -0800 (PST) X-Received: by 10.204.52.193 with SMTP id j1mr9398450bkg.0.1389622404992; Mon, 13 Jan 2014 06:13:24 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id qf7si10039449bkb.11.2014.01.13.06.13.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 13 Jan 2014 06:13:24 -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 1W2iGT-0008Pn-3H; Mon, 13 Jan 2014 14:13:17 +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 v2 10/10] target-arm: A64: Add SIMD scalar copy instructions Date: Mon, 13 Jan 2014 14:13:16 +0000 Message-Id: <1389622396-32282-11-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1389622396-32282-1-git-send-email-peter.maydell@linaro.org> References: <1389622396-32282-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.176 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: , Add support for the SIMD scalar copy instruction group (C3.6.7), which consists of the single instruction DUP (element, scalar). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- v1->v2: fixed error in insn diagram comment --- target-arm/translate-a64.c | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index 5f56db9..2870675 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -5109,6 +5109,35 @@ static void handle_simd_dupe(DisasContext *s, int is_q, int rd, int rn, tcg_temp_free_i64(tmp); } +/* C6.3.31 DUP (element, scalar) + * 31 21 20 16 15 10 9 5 4 0 + * +-----------------------+--------+-------------+------+------+ + * | 0 1 0 1 1 1 1 0 0 0 0 | imm5 | 0 0 0 0 0 1 | Rn | Rd | + * +-----------------------+--------+-------------+------+------+ + */ +static void handle_simd_dupes(DisasContext *s, int rd, int rn, + int imm5) +{ + int size = ctz32(imm5); + int index; + TCGv_i64 tmp; + + if (size > 3) { + unallocated_encoding(s); + return; + } + + index = imm5 >> (size + 1); + + /* This instruction just extracts the specified element and + * zero-extends it into the bottom of the destination register. + */ + tmp = tcg_temp_new_i64(); + read_vec_element(s, tmp, rn, index, size); + write_fp_dreg(s, rd, tmp); + tcg_temp_free_i64(tmp); +} + /* C6.3.32 DUP (General) * * 31 30 29 21 20 16 15 10 9 5 4 0 @@ -5426,7 +5455,18 @@ static void disas_simd_mod_imm(DisasContext *s, uint32_t insn) */ static void disas_simd_scalar_copy(DisasContext *s, uint32_t insn) { - unsupported_encoding(s, insn); + int rd = extract32(insn, 0, 5); + int rn = extract32(insn, 5, 5); + int imm4 = extract32(insn, 11, 4); + int imm5 = extract32(insn, 16, 5); + int op = extract32(insn, 29, 1); + + if (op != 0 || imm4 != 0) { + unallocated_encoding(s); + } + + /* DUP (element, scalar) */ + handle_simd_dupes(s, rd, rn, imm5); } /* C3.6.8 AdvSIMD scalar pairwise