From patchwork Tue May 14 00:05:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 164095 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp2128945ili; Mon, 13 May 2019 20:52:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtn0SYGZ+alyiUTJSXpXzfj1LvC8vDper4rDK3lG6t6LAt/0UvaJJqwJcCYLFyw+G5nr9l X-Received: by 2002:a17:906:1f55:: with SMTP id d21mr4140726ejk.87.1557805973081; Mon, 13 May 2019 20:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557805973; cv=none; d=google.com; s=arc-20160816; b=F8pWEPLbU5u9JrhxOAINVRu/CRgUlu/bw2Ic1y8WjcRSRBlEClb4l15hhYyTiwNWRJ nqr4IRVX6p+JsuKcelEdHXD6qOt/DI6rWVexofltLI/0jo/YCdc2/qKbDYWsyDfJfhHP yZsKFGqrjNi4tLn1sOTO+/gZu81gGs7ydtHhVjs9a9uYhIOBGiu51LV4yH6UrhaQVR6o Tz1EXUxJM8yFM2nTNtNG8UFDBka++aLstiU9Ah3PJPunb05qq5McGDioRbIHLT+ASmhP 9D/iszHUT1Dd/y/PiXdoTcCIG1TaZnqxXTDjFowJznXuBamRrIwKZOh0Ivn9J+V4oyly pbiw== 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=yjaWcvw9UbJX/NgPrNoAKyN+ZZwbI4Jl9YPntsAKSX4=; b=Keh7bv9nh0LQIMvsxgkvvu8YHwE3ezl8TiQrv3YBj2F/GakVhdmMSCmYDH/E06aR82 aF/M/3xQ3noZ7lYlD4dcbgF2bUcTZGE1VAjubxMFyjtelBQbi9Ux0P5Q5NH50MehKUvD K1Km4W3NbEMU2BIUA+TdlLpU4ySgqPhCBJKL+Ga/SwhPCqg1LKq9zn3Rln3aDeWF5DfP IRy7lkJtnnVMGx6XfMs2oFWZJLMGgUilaC7EfKw1U3Pwx+xWjq/U2IOBKV0ab29dKVbU OXIdZ1IyYnZ54anCr2Rjr0ulaG2ilDFYt+vw6E9B8a8y5oFr0ygcH5SpKCo0oAV3NaIe REwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="cI/k2fgl"; 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 c44si11032748ede.137.2019.05.13.20.52.52 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 13 May 2019 20:52:53 -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=fail header.i=@linaro.org header.s=google header.b="cI/k2fgl"; 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]:38570 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQOUm-0000BS-2x for patch@linaro.org; Mon, 13 May 2019 23:52:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQOUU-0000BE-3T for qemu-devel@nongnu.org; Mon, 13 May 2019 23:52:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQOUS-000355-Uk for qemu-devel@nongnu.org; Mon, 13 May 2019 23:52:34 -0400 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]:36943) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hQKxJ-0003Ay-9X for qemu-devel@nongnu.org; Mon, 13 May 2019 20:06:07 -0400 Received: by mail-pf1-x42a.google.com with SMTP id g3so8067283pfi.4 for ; Mon, 13 May 2019 17:05:59 -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=yjaWcvw9UbJX/NgPrNoAKyN+ZZwbI4Jl9YPntsAKSX4=; b=cI/k2fglzCzVv0W2UtPeSLi5Lo4mXGxJ9Uae728eJQPc2FXSW9n4qUv3tG0dKTNRua fI0eaDJ8V+0JNDwbtKovaO9gGa+OeDA0YnZEdQWDdOYJPLGhoSqJ+cySa6voAT/ay840 AE/STidMQbjqfkDERn+rVlRcIXBzwQDUSKU8+F5vDH/m9xtpVQSFyXc4IqG5lm+7KB/i Hu4imRsPpzXwnltiowpjIr1OhtuIuejwJLqF4gy427lgk3s4knHcFIv6eWI7Btojx1/S GCXLqly92L1BnKVh0baAvZ/4Pr0PE2EATks10BZxdqGde1y/WU0bXTtzR1IY3qyjlhm0 R0RQ== 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=yjaWcvw9UbJX/NgPrNoAKyN+ZZwbI4Jl9YPntsAKSX4=; b=Lv5Ax1B95WYaMGNx9J/UlBswDWJ/Wft7X7vHeG2DT6RthXahDiNnfy+D8XX6r7lC9T m3IX0wDaptd/lmiUZVE9dkQIETIgJUyZtm2jbqlGUjcsqovREaHd0RQAayB5P6BlJwjn 7EFvpPgTZnXVCvpEbWl8CJtLJiWphfpr7LgOcJoYml8I64RWUbFOordsmFw1Yq4qaEDJ gWijQy6kmekPRNUvYMfJWH5dz9b+fd/kyHIAoPCRH9Suqr0Xu2aEcPHpWuf9EUoANdK8 YVOty5/xcKT5/zHhjr1eZpO65bQ8weL5UElSq+djoFfgEE36dApzGCRMOELGhUCPm7IE FUEg== X-Gm-Message-State: APjAAAUlgwY708Q7+FTcZCtTd5tUmkz7MzciWUVicl0N9JiiLThH6gDJ cxInp50ycwQL+R8owtz08c1xA7d+YT0= X-Received: by 2002:a65:5241:: with SMTP id q1mr34254286pgp.298.1557792357975; Mon, 13 May 2019 17:05:57 -0700 (PDT) Received: from localhost.localdomain (97-113-13-231.tukw.qwest.net. [97.113.13.231]) by smtp.gmail.com with ESMTPSA id u3sm238151pfn.29.2019.05.13.17.05.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 May 2019 17:05:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 13 May 2019 17:05:20 -0700 Message-Id: <20190514000540.4313-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190514000540.4313-1-richard.henderson@linaro.org> References: <20190514000540.4313-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::42a Subject: [Qemu-devel] [PULL 11/31] tcg: Add tcg_out_dupm_vec to the backend interface 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@linux.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Currently stubbed out in all backends that support vectors. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.inc.c | 6 ++++++ tcg/i386/tcg-target.inc.c | 7 +++++++ tcg/tcg.c | 19 ++++++++++++++++++- 3 files changed, 31 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index 3cefdd1e43..4a3cfa778a 100644 --- a/tcg/aarch64/tcg-target.inc.c +++ b/tcg/aarch64/tcg-target.inc.c @@ -822,6 +822,12 @@ static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, return true; } +static bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece, + TCGReg r, TCGReg base, intptr_t offset) +{ + return false; +} + static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg rd, tcg_target_long value) { diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c index 3c8229d413..f04933bc19 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/tcg-target.inc.c @@ -891,6 +891,13 @@ static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, return true; } +static bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece, + TCGReg r, TCGReg base, intptr_t offset) +{ + return false; +} + + static void tcg_out_dupi_vec(TCGContext *s, TCGType type, TCGReg ret, tcg_target_long arg) { diff --git a/tcg/tcg.c b/tcg/tcg.c index 2b715bf099..b9945794c4 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -111,6 +111,8 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, #if TCG_TARGET_MAYBE_vec static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, TCGReg dst, TCGReg src); +static bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece, + TCGReg dst, TCGReg base, intptr_t offset); static void tcg_out_dupi_vec(TCGContext *s, TCGType type, TCGReg dst, tcg_target_long arg); static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, unsigned vecl, @@ -122,6 +124,11 @@ static inline bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, { g_assert_not_reached(); } +static inline bool tcg_out_dupm_vec(TCGContext *s, TCGType type, unsigned vece, + TCGReg dst, TCGReg base, intptr_t offset) +{ + g_assert_not_reached(); +} static inline void tcg_out_dupi_vec(TCGContext *s, TCGType type, TCGReg dst, tcg_target_long arg) { @@ -3422,6 +3429,7 @@ static void tcg_reg_alloc_dup(TCGContext *s, const TCGOp *op) TCGRegSet dup_out_regs, dup_in_regs; TCGTemp *its, *ots; TCGType itype, vtype; + intptr_t endian_fixup; unsigned vece; bool ok; @@ -3491,7 +3499,16 @@ static void tcg_reg_alloc_dup(TCGContext *s, const TCGOp *op) /* fall through */ case TEMP_VAL_MEM: - /* TODO: dup from memory */ +#ifdef HOST_WORDS_BIGENDIAN + endian_fixup = itype == TCG_TYPE_I32 ? 4 : 8; + endian_fixup -= 1 << vece; +#else + endian_fixup = 0; +#endif + if (tcg_out_dupm_vec(s, vtype, vece, ots->reg, its->mem_base->reg, + its->mem_offset + endian_fixup)) { + goto done; + } tcg_out_ld(s, itype, ots->reg, its->mem_base->reg, its->mem_offset); break;