From patchwork Mon Jan 28 15:58:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 156767 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3595135jaa; Mon, 28 Jan 2019 08:06:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN4J76VQ4qF44fmCZ0mEQB9N7avcdFA1InshyBtKuxB74f6O11/Q/aSMboewV1b7tg/DFi7o X-Received: by 2002:adf:fa83:: with SMTP id h3mr23858232wrr.173.1548691608581; Mon, 28 Jan 2019 08:06:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691608; cv=none; d=google.com; s=arc-20160816; b=FoLqRXH8O7GAHVkfA7JydNCrPUZzdlsbyfC6UmPPtGkwqZ8rtXfBt6eWsKVpEJx36Z lxjUmjGfNJlrClSePDCa55Vr4zzUfbBfCXeGT8OS1FRY93DuzwgRxxzxasOMv73+1tT7 ba/CEzx+Onl+yBc5jSs2FYWrVsnCPZPMDk+skh3gVWPZ3UavbNHi63f+IeRu1zSanWwj jeY9ra9PgWfRdhs+ZF7V7jvLxrJ1+riU+GWuZyTQIUOP9rG5HcLylhc1LO7xPoYcG9rS YlR7ckVSbfE6qHOFTbCaIvk1Llc5VNPUM8qLTFOviqEOGXMQiYChBCfyUgdktvn0X8pU 3UWw== 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=13baR0fYl6duiBYqIpKDqOz4EjDaN2cM4w2ffhmehW8=; b=fDE88RtTpByZI8w3JTpbeOIkQTAfI+y5yFFlQMa+29IT45DBncd2s5ggIBELsIbvDr JkxTzC+TNWBN6t/d1Lhdr8PUsmiO4gKK3AZ+rxqrqBXHuxDDDUOWI7r3buFX230aQOwv sfJJBrR8BY4L6z/TgtBt9oELh392hk4TQuXUiozGmnHtFXpj/mG0lODastbvXpPg8KRo VKMDPUbe3/lIaIlCSea2Xpxm4dsnICZU3g2dSkBD3CSegherS1ieGd+QA7/CD81OuHtR bqeI9ENX9Rv4n4Bd8iniHqeugnl9xvNE9rnfaTHUGvbxDH3jEYzzfjGoPWAIg/89Ad5F PPUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TvvOZbnN; 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=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m12si47354990wmd.167.2019.01.28.08.06.48 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Jan 2019 08:06:48 -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=fail header.i=@linaro.org header.s=google header.b=TvvOZbnN; 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=linaro.org Received: from localhost ([127.0.0.1]:34257 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go9Qt-00026o-Bw for patch@linaro.org; Mon, 28 Jan 2019 11:06:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go9Jf-0004ne-1q for qemu-devel@nongnu.org; Mon, 28 Jan 2019 10:59:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1go9Jd-0007hv-5J for qemu-devel@nongnu.org; Mon, 28 Jan 2019 10:59:18 -0500 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]:43918) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1go9Jc-0007hR-U9 for qemu-devel@nongnu.org; Mon, 28 Jan 2019 10:59:17 -0500 Received: by mail-pg1-x535.google.com with SMTP id v28so7381336pgk.10 for ; Mon, 28 Jan 2019 07:59:16 -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=13baR0fYl6duiBYqIpKDqOz4EjDaN2cM4w2ffhmehW8=; b=TvvOZbnNY38w1YroBEn0r5BAh0m9V5jySacb2qNJx3U+O5j9FPeoZjIem11l3mklFq iGLV6AE02iXDUT5mt9U/plGe9Mjhg7g7RCE6RLPLO1VXYW/jpapA3dcLhaZ4Ybpf+kv2 KhWa61PDDijJfBIWI8w1EqRk8lBHPUQB4OAZc= 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=13baR0fYl6duiBYqIpKDqOz4EjDaN2cM4w2ffhmehW8=; b=QqJY8OgYV0XeEijuOh+lnQMX1Tm7S9dBpLCwti2OUF7OvrsglA8FDSU/vy7XFz0WRO XuxT/GsDOWLSr74Z2ckpDncB98qxihqO3ZnTnxf/zhxnwZfmU4JU2z6ujfRaFnsqWft7 I0wFd/3Z+zUS99goo8dCkaVIs1WIY1r2Z5nz2ptgbiC0vsHDy3dum8tAjLrBnf0KQJeH PeqYZ/VD5/4qlYAaMadRIaIROEZVjl4/GEpUenNTSfIHqQTX+TxMQb62FJ4iEMEo0xac SPqHHNsTm0DdfW6ZSZEtUD0FD0tKLyQaT9ZR/nHnWd8kVFr97Y4k1O1bpPinTF2abYhf n9pg== X-Gm-Message-State: AJcUukfAFmKMbGGZbPRSYG9UojQQHsnrAoI6IDR3y+DlZGlY2/HWwvgI Se4ti4NW5wOCsdMQ2O5qBlSS6gx5PYc= X-Received: by 2002:a62:ca05:: with SMTP id n5mr22467747pfg.154.1548691155192; Mon, 28 Jan 2019 07:59:15 -0800 (PST) Received: from cloudburst.twiddle.net (50-233-235-3-static.hfc.comcastbusiness.net. [50.233.235.3]) by smtp.gmail.com with ESMTPSA id p2sm45518687pfp.125.2019.01.28.07.59.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 07:59:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 28 Jan 2019 07:58:47 -0800 Message-Id: <20190128155907.20607-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190128155907.20607-1-richard.henderson@linaro.org> References: <20190128155907.20607-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::535 Subject: [Qemu-devel] [PULL 03/23] tcg: Add write_aofs to GVecGen4 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" This allows writing 2 output, 3 input operations. Signed-off-by: Richard Henderson --- tcg/tcg-op-gvec.h | 2 ++ tcg/tcg-op-gvec.c | 27 +++++++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) -- 2.17.2 diff --git a/tcg/tcg-op-gvec.h b/tcg/tcg-op-gvec.h index d65b9d9d4c..2cb447112e 100644 --- a/tcg/tcg-op-gvec.h +++ b/tcg/tcg-op-gvec.h @@ -181,6 +181,8 @@ typedef struct { uint8_t vece; /* Prefer i64 to v64. */ bool prefer_i64; + /* Write aofs as a 2nd dest operand. */ + bool write_aofs; } GVecGen4; void tcg_gen_gvec_2(uint32_t dofs, uint32_t aofs, diff --git a/tcg/tcg-op-gvec.c b/tcg/tcg-op-gvec.c index 81689d02f7..c10d3d7b26 100644 --- a/tcg/tcg-op-gvec.c +++ b/tcg/tcg-op-gvec.c @@ -665,7 +665,7 @@ static void expand_3_i32(uint32_t dofs, uint32_t aofs, /* Expand OPSZ bytes worth of three-operand operations using i32 elements. */ static void expand_4_i32(uint32_t dofs, uint32_t aofs, uint32_t bofs, - uint32_t cofs, uint32_t oprsz, + uint32_t cofs, uint32_t oprsz, bool write_aofs, void (*fni)(TCGv_i32, TCGv_i32, TCGv_i32, TCGv_i32)) { TCGv_i32 t0 = tcg_temp_new_i32(); @@ -680,6 +680,9 @@ static void expand_4_i32(uint32_t dofs, uint32_t aofs, uint32_t bofs, tcg_gen_ld_i32(t3, cpu_env, cofs + i); fni(t0, t1, t2, t3); tcg_gen_st_i32(t0, cpu_env, dofs + i); + if (write_aofs) { + tcg_gen_st_i32(t1, cpu_env, aofs + i); + } } tcg_temp_free_i32(t3); tcg_temp_free_i32(t2); @@ -769,7 +772,7 @@ static void expand_3_i64(uint32_t dofs, uint32_t aofs, /* Expand OPSZ bytes worth of three-operand operations using i64 elements. */ static void expand_4_i64(uint32_t dofs, uint32_t aofs, uint32_t bofs, - uint32_t cofs, uint32_t oprsz, + uint32_t cofs, uint32_t oprsz, bool write_aofs, void (*fni)(TCGv_i64, TCGv_i64, TCGv_i64, TCGv_i64)) { TCGv_i64 t0 = tcg_temp_new_i64(); @@ -784,6 +787,9 @@ static void expand_4_i64(uint32_t dofs, uint32_t aofs, uint32_t bofs, tcg_gen_ld_i64(t3, cpu_env, cofs + i); fni(t0, t1, t2, t3); tcg_gen_st_i64(t0, cpu_env, dofs + i); + if (write_aofs) { + tcg_gen_st_i64(t1, cpu_env, aofs + i); + } } tcg_temp_free_i64(t3); tcg_temp_free_i64(t2); @@ -880,7 +886,7 @@ static void expand_3_vec(unsigned vece, uint32_t dofs, uint32_t aofs, /* Expand OPSZ bytes worth of four-operand operations using host vectors. */ static void expand_4_vec(unsigned vece, uint32_t dofs, uint32_t aofs, uint32_t bofs, uint32_t cofs, uint32_t oprsz, - uint32_t tysz, TCGType type, + uint32_t tysz, TCGType type, bool write_aofs, void (*fni)(unsigned, TCGv_vec, TCGv_vec, TCGv_vec, TCGv_vec)) { @@ -896,6 +902,9 @@ static void expand_4_vec(unsigned vece, uint32_t dofs, uint32_t aofs, tcg_gen_ld_vec(t3, cpu_env, cofs + i); fni(vece, t0, t1, t2, t3); tcg_gen_st_vec(t0, cpu_env, dofs + i); + if (write_aofs) { + tcg_gen_st_vec(t1, cpu_env, aofs + i); + } } tcg_temp_free_vec(t3); tcg_temp_free_vec(t2); @@ -1187,7 +1196,7 @@ void tcg_gen_gvec_4(uint32_t dofs, uint32_t aofs, uint32_t bofs, uint32_t cofs, */ some = QEMU_ALIGN_DOWN(oprsz, 32); expand_4_vec(g->vece, dofs, aofs, bofs, cofs, some, - 32, TCG_TYPE_V256, g->fniv); + 32, TCG_TYPE_V256, g->write_aofs, g->fniv); if (some == oprsz) { break; } @@ -1200,18 +1209,20 @@ void tcg_gen_gvec_4(uint32_t dofs, uint32_t aofs, uint32_t bofs, uint32_t cofs, /* fallthru */ case TCG_TYPE_V128: expand_4_vec(g->vece, dofs, aofs, bofs, cofs, oprsz, - 16, TCG_TYPE_V128, g->fniv); + 16, TCG_TYPE_V128, g->write_aofs, g->fniv); break; case TCG_TYPE_V64: expand_4_vec(g->vece, dofs, aofs, bofs, cofs, oprsz, - 8, TCG_TYPE_V64, g->fniv); + 8, TCG_TYPE_V64, g->write_aofs, g->fniv); break; case 0: if (g->fni8 && check_size_impl(oprsz, 8)) { - expand_4_i64(dofs, aofs, bofs, cofs, oprsz, g->fni8); + expand_4_i64(dofs, aofs, bofs, cofs, oprsz, + g->write_aofs, g->fni8); } else if (g->fni4 && check_size_impl(oprsz, 4)) { - expand_4_i32(dofs, aofs, bofs, cofs, oprsz, g->fni4); + expand_4_i32(dofs, aofs, bofs, cofs, oprsz, + g->write_aofs, g->fni4); } else { assert(g->fno != NULL); tcg_gen_gvec_4_ool(dofs, aofs, bofs, cofs,