From patchwork Wed Jan 29 13:39:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 23838 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1886F202FA for ; Wed, 29 Jan 2014 13:41:47 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id oz11sf4363280veb.4 for ; Wed, 29 Jan 2014 05:41:47 -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:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=XECNdeKDa5yyMYrCaiydCWtRexc4dkIFnaBi4CSg6hg=; b=RZI5ykY+QEGSrYUNDLYjSU4aMELUE0NFOP0sUgVl8QP9lm+/GtJP2H3iGx4ZHD3l7P nsEd+Duat3+3nmt8HATogB4F7BTtZMk/0Nf55t7ie9HFbVWkAXvepctArRjtDWDjkt+n vAOfO4V7x0730YVzQL032Tkqs0PlYua5PVbqVZmny97BjkvFIOqy1V14kB7OuUYjgkoc DfrSvssgqImcBPMet5BH8vmrZmjo70C1ilZ6Mc/BoDCWPDEGyzVimvYOjy04H+Z1znG5 Q1DxE7orn39TyYq8sKxU9xtAmCkJz7yyIrOudoM2nwGtGt/KviC8Dj4APqJldABJ9oIq sDww== X-Gm-Message-State: ALoCoQkhP5A0JYN6g7eQCtuE5OBsaPafATlKUdXUVlonDNX1iLCaX5qlSkUU91y5BeaZYVASzdIk X-Received: by 10.224.47.129 with SMTP id n1mr2873762qaf.4.1391002906871; Wed, 29 Jan 2014 05:41:46 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.36.200 with SMTP id p66ls111201qgp.74.gmail; Wed, 29 Jan 2014 05:41:46 -0800 (PST) X-Received: by 10.52.113.97 with SMTP id ix1mr5603256vdb.9.1391002906703; Wed, 29 Jan 2014 05:41:46 -0800 (PST) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by mx.google.com with ESMTPS id ug9si797593vcb.107.2014.01.29.05.41.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Jan 2014 05:41:46 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.45 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.45; Received: by mail-vb0-f45.google.com with SMTP id m10so1161978vbh.32 for ; Wed, 29 Jan 2014 05:41:46 -0800 (PST) X-Received: by 10.58.161.227 with SMTP id xv3mr394443veb.31.1391002906589; Wed, 29 Jan 2014 05:41:46 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp113612vcz; Wed, 29 Jan 2014 05:41:46 -0800 (PST) X-Received: by 10.224.5.69 with SMTP id 5mr11935917qau.11.1391002905089; Wed, 29 Jan 2014 05:41:45 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id fy9si1743566qab.165.2014.01.29.05.41.44 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 29 Jan 2014 05:41:45 -0800 (PST) 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; Received: from localhost ([::1]:42303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8VOi-0002ME-42 for patch@linaro.org; Wed, 29 Jan 2014 08:41:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8VNQ-00019m-Dr for qemu-devel@nongnu.org; Wed, 29 Jan 2014 08:40:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8VNG-0000rG-0g for qemu-devel@nongnu.org; Wed, 29 Jan 2014 08:40:24 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:45234) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8VNF-0000p0-O2 for qemu-devel@nongnu.org; Wed, 29 Jan 2014 08:40:13 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1W8VN7-0006w5-Ki; Wed, 29 Jan 2014 13:40:05 +0000 From: Peter Maydell To: Anthony Liguori Date: Wed, 29 Jan 2014 13:39:37 +0000 Message-Id: <1391002805-26596-11-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391002805-26596-1-git-send-email-peter.maydell@linaro.org> References: <1391002805-26596-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Cc: Blue Swirl , qemu-devel@nongnu.org, Aurelien Jarno Subject: [Qemu-devel] [PULL 10/38] target-arm: A64: Add SIMD scalar copy instructions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.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.212.45 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 --- target-arm/translate-a64.c | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index 69c75c0..7cfb55b 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -5108,6 +5108,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 @@ -5425,7 +5454,19 @@ 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); + return; + } + + /* DUP (element, scalar) */ + handle_simd_dupes(s, rd, rn, imm5); } /* C3.6.8 AdvSIMD scalar pairwise