From patchwork Thu Oct 11 20:51:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 148681 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2601928lji; Thu, 11 Oct 2018 14:01:25 -0700 (PDT) X-Google-Smtp-Source: ACcGV639LjiLfJT7d+daqrRA+rA+7Kk7cPfeyRlJSGVBwn8N3AViy7/kTm9ZmHZFyZtK8A1QM0b8 X-Received: by 2002:aed:2f01:: with SMTP id l1-v6mr3130007qtd.71.1539291685453; Thu, 11 Oct 2018 14:01:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539291685; cv=none; d=google.com; s=arc-20160816; b=m/F8soK784TDF6EvEZ7C2SfpwYt4z0ylou2CxQcIlo1vprpKuFGst9gYZKQcTdGKHU ERQBnAnsyv0AAaAGFQS03dJSLL0D2+1SNNZXwm+czaGPWAJcZHzRWw/qAUhjEdeRM1Y0 IUntB3LSd2a6DNbJvOyUTd8Scn6v1CbqU25uyDkeGh6AtNOYfCx4oeEccbJMeuytXZ4h F4oGLA07tNp9h4xpGV1VadWMf4Lz8m4U8c1q2HMDd4P7BPhuRR6GtlFhL+y0oHq6sYD0 DLqBJwH55HjUhvvEFpv4m9K0SaSF+nShf4OTHr24W3E0T5wTSa13sLT3ZJnJLqUc+o4r PVGw== 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; bh=tj0Mk6BZv5h6kitrvfOx4xu0tRJ4I4R9MOqUXqh/uhw=; b=ppmMb94gmXJqOsp6vCpuHD3A8DUPxmMwPJ41sKHn3x2Od3VUaBIb+cwfQ4WGfewp6Y 5z9Qe+eGHMg/IFq6NrWDdbEJlVEq0T6TU93zGFpNL6cfaXdzAESuifLDb9uqArbPzXnS nwcZwklbKfVKBy1fuT6e3krDTibevWr6CBne+mHthhBo1pksQnMkoJKNcSbw/q//O0TO nZVkx10x5sW3P0NczbrSNeIhVz5atKYvB4p2uSAZJ7AcVflzEXxPdBCAK0x+c/JxJBvd s1Nuy9f9OSj9QWR36A5s2PG4oXNkkUmYRKU48BJsMDqMLUOkubZx0kv9OCqIA+TvZJDQ 2aHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cPyiYcLa; 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 r2-v6si4221844qki.212.2018.10.11.14.01.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 11 Oct 2018 14:01:25 -0700 (PDT) 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=cPyiYcLa; 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]:37117 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAi5E-0005AY-Sp for patch@linaro.org; Thu, 11 Oct 2018 17:01:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gAhwp-0006rX-Br for qemu-devel@nongnu.org; Thu, 11 Oct 2018 16:52:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gAhwm-00060Z-7r for qemu-devel@nongnu.org; Thu, 11 Oct 2018 16:52:43 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:46461) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gAhwl-0003tU-NU for qemu-devel@nongnu.org; Thu, 11 Oct 2018 16:52:39 -0400 Received: by mail-pf1-x430.google.com with SMTP id r64-v6so4992364pfb.13 for ; Thu, 11 Oct 2018 13:52:20 -0700 (PDT) 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=tj0Mk6BZv5h6kitrvfOx4xu0tRJ4I4R9MOqUXqh/uhw=; b=cPyiYcLavaFrsK7bYRwsF5TaIvdZtXbwAOluLwBXmjJ+lw5R39f+AfwclW4qTxQC/t uFLSmgZMn1/Eazbx3p3yR4P04CU13aF22dHMrXXk+G/TbTto9Dbi0hY3VDECoMoinYUZ jOIg1501Dx0+o6ATvvltzpvjnQDLVUgi0WQtg= 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=tj0Mk6BZv5h6kitrvfOx4xu0tRJ4I4R9MOqUXqh/uhw=; b=OJFUaFQIEZ616HVkPqe7XfR8IA5+tAhFLSmCRctDE51SdcyjRxzrddI+dqBX87nvRI qVXIOKwFanqZA6tk6O27h1dqWhYV042FTfcAT8/1i5nzKLZGC6RLk8dpP2USW3qHgGz4 1ElKJSILh0hJklhNddg9K7b9MH+D8w7OqTkFiUe32FZUU8m08bhhTRp9ThKQzipEPB7Q h4bTdADsJjR3ZkQxn93Qx4FLjDfKubO0VpDRLnB+u3r4LvcxgmwOAXaifTReVHwo8EIK LmNAwGErol9FYHE/WBVUHhXuzjsuAw/6CjahxEaroPrVA7OuuuyuBOtFakG2vXvh6r4F A6PA== X-Gm-Message-State: ABuFfoihXO+EnZeShac9nYvtrT5ZiynadXYLwu3cRwy6Aj7hXCrcDOAY Wxaj3yQY/M9k4gpxZNEEAhjFGX8in5E= X-Received: by 2002:a62:1551:: with SMTP id 78-v6mr3086771pfv.178.1539291138759; Thu, 11 Oct 2018 13:52:18 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-8-179.tukw.qwest.net. [97.113.8.179]) by smtp.gmail.com with ESMTPSA id h87-v6sm34707866pfj.78.2018.10.11.13.52.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Oct 2018 13:52:17 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 11 Oct 2018 13:51:53 -0700 Message-Id: <20181011205206.3552-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181011205206.3552-1-richard.henderson@linaro.org> References: <20181011205206.3552-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::430 Subject: [Qemu-devel] [PATCH 07/20] target/arm: Use gvec for NEON VMOV, VMVN, VBIC & VORR (immediate) 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.c | 67 ++++++++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 28 deletions(-) -- 2.17.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index 4ac526e298..109689a286 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -6641,7 +6641,8 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) return 1; } } else { /* (insn & 0x00380080) == 0 */ - int invert; + int invert, reg_ofs, vec_size; + if (q && (rd & 1)) { return 1; } @@ -6681,8 +6682,9 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) break; case 14: imm |= (imm << 8) | (imm << 16) | (imm << 24); - if (invert) + if (invert) { imm = ~imm; + } break; case 15: if (invert) { @@ -6692,36 +6694,45 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | ((imm & 0x40) ? (0x1f << 25) : (1 << 30)); break; } - if (invert) + if (invert) { imm = ~imm; + } - for (pass = 0; pass < (q ? 4 : 2); pass++) { - if (op & 1 && op < 12) { - tmp = neon_load_reg(rd, pass); - if (invert) { - /* The immediate value has already been inverted, so - BIC becomes AND. */ - tcg_gen_andi_i32(tmp, tmp, imm); - } else { - tcg_gen_ori_i32(tmp, tmp, imm); - } + reg_ofs = neon_reg_offset(rd, 0); + vec_size = q ? 16 : 8; + + if (op & 1 && op < 12) { + if (invert) { + /* The immediate value has already been inverted, + * so BIC becomes AND. + */ + tcg_gen_gvec_andi(MO_32, reg_ofs, reg_ofs, imm, + vec_size, vec_size); } else { - /* VMOV, VMVN. */ - tmp = tcg_temp_new_i32(); - if (op == 14 && invert) { - int n; - uint32_t val; - val = 0; - for (n = 0; n < 4; n++) { - if (imm & (1 << (n + (pass & 1) * 4))) - val |= 0xff << (n * 8); - } - tcg_gen_movi_i32(tmp, val); - } else { - tcg_gen_movi_i32(tmp, imm); - } + tcg_gen_gvec_ori(MO_32, reg_ofs, reg_ofs, imm, + vec_size, vec_size); + } + } else { + /* VMOV, VMVN. */ + if (op == 14 && invert) { + TCGv_i64 t64 = tcg_temp_new_i64(); + + for (pass = 0; pass <= q; ++pass) { + uint64_t val = 0; + int n; + + for (n = 0; n < 8; n++) { + if (imm & (1 << (n + pass * 8))) { + val |= 0xffull << (n * 8); + } + } + tcg_gen_movi_i64(t64, val); + neon_store_reg64(t64, rd + pass); + } + tcg_temp_free_i64(t64); + } else { + tcg_gen_gvec_dup32i(reg_ofs, vec_size, vec_size, imm); } - neon_store_reg(rd, pass, tmp); } } } else { /* (insn & 0x00800010 == 0x00800000) */