From patchwork Wed Jan 17 16:14:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 124842 Delivered-To: patch@linaro.org Received: by 10.46.62.1 with SMTP id l1csp106461lja; Wed, 17 Jan 2018 08:38:25 -0800 (PST) X-Google-Smtp-Source: ACJfBouPUaQWl5mwMQkcJCkTkuQYWH8R+WHqvzfTF8nXuMzFaUG2uxUphvwOiAjw2YKrUWL97B5U X-Received: by 10.37.118.195 with SMTP id r186mr34344833ybc.328.1516207105292; Wed, 17 Jan 2018 08:38:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516207105; cv=none; d=google.com; s=arc-20160816; b=uewbd/N24lP4NlQqzro5ugRHdptRq0W1ViIEI6KMNZMA0HLIwk0NzLfn+N8R+WTs2C VP2WSMExkREhT5nNpLsQmVk+YelSqmvcHheMWA5/KtkHv2PF51LZ5d8YqBmXh/sI46FZ SMl6autFgi8yb/QMHVofAZzDRbxS3igwgtU0mw7AAUMPgj1pvAZgpGuVCPgYSVC+6Jst mMAaQbaEp8fdyHOoDwr3Wxdf0jBwVAhZwUKw65XpmgDEsAXnfulwBlXBDzypBcgoMTh7 uSv/sDNGr+UYQzipnnnvaVlG5jQXIunhZpGmouS9kkEWCwdh0qnGgXeVpi01c3304ulV +crQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=/M1dcthMmTATpl0j08esuy66JerbMNlRJtHEAhXCipY=; b=fs4kSlfyXh7/ReJ0uG7KBLy8NX27P7bIr9XUpZfgc9vCzVlMiu3KBABEuHPimt/D8y 0oPDG5h04+lUbHm9O7TPR6rviqoopC6R2LZLoulBPvL+Pt6ivqBPAgoAFB+pb051m/qA BT0q0K7tdy22yxiIeQ6y8lOyo5PvpPcJP/EBXzBeOa5PADfhaqu8pKJITZCLhlwlyAkO 6a5ac2oBcG2wq2Iw0ih5zr8sQaSS3k8jBEItcwkknkBWLjL+MeokvV9HXPpGyfwZNMDl r41jsBVZJPPmCLAHySp6Buh1SPa7MmN2R0UfEoLlwRkpch0UCYdb7uC1lInrpagQq01K G0aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hvWiv+rG; 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 x79si565269ywg.672.2018.01.17.08.38.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 17 Jan 2018 08:38:25 -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=hvWiv+rG; 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]:46001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebqjI-0002HX-Ku for patch@linaro.org; Wed, 17 Jan 2018 11:38:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebqNE-00070u-Fg for qemu-devel@nongnu.org; Wed, 17 Jan 2018 11:15:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebqNB-0003rS-8P for qemu-devel@nongnu.org; Wed, 17 Jan 2018 11:15:36 -0500 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:39422) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ebqNA-0003qu-JW for qemu-devel@nongnu.org; Wed, 17 Jan 2018 11:15:32 -0500 Received: by mail-pf0-x244.google.com with SMTP id e11so11794441pff.6 for ; Wed, 17 Jan 2018 08:15:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/M1dcthMmTATpl0j08esuy66JerbMNlRJtHEAhXCipY=; b=hvWiv+rGSFpK6YBQldHwDRMeHiZI4QEYgiuxA7IKwxZ1mayJ2ATRXXzTkK7YD/8klS 2wFIYypewWneU1AHILIkv9gcuwnoybNY29lt9fRAFyVuYJ1OSS0obgP9UpMlbeH9xlUM dQYeze5ljTtCdm+Bhuq+zh41vGr0sHo+8IvGs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/M1dcthMmTATpl0j08esuy66JerbMNlRJtHEAhXCipY=; b=a0Mc3cW8mjEcOGpL6uezgRDlUGfjdUAH8epj2cvPBRJWGcFEFzsf3oVewYvYbLQsLo fjrl9mGHX+YvBl69d05BP6nmqJIsorES1kxyK0AkZTnh9fNzizltE2f55TkfliDfZKo0 ZUce+R3HtI7CuG79gwAmZ+4hVPto1isXPdJsT1QEMLZerdUVtT4v3mXAgTJ+enHaJYur sP31iHSzXqusgoWldSsi/L7SPW9V2nMaQlPFcPj1q83o9DzXCEby3zU9Vf9S0n7FJ1jv KydTgUGG4PTsLYyBRkUPMnhqXprvPsWClL7PiwYANn7VjW3XJ7S0CS+vSYSkuuOf+EHH 39kw== X-Gm-Message-State: AKGB3mLm35bDZSwluK0ciK7w2LZypTF+Zj8mHfO5IrQnMw9TN3hIn9w2 Kg64CQSzAeY1Tc+q6yVx1dlRoJtVoF8= X-Received: by 10.98.223.196 with SMTP id d65mr31698122pfl.176.1516205731364; Wed, 17 Jan 2018 08:15:31 -0800 (PST) Received: from cloudburst.twiddle.net.com (24-181-135-57.dhcp.knwc.wa.charter.com. [24.181.135.57]) by smtp.gmail.com with ESMTPSA id l10sm1099311pff.64.2018.01.17.08.15.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Jan 2018 08:15:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 17 Jan 2018 08:14:28 -0800 Message-Id: <20180117161435.28981-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180117161435.28981-1-richard.henderson@linaro.org> References: <20180117161435.28981-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::244 Subject: [Qemu-devel] [PATCH v10.5 13/20] 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: , Cc: peter.maydell@linaro.org 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.14.3 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index b97bc9b83c..219cc1e19d 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; @@ -9170,6 +9176,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 */ @@ -10049,6 +10061,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 */ @@ -10057,8 +10070,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 */ @@ -10310,6 +10322,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;