From patchwork Tue Nov 21 21:25:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 119408 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5815936qgn; Tue, 21 Nov 2017 13:33:12 -0800 (PST) X-Google-Smtp-Source: AGs4zMbhGDTm2WD7FqeF6YpAaPWUfE4buomC86qy8ObXvNo8cawD1orqJQyCAEXCCW1pAI9kZV4T X-Received: by 10.129.228.73 with SMTP id t9mr12453188ywl.112.1511299992253; Tue, 21 Nov 2017 13:33:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511299992; cv=none; d=google.com; s=arc-20160816; b=WWG8B17QuAzBROJh/tM65eVpBg5f0u8mTOqQeB5FxxBwxf+II/YMeeFkeB5wQzPmR/ ieytOs4t/zdeAfekHsr2776zht0EerNq8nEmGIRH+KSLaLDXxb+Y55B1KBARuzYSgi6d v3Suff8r8Mtt4wpmyEp88CiAtXtPTbKsZzZmQIO2dvN+C9wFjIcKTrVMl2R/Ra2j1VDo dx8LpwqgzlgHDMqMSnp3SADtFba+zvdcvnS6T/LBMH7dIKIDRZ9/chqPv4G5JaUoXJmE XEBeCUub0ZVz1CsUPv7OjSdiuqC/glc1d/zaXEiJ4UeY/rNWLLGA6fGjWrtg493IMQ8U OMdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=09qF8n03XSVo4FEyGsP2EEOlkKHL3L4/cRQSJWq9xv0=; b=DC2JFJSRufBd6L9FqM2So3QNgs/H2gdKXmvCKJbE84SzO7HfXTZV0tjNrqaeSHaEOe zd1+w0sgFRM6n8Nhf+ltauu5qs1InH2wbc7AavU4JBzgSiBSPSnNrbFjwGupG9xiWH6E 0GwOXDbHB92ep3YjjBdLbylUD7ovXia+qrnvxvK1x7nqeM2iviGogA3NixMS2GH/5X02 wGCf1GnjRLH4SZ+1IuGTw5E5go6hxnbU+Xy70gXq84CleUzUtT4Kho7qcyD6Tcdh2tJB e6uRLTGZe6iCTIlUek5hoMROjQuhxG+xwEKGfpa604W7FOvG3TZv3ALZaptMMWD/wXoU Z+CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=C5x9VPLi; 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 j17si2911440ybm.556.2017.11.21.13.33.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 21 Nov 2017 13:33:12 -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; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=C5x9VPLi; 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]:36599 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHGAJ-0007nZ-Kr for patch@linaro.org; Tue, 21 Nov 2017 16:33:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eHG59-0004NJ-GO for qemu-devel@nongnu.org; Tue, 21 Nov 2017 16:27:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eHG58-0007iM-E4 for qemu-devel@nongnu.org; Tue, 21 Nov 2017 16:27:51 -0500 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:38058) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eHG58-0007hv-8l for qemu-devel@nongnu.org; Tue, 21 Nov 2017 16:27:50 -0500 Received: by mail-wm0-x242.google.com with SMTP id 128so6267720wmo.3 for ; Tue, 21 Nov 2017 13:27:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references; bh=09qF8n03XSVo4FEyGsP2EEOlkKHL3L4/cRQSJWq9xv0=; b=C5x9VPLi7Frt5tMOoZVph4BCaCr3C6338NYRRS/6RZnwjfHTdK+oSey5YlSXginpxT jG9pewgr8Ic50CjOg6EzMhBJTWtCr1ZpjoWtJKd0/N6j++5T1K43y4euEB7Lc1cgYp16 RM37E2jF7yp5F1wNFc2S2w/rsEpJ+gnFrqek4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=09qF8n03XSVo4FEyGsP2EEOlkKHL3L4/cRQSJWq9xv0=; b=r6HRYqZe8Jov4hvYAMXLH9XKh2E6X67l02EdvApFIFe/1ZYSKmjVMVjBP12jLRJL39 qfSVqAbaUrI+4FpIIqcPsTQTudc8H7UPjN9EzkYEu1DrCsVQA1SjXJU0xmKL7zmQqR20 CRpA4LzwYu2O0Vy3Ix58I+TWQL85h3z/qzWCJixbdkRBL+xRR7lG4jHNzmTLfWfQmH2e mFP0Y0nVcGo3w9BuvVkQflpaNPCtGppV5eVTSmUzceV7Dc8ALcYVGXj13OFQlne5bpwj PPSenFVv/YbQxbPqRbpT38qVb+tc9YCiO1aLngeovKDNS2MZ32VZOg+VtUtBJ01qLc9R fErQ== X-Gm-Message-State: AJaThX6CaBVTZavEBibZ83jw6IPJQmYQW/mzLOVxW9mlUwv1/q/LQJP0 b+DP2kgIJPYxz2fhm05kKDmzfeMPeq4= X-Received: by 10.28.146.20 with SMTP id u20mr2620090wmd.49.1511299669023; Tue, 21 Nov 2017 13:27:49 -0800 (PST) Received: from cloudburst.twiddle.net (70.red-37-158-60.dynamicip.rima-tde.net. [37.158.60.70]) by smtp.gmail.com with ESMTPSA id e124sm706517wmg.34.2017.11.21.13.27.47 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Nov 2017 13:27:48 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 21 Nov 2017 22:25:18 +0100 Message-Id: <20171121212534.5177-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171121212534.5177-1-richard.henderson@linaro.org> References: <20171121212534.5177-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::242 Subject: [Qemu-devel] [PATCH v6 10/26] target/arm: Use vector infrastructure for aa64 mov/not/neg 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) -- 2.13.6 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 572af456d1..bc14c28e71 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -85,6 +85,7 @@ typedef void CryptoTwoOpEnvFn(TCGv_ptr, TCGv_i32, TCGv_i32); typedef void CryptoThreeOpEnvFn(TCGv_ptr, TCGv_i32, TCGv_i32, TCGv_i32); /* Note that the gvec expanders operate on offsets + sizes. */ +typedef void GVecGen2Fn(unsigned, uint32_t, uint32_t, uint32_t, uint32_t); typedef void GVecGen3Fn(unsigned, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t); @@ -4579,14 +4580,19 @@ static void handle_fp_1src_double(DisasContext *s, int opcode, int rd, int rn) TCGv_i64 tcg_op; TCGv_i64 tcg_res; + switch (opcode) { + case 0x0: /* FMOV */ + tcg_gen_gvec_mov(0, vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + 8, vec_full_reg_size(s)); + return; + } + fpst = get_fpstatus_ptr(); tcg_op = read_fp_dreg(s, rn); tcg_res = tcg_temp_new_i64(); switch (opcode) { - case 0x0: /* FMOV */ - tcg_gen_mov_i64(tcg_res, tcg_op); - break; case 0x1: /* FABS */ gen_helper_vfp_absd(tcg_res, tcg_op); break; @@ -9153,6 +9159,12 @@ static void disas_simd_3same_logic(DisasContext *s, uint32_t insn) gvec_fn = tcg_gen_gvec_andc; goto do_fn; case 2: /* ORR */ + if (rn == rm) { /* MOV */ + tcg_gen_gvec_mov(0, vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + is_q ? 16 : 8, vec_full_reg_size(s)); + return; + } gvec_fn = tcg_gen_gvec_or; goto do_fn; case 3: /* ORN */ @@ -10032,6 +10044,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) int rmode = -1; TCGv_i32 tcg_rmode; TCGv_ptr tcg_fpstatus; + GVecGen2Fn *gvec_fn; switch (opcode) { case 0x0: /* REV64, REV32 */ @@ -10040,8 +10053,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) return; case 0x5: /* CNT, NOT, RBIT */ if (u && size == 0) { - /* NOT: adjust size so we can use the 64-bits-at-a-time loop. */ - size = 3; + /* NOT */ break; } else if (u && size == 1) { /* RBIT */ @@ -10293,6 +10305,27 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn) tcg_rmode = NULL; } + switch (opcode) { + case 0x5: + if (u && size == 0) { /* NOT */ + gvec_fn = tcg_gen_gvec_not; + goto do_fn; + } + break; + case 0xb: + if (u) { /* NEG */ + gvec_fn = tcg_gen_gvec_neg; + goto do_fn; + } + break; + + do_fn: + gvec_fn(size, vec_full_reg_offset(s, rd), + vec_full_reg_offset(s, rn), + is_q ? 16 : 8, vec_full_reg_size(s)); + return; + } + if (size == 3) { /* All 64-bit element operations can be shared with scalar 2misc */ int pass;