From patchwork Thu Dec 17 14:52:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 344952 Delivered-To: patch@linaro.org Received: by 2002:a17:906:4755:0:0:0:0 with SMTP id j21csp1306998ejs; Thu, 17 Dec 2020 07:16:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKcI/ps58hql/ijfG3folw3TbiENquX/kgvv4oBzKfowEMO9awJwev0qnq5gaghYZyShrm X-Received: by 2002:a25:34cf:: with SMTP id b198mr58149525yba.283.1608218166901; Thu, 17 Dec 2020 07:16:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608218166; cv=none; d=google.com; s=arc-20160816; b=U14OmvZiwyeNows3woMVHThUeznJbUnPjRA6fLxX1+WKV6zXzDgA7r5DmHKxlIqAHV WgZUmyrtSp/aw5aQyvcS/cE8lLjBWbEgSkZwEUbJ5CNunlXpV6bqNfVMXfx31oCfvbsP hE+BiTrJfDBcA/4eA/5m8KePt2HQLYhFJqJErF9cSf9qHfHDfmycuuhmGVs6qbptAeEt Af2TN0iPfARbg+7RMfEzMfn0jeeBbA60OlL9HktkKlaQjvZPerG5aLAHU58d4nyLogC6 NddvFDjOQoba69hN2P3Jx2pZnOwQJNkzcfAur6eUXOPS6dbZ0aCsWwA69bolq6E59TUW DCUA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=YeAFN1TxVwViZ21GVBc/8//iF1bKTyiFYfoX+LM9wcw=; b=Su1C04n9SUT22c2QfI/orz2pz2EAJrl6i+frPn9BRt2CjkP4sOVgO49N4R1MEovEOU ZQT7GvxisFqaMARDh71cGjuACSDIkZL+CZNTyTej9y0AYhH3/66jTjfpmEpo9/u4oE0T YQWW6sjxCfdvf887tm9Uj3QFIczBimSI0LsBU5zmcFebWvAVo5In5YDgQqTLgsQdCP93 HXziG6BLNzyDLCJzRv0zw3qw5hFd/6onp5wC7LBF5rAMhimwTyOyD7IFnwwqJIQHBH+f uif0r3hlfZVLNif5H7uLJFkK5m9NF+OV8PM0fR/lF2j4CmbUie51FIcA1SzFfQTgUl+G oh0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UlSKFHzJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v67si4675221ybc.47.2020.12.17.07.16.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Dec 2020 07:16:06 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=UlSKFHzJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:40340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kpv0g-00087g-7U for patch@linaro.org; Thu, 17 Dec 2020 10:16:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kpue8-0003iS-09 for qemu-devel@nongnu.org; Thu, 17 Dec 2020 09:52:48 -0500 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]:44493) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kpue2-0004zg-Gg for qemu-devel@nongnu.org; Thu, 17 Dec 2020 09:52:47 -0500 Received: by mail-ot1-x329.google.com with SMTP id f16so27477195otl.11 for ; Thu, 17 Dec 2020 06:52:41 -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 :mime-version:content-transfer-encoding; bh=YeAFN1TxVwViZ21GVBc/8//iF1bKTyiFYfoX+LM9wcw=; b=UlSKFHzJCW8ADKmyYlXuJfaS81Lm82wsaOdFJ98R2xwZubS+djDOjPfHKCuj97scTc fAp0eC3o+GR3Ml9sGPpYJWmIfdAhn+gDMuzyISwFqB9Mg5FAx/p9/VdTjBlRl7/867RO uhtO6fa1Vhre+XMbuiXZ53F8LmbV7qqUG5ovHoEqyqxHYOr2IS/PPAR386lhqh9KmOLE 3sdlUdS/XXf5c5WZ+Q5eRC2xKL/WOP4VK2Em7t87Ynd7UGsp2AvqvFCKSwTsMPExZfmW ZWrcqGF+kB0kyGN48qBU1MNVYyPrcnNitU3VAvO/oGYsJNjA+wtpcT+qHBopW/XUAlep 5PSQ== 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:mime-version:content-transfer-encoding; bh=YeAFN1TxVwViZ21GVBc/8//iF1bKTyiFYfoX+LM9wcw=; b=iiMrZfQ0kro2yjN+BqEdkcHxqJPyyyfngZiQtYMdrrqEbkv1EaNqLFxV48AmHitIS0 Qw5ZRu+QSUKd4ZfASqWKviinG2RUb/wn4Co3pOC22uCHjzfdgTYsErRd7QbI5k/9ONC8 6qjEaWZQBrpnbpsS6Y9SalTDBCpdlgZX1nRDPD5ncfZQ1k+jGHTtUIc9CKNTDityMicW Cdhik5+uKFqIuxk94aeRnZGVtPMpK0dOm7lJ+Yp4qCZYrVSKSFZZulBwek1uOLD2pMJg 1FkIzfvaItAqKyStiBhtc6eQ6+aToL71zshGMZNGsHk2iCuXIm4YttwuacmclOngiGVs 2KmA== X-Gm-Message-State: AOAM530mbg6ReqFK6kV7mk2xRV6OzQNrpCno1pBiheA3kLW+4LVY1OdA pdLU6Iw20+v/+R0V2UGwK/ogyYH/nZ5zZlQH X-Received: by 2002:a9d:154:: with SMTP id 78mr10806259otu.171.1608216760082; Thu, 17 Dec 2020 06:52:40 -0800 (PST) Received: from localhost.localdomain (fixed-187-189-51-144.totalplay.net. [187.189.51.144]) by smtp.gmail.com with ESMTPSA id x130sm1136342oif.3.2020.12.17.06.52.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Dec 2020 06:52:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 20/23] tcg/i386: Use tcg_constant_vec with tcg vec expanders Date: Thu, 17 Dec 2020 08:52:12 -0600 Message-Id: <20201217145215.534637-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201217145215.534637-1-richard.henderson@linaro.org> References: <20201217145215.534637-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::329; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) -- 2.25.1 diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 819ee25cff..36a90e7ef3 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -3508,7 +3508,7 @@ static void expand_vec_rotv(TCGType type, unsigned vece, TCGv_vec v0, static void expand_vec_mul(TCGType type, unsigned vece, TCGv_vec v0, TCGv_vec v1, TCGv_vec v2) { - TCGv_vec t1, t2, t3, t4; + TCGv_vec t1, t2, t3, t4, zero; tcg_debug_assert(vece == MO_8); @@ -3526,11 +3526,11 @@ static void expand_vec_mul(TCGType type, unsigned vece, case TCG_TYPE_V64: t1 = tcg_temp_new_vec(TCG_TYPE_V128); t2 = tcg_temp_new_vec(TCG_TYPE_V128); - tcg_gen_dup16i_vec(t2, 0); + zero = tcg_constant_vec(TCG_TYPE_V128, MO_8, 0); vec_gen_3(INDEX_op_x86_punpckl_vec, TCG_TYPE_V128, MO_8, - tcgv_vec_arg(t1), tcgv_vec_arg(v1), tcgv_vec_arg(t2)); + tcgv_vec_arg(t1), tcgv_vec_arg(v1), tcgv_vec_arg(zero)); vec_gen_3(INDEX_op_x86_punpckl_vec, TCG_TYPE_V128, MO_8, - tcgv_vec_arg(t2), tcgv_vec_arg(t2), tcgv_vec_arg(v2)); + tcgv_vec_arg(t2), tcgv_vec_arg(zero), tcgv_vec_arg(v2)); tcg_gen_mul_vec(MO_16, t1, t1, t2); tcg_gen_shri_vec(MO_16, t1, t1, 8); vec_gen_3(INDEX_op_x86_packus_vec, TCG_TYPE_V128, MO_8, @@ -3545,15 +3545,15 @@ static void expand_vec_mul(TCGType type, unsigned vece, t2 = tcg_temp_new_vec(type); t3 = tcg_temp_new_vec(type); t4 = tcg_temp_new_vec(type); - tcg_gen_dup16i_vec(t4, 0); + zero = tcg_constant_vec(TCG_TYPE_V128, MO_8, 0); vec_gen_3(INDEX_op_x86_punpckl_vec, type, MO_8, - tcgv_vec_arg(t1), tcgv_vec_arg(v1), tcgv_vec_arg(t4)); + tcgv_vec_arg(t1), tcgv_vec_arg(v1), tcgv_vec_arg(zero)); vec_gen_3(INDEX_op_x86_punpckl_vec, type, MO_8, - tcgv_vec_arg(t2), tcgv_vec_arg(t4), tcgv_vec_arg(v2)); + tcgv_vec_arg(t2), tcgv_vec_arg(zero), tcgv_vec_arg(v2)); vec_gen_3(INDEX_op_x86_punpckh_vec, type, MO_8, - tcgv_vec_arg(t3), tcgv_vec_arg(v1), tcgv_vec_arg(t4)); + tcgv_vec_arg(t3), tcgv_vec_arg(v1), tcgv_vec_arg(zero)); vec_gen_3(INDEX_op_x86_punpckh_vec, type, MO_8, - tcgv_vec_arg(t4), tcgv_vec_arg(t4), tcgv_vec_arg(v2)); + tcgv_vec_arg(t4), tcgv_vec_arg(zero), tcgv_vec_arg(v2)); tcg_gen_mul_vec(MO_16, t1, t1, t2); tcg_gen_mul_vec(MO_16, t3, t3, t4); tcg_gen_shri_vec(MO_16, t1, t1, 8); @@ -3581,7 +3581,7 @@ static bool expand_vec_cmp_noinv(TCGType type, unsigned vece, TCGv_vec v0, NEED_UMIN = 8, NEED_UMAX = 16, }; - TCGv_vec t1, t2; + TCGv_vec t1, t2, t3; uint8_t fixup; switch (cond) { @@ -3652,9 +3652,9 @@ static bool expand_vec_cmp_noinv(TCGType type, unsigned vece, TCGv_vec v0, } else if (fixup & NEED_BIAS) { t1 = tcg_temp_new_vec(type); t2 = tcg_temp_new_vec(type); - tcg_gen_dupi_vec(vece, t2, 1ull << ((8 << vece) - 1)); - tcg_gen_sub_vec(vece, t1, v1, t2); - tcg_gen_sub_vec(vece, t2, v2, t2); + t3 = tcg_constant_vec(type, vece, 1ull << ((8 << vece) - 1)); + tcg_gen_sub_vec(vece, t1, v1, t3); + tcg_gen_sub_vec(vece, t2, v2, t3); v1 = t1; v2 = t2; cond = tcg_signed_cond(cond);