From patchwork Fri Jun 7 14:17:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 166153 Delivered-To: patch@linaro.org Received: by 2002:ac9:2a84:0:0:0:0:0 with SMTP id p4csp648402oca; Fri, 7 Jun 2019 08:12:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxEzvpP6Tc/KPhWW6c9mjReurbuz4fxNbOG8W5QLFzbz/zqHSQHzeB2QNjLEZ+pqfV+ed+Q X-Received: by 2002:a0c:fca6:: with SMTP id h6mr44052368qvq.41.1559920215659; Fri, 07 Jun 2019 08:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559920215; cv=none; d=google.com; s=arc-20160816; b=jCFWB3OkAeYNQQRmbK4j3iMBKqa+rwigIQYacCuYTNw1bPcFxf0TTXlBBrU75iUg2t 1MqRnqO/K1WaerbMThb+YwPpK0MwcyCNRdzwLG/pmIgp13Bvguo36uYfiZOkMpXJb3ii foZK8oPG2rUs0OZVWyFMf8BQYA7Y+I7o4qw1uftZzJl50Lyx+ORW6jN99ZvWP6hKeL9Y vdv1lXOKeCOyVdeJXX8zVs4LGXmxb5p8sG4RtfLKdRcyHFvk+DmlQzebtzgQtI/j1Sot SoL4d2TN1yZYTLUPRTEBkUUEnAeLgljxRGTx50g02MxuhB1r2iBhqzfg2EIT73AYT32w kSVQ== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from; bh=BGmopcK3G6gShR/lDwNmyoM3Hd1/wGo6df7lzN+RisQ=; b=nwRdzIP86MAgqKTobKRnrZej8vdoLeNtcPC8oyaGv1Qql4XQY8L8vmytTL70UqZ0o/ nQmltsomFAqXku3ToN8ij+JHBfLLyLxPXlLQ//LQHZfN06AWN0Wtq2Zj1Hkg1lCHZTYP yULc3Y5NSpcttAxFzqhc9i77tDlR4ZGbHDNgH1VMwvNhBJ6jiH4UmYtR+/8apuzZjoPV r4sXpUj7+WQNteoMDTmmYJTs5phvq8CTmfLsoUebk3I4fZpX+q3qRkgqgG1IWBSUcKN6 2kLLVZX8YFAvnP6A0XhZftJCKKuIdHWRCESlToLt3Z+Z8d7M0Jotl83cU3JcIGHK2Mg2 qrPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e23si425430qtm.1.2019.06.07.08.10.15 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Jun 2019 08:10:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:48594 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZGVT-0002qD-8l for patch@linaro.org; Fri, 07 Jun 2019 11:10:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54183) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hZFiz-00057p-CS for qemu-devel@nongnu.org; Fri, 07 Jun 2019 10:20:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hZFiw-0005z2-Qo for qemu-devel@nongnu.org; Fri, 07 Jun 2019 10:20:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38032) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hZFin-0005bD-Jv; Fri, 07 Jun 2019 10:20:02 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D5C5C18B2F5; Fri, 7 Jun 2019 14:19:48 +0000 (UTC) Received: from localhost (dhcp-192-191.str.redhat.com [10.33.192.191]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 929B81001B06; Fri, 7 Jun 2019 14:19:45 +0000 (UTC) From: Cornelia Huck To: Peter Maydell Date: Fri, 7 Jun 2019 16:17:26 +0200 Message-Id: <20190607141727.29018-34-cohuck@redhat.com> In-Reply-To: <20190607141727.29018-1-cohuck@redhat.com> References: <20190607141727.29018-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 07 Jun 2019 14:19:48 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL v2 33/34] s390x/tcg: Use tcg_gen_gvec_bitsel for VECTOR SELECT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-s390x@nongnu.org, Richard Henderson , qemu-devel@nongnu.org, David Hildenbrand Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson This replaces the target-specific implementations for VSEL. Signed-off-by: Richard Henderson Signed-off-by: David Hildenbrand --- target/s390x/translate_vx.inc.c | 38 ++++++--------------------------- 1 file changed, 6 insertions(+), 32 deletions(-) -- 2.20.1 diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.inc.c index 69c675e41187..7b1d31cba5cf 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -245,6 +245,9 @@ static void get_vec_element_ptr_i64(TCGv_ptr ptr, uint8_t reg, TCGv_i64 enr, #define gen_gvec_fn_3(fn, es, v1, v2, v3) \ tcg_gen_gvec_##fn(es, vec_full_reg_offset(v1), vec_full_reg_offset(v2), \ vec_full_reg_offset(v3), 16, 16) +#define gen_gvec_fn_4(fn, es, v1, v2, v3, v4) \ + tcg_gen_gvec_##fn(es, vec_full_reg_offset(v1), vec_full_reg_offset(v2), \ + vec_full_reg_offset(v3), vec_full_reg_offset(v4), 16, 16) /* * Helper to carry out a 128 bit vector computation using 2 i64 values per @@ -915,40 +918,11 @@ static DisasJumpType op_vsce(DisasContext *s, DisasOps *o) return DISAS_NEXT; } -static void gen_sel_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b, TCGv_i64 c) -{ - TCGv_i64 t = tcg_temp_new_i64(); - - /* bit in c not set -> copy bit from b */ - tcg_gen_andc_i64(t, b, c); - /* bit in c set -> copy bit from a */ - tcg_gen_and_i64(d, a, c); - /* merge the results */ - tcg_gen_or_i64(d, d, t); - tcg_temp_free_i64(t); -} - -static void gen_sel_vec(unsigned vece, TCGv_vec d, TCGv_vec a, TCGv_vec b, - TCGv_vec c) -{ - TCGv_vec t = tcg_temp_new_vec_matching(d); - - tcg_gen_andc_vec(vece, t, b, c); - tcg_gen_and_vec(vece, d, a, c); - tcg_gen_or_vec(vece, d, d, t); - tcg_temp_free_vec(t); -} - static DisasJumpType op_vsel(DisasContext *s, DisasOps *o) { - static const GVecGen4 gvec_op = { - .fni8 = gen_sel_i64, - .fniv = gen_sel_vec, - .prefer_i64 = TCG_TARGET_REG_BITS == 64, - }; - - gen_gvec_4(get_field(s->fields, v1), get_field(s->fields, v2), - get_field(s->fields, v3), get_field(s->fields, v4), &gvec_op); + gen_gvec_fn_4(bitsel, ES_8, get_field(s->fields, v1), + get_field(s->fields, v4), get_field(s->fields, v2), + get_field(s->fields, v3)); return DISAS_NEXT; }