From patchwork Sat Apr 18 16:19:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 185570 Delivered-To: patch@linaro.org Received: by 2002:a92:3d9a:0:0:0:0:0 with SMTP id k26csp1912781ilf; Sat, 18 Apr 2020 09:33:32 -0700 (PDT) X-Google-Smtp-Source: APiQypJeNjX/t+XzE5o3ySG//T4qOCkjUmziaQkMiOEmy6xTXx9IF8cZ4USNGXdG4L70l1Np/vNh X-Received: by 2002:ac8:389b:: with SMTP id f27mr8670879qtc.39.1587227612027; Sat, 18 Apr 2020 09:33:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587227612; cv=none; d=google.com; s=arc-20160816; b=Y1Ej6fhfCTORS+A655MpFL+5p1rLfp29nzUh50mSPFsXGpg1Bu4XZT3MD1D9jk/pK3 NlwtW2NLuwvwKvEi2vZLkVJ4+X6za2gIw16i4J8/kQm3wcDJWyZsuLoXQC7IX9vgcHPp siZ8TmJByRHsR89DaUbINTF4Ekz+iWZpLONe/HzoixaZ8m9Qo9cGJ7WGZJxoWRKQUOys xFG8XVjhmpxQWuFOJSMPWHqz6FRBWw3nf1wlNvb9OcKq8xUtRdvGfd722NSjR/neqJUr KwCXDPh06NAtFWZsR+yvLkNRmzHQfTnMg2LG6uAnDh3vpfhVq0rufP1+HYyxd8If2LLl 4tcA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=5EBqK+tM4Y7xOqKxuEa+KWDMy/xyFBtPmoMR4ACbhCI=; b=IrvqZDRJ8GphUY8ntBEMhYCPPfhMjGa9eK0Z7C3rzw66HmRJJ25SE1/8C1LLFp95ZS kcMcF7qCo5HA7SSOUVg53EYRQdlFkHxvopm+FC2bS/eTLclXL2ss//INPLLxoCEIl0Z0 juMzgsfIU/wjyUi3b4YcoggzsMKYWMCNcPzqIBu32Qpyecb0mlk45+PKC26S5w2VIj7D jLPyd90kIaJSyIBqHTp7rK42hUXh7thuUB2xbfIGZOrgidHoHjk2e68FVpX0PVITTJ0e kCNSRt1CvhOYRouZy920hDj4wQRQiLuW83du0JkKPZ8JzTAl8uk5g/TmuYQ5NDgXD5B5 IYaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W60N9OXy; 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 h23si4402330qkk.68.2020.04.18.09.33.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 18 Apr 2020 09:33:32 -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; dkim=pass header.i=@linaro.org header.s=google header.b=W60N9OXy; 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]:59874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPqPL-0006R9-HM for patch@linaro.org; Sat, 18 Apr 2020 12:33:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48307) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jPqBy-0004Tm-CP for qemu-devel@nongnu.org; Sat, 18 Apr 2020 12:19:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jPqBu-0005fd-Og for qemu-devel@nongnu.org; Sat, 18 Apr 2020 12:19:42 -0400 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:35695) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jPqBu-0005cM-Is for qemu-devel@nongnu.org; Sat, 18 Apr 2020 12:19:38 -0400 Received: by mail-pj1-x1044.google.com with SMTP id ms17so2475909pjb.0 for ; Sat, 18 Apr 2020 09:19:38 -0700 (PDT) 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:mime-version :content-transfer-encoding; bh=5EBqK+tM4Y7xOqKxuEa+KWDMy/xyFBtPmoMR4ACbhCI=; b=W60N9OXyx7ub7eJyM6bNMuEhCl6l5tLDnpMR/1B83NV2xQ15N/khrf8GRbS9c7kAOP SnHLL2pAMA1tQJk7Txz4oTRtTRUjFUE8UbF2bI9S9vanG29MWPichT2dBGuJOG8r7SjV n+94X+EfZ2OkpP9kWh819zzVK72hJB+G1/0PTIJ9b0MVT5lE6/M3brK7Dc/lFmcsG0LI l8+Xu7KY+fYuuVO/ju8ZybhM0aIFGhGJAy9XPVACk0apDMSMQK7vD8mXCAWCjLkLKHtw gO1QixRXeqoIHOI8AiJeftPQFXqnYPIzFF33Yn9lrR/xrJJ08L+xEDkHtTc2Len0WqUR 7hPQ== 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:mime-version:content-transfer-encoding; bh=5EBqK+tM4Y7xOqKxuEa+KWDMy/xyFBtPmoMR4ACbhCI=; b=FhfDn00R0xEmcbgOkLqnPgBm3O+iXHEt4uySpzQc46CPf8eE02TE6JBj9/kvceoaHw 9umA0QzXoauwBSo4ONN6jwza8UrhaOIKlV29NkxRhyw4DgYO7zFm7eOousIVVWaPQzIb hTAFxptNKsnPS1jHVaM3Fj44BTp/TKsnI/i2FyRdK+YrQX3RRxhg61DJ0pBIzRGhx2Wr AVsgKWAlFm9Z+nluBYAydE0dav0ZivHcpbwBM6g7MSy7rMgKlztTR/CIW31s8qU+V/3H rpJazSLxflXrf0G6LmG/qnjfMstN3yOc53a1d89kL63dof0qSplBDsPs/tydgDWduG0U 09jg== X-Gm-Message-State: AGi0PuZiRb2sgHywTV9Pr7rWG0v/SADn7ufc4e1iwkFyhjaHEFjPI9V2 7a2rlpZPxurmcimjy+O896EN6DE8QUU= X-Received: by 2002:a17:902:a40e:: with SMTP id p14mr8406466plq.297.1587226776818; Sat, 18 Apr 2020 09:19:36 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id i187sm22398382pfc.112.2020.04.18.09.19.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Apr 2020 09:19:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 15/16] tcg/i386: Use tcg_constant_vec with tcg vec expanders Date: Sat, 18 Apr 2020 09:19:13 -0700 Message-Id: <20200418161914.4387-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200418161914.4387-1-richard.henderson@linaro.org> References: <20200418161914.4387-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::1044 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.inc.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) -- 2.20.1 diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c index 9cb627d6eb..deace219d2 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/tcg-target.inc.c @@ -3452,7 +3452,7 @@ static void expand_vec_sari(TCGType type, unsigned vece, 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); @@ -3470,11 +3470,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, @@ -3489,15 +3489,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); @@ -3525,7 +3525,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) { @@ -3596,9 +3596,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);