From patchwork Tue Mar 19 17:21:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 160593 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp4136674jad; Tue, 19 Mar 2019 10:24:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzDc/0pNyHRMSGNFjmqOyYvzOo3Q4HSTRxwXjk6iPm5bNGTxW94j64vz9Twv2Jc0UTtb2nu X-Received: by 2002:a7b:c111:: with SMTP id w17mr4774183wmi.6.1553016284649; Tue, 19 Mar 2019 10:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553016284; cv=none; d=google.com; s=arc-20160816; b=k5kulvihy42eWJXQMEJSrb0zBEaJ+TJZHXNJIq7a7IfH+7JxstlRDy3Bq8wELQFX27 50DMWz5jSqnoI5Ej8LceKzuOoLvNmYL6u3G8XQU7OMJPkxnMn1rYDaVht6sFVk7ThldC 4ABV9+taV/mMcR+luKNNoWQz722TI9M3jtXkQ7WKs3iAZuCvv2uoureFQodJYAKIGl6G zFJDx8az2Ccd0/dVqQQq18ypSA/jERPwOGvfI6jMbSIR31D+Lei6dS+y6w1QecCFcepX ewLs8Mfh7ZCrVoiBQMcK7pZf+AbnZ0jFNmURvosSfFpCbNC33PHmIk5/zVYV2b9z2v+J Dhsg== 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=gZi8bIQjSTF/5KTE1LcSi/XifGrmbOe2PcmtjQivf7M=; b=FdultFdz8xbigMLgou8up5xj7SPg5xcN6YoRG7nwyVHHikctPKnL5m+hC1zKJUmrSi RJ1t5lop6rdbeqO5hKsAtzXEQLuAWhWyKLGgMZ8Ozkxw8dYTu/YFytVKiXTBI7opBhY8 GZ3QCXtz8+EWaVyM8kB7pl2Ct90vjVAkp0frTNIaF+GgRmoCsR89F7YsjyVW+1o0L35O RrNPPKbyh4As9xkMKjKoytZsACOocmMALdxUsz9inD7Lyfr99G0b6QonI8IuB3k67nZi hgvvxKf4Il9S2sOFJJOuMrpHpu8VtrALwvrFV2qm5MLZfcK0rb7X4YVvRGRnf8XM48di grfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=exA6Wkj9; 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 x5si8975013wrw.221.2019.03.19.10.24.44 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 19 Mar 2019 10:24:44 -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=exA6Wkj9; 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]:60686 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6ITj-0006fo-Hs for patch@linaro.org; Tue, 19 Mar 2019 13:24:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6IQn-0004cz-RS for qemu-devel@nongnu.org; Tue, 19 Mar 2019 13:21:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6IQm-0004XY-9T for qemu-devel@nongnu.org; Tue, 19 Mar 2019 13:21:41 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]:46205) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h6IQl-0004WS-QZ for qemu-devel@nongnu.org; Tue, 19 Mar 2019 13:21:40 -0400 Received: by mail-pf1-x42c.google.com with SMTP id s23so14148460pfe.13 for ; Tue, 19 Mar 2019 10:21:39 -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=gZi8bIQjSTF/5KTE1LcSi/XifGrmbOe2PcmtjQivf7M=; b=exA6Wkj9VOAvnYxOfHIaKJCxFMWbEaGjeA+p8CMMhJd1zHpYLJL+MevZ+dijizdqxI W2uSycYc8q8LXf8sAZAuU5UZau8knvXEXlLBcKdONyFugwnRKCRiNOw+6ypQvVvR0Gcz +cukAHypH3//Xw+kDZmzPs4Si+WjvZimL+3umEsfqZiB3QkNYYSLKd0DmJ6Uu5optX+c f8BzS0EqPkhCFssQ4iIrJ7gHzW1LA2+SVPtFba3twt9IlP0HFSQHNwv6AbmOoo02U2/D 8IVNWXJOPvilbMxP63QUKqsmR6VURntiuY+UB7zv3nYhzL5FQqM5bNkKa9WtlGZ53ksT oCRw== 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=gZi8bIQjSTF/5KTE1LcSi/XifGrmbOe2PcmtjQivf7M=; b=UJOAEd8ns4sdaxJC+nrK60gQ6VbhUEtIwE1CRP+x2v7Stu0zz9JYdSgTI0aDSDSCx2 i8iSaemrUEFMeiUY1SZ4BsHJYmTrK2OOa4RmTgPfnSarv8btpWTgyeR5txSeaTVvaUzS Env2L8NGsHU7xfdkdh2Slns1eUqGY+jiroQy+os92hhVLDgTduG/u9cB+uvgT05xPcKr FIienrefQJsieYliIDUC8/0buJVlGKZQRPjB3OrrNO5iPGe4W4XcyaIFd+1XMELs/QIt FDKo6zzOh7aVfAw692uE677I+aG0ABW4JYoLHP0fgaGnAYa++2m3n9+NHFW3BkxQJISr zrqA== X-Gm-Message-State: APjAAAUmUSQL2JdiValXJkNUmGbEdHrl2bupMDCgVQh1OOA5DiTpNb3I +ZRlGakabgJ2r0x/ps6QGz8mDGk10Ko= X-Received: by 2002:a17:902:56a:: with SMTP id 97mr3333199plf.320.1553016098336; Tue, 19 Mar 2019 10:21:38 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id w68sm5616666pfb.176.2019.03.19.10.21.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Mar 2019 10:21:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 19 Mar 2019 10:21:15 -0700 Message-Id: <20190319172126.7502-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190319172126.7502-1-richard.henderson@linaro.org> References: <20190319172126.7502-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::42c Subject: [Qemu-devel] [PATCH for-4.1 v3 06/17] tcg: Promote tcg_out_{dup, dupi}_vec to 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: mark.cave-ayland@ilande.co.uk, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The i386 backend already has these functions, and the aarch64 backend could easily split out one. Nothing is done with these functions yet, but this will aid register allocation of INDEX_op_dup_vec in a later patch. Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.inc.c | 12 ++++++++++-- tcg/i386/tcg-target.inc.c | 3 ++- tcg/tcg.c | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) -- 2.17.2 diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index 6ba9050d9a..3c786ee581 100644 --- a/tcg/aarch64/tcg-target.inc.c +++ b/tcg/aarch64/tcg-target.inc.c @@ -799,7 +799,7 @@ static void tcg_out_logicali(TCGContext *s, AArch64Insn insn, TCGType ext, } static void tcg_out_dupi_vec(TCGContext *s, TCGType type, - TCGReg rd, uint64_t v64) + TCGReg rd, tcg_target_long v64) { int op, cmode, imm8; @@ -814,6 +814,14 @@ static void tcg_out_dupi_vec(TCGContext *s, TCGType type, } } +static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, + TCGReg rd, TCGReg rs) +{ + int is_q = type - TCG_TYPE_V64; + tcg_out_insn(s, 3605, DUP, is_q, rd, rs, 1 << vece, 0); + return true; +} + static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg rd, tcg_target_long value) { @@ -2192,7 +2200,7 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, tcg_out_insn(s, 3617, NOT, is_q, 0, a0, a1); break; case INDEX_op_dup_vec: - tcg_out_insn(s, 3605, DUP, is_q, a0, a1, 1 << vece, 0); + tcg_out_dup_vec(s, type, vece, a0, a1); break; case INDEX_op_shli_vec: tcg_out_insn(s, 3614, SHL, is_q, a0, a1, a2 + (8 << vece)); diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c index 7100cf7ac3..b8e677e46d 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/tcg-target.inc.c @@ -854,7 +854,7 @@ static bool tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg) return true; } -static void tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, +static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, TCGReg r, TCGReg a) { if (have_avx2) { @@ -887,6 +887,7 @@ static void tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, g_assert_not_reached(); } } + return true; } static void tcg_out_dupi_vec(TCGContext *s, TCGType type, diff --git a/tcg/tcg.c b/tcg/tcg.c index b5389ea767..ca5f3ed5ce 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -108,10 +108,24 @@ static void tcg_out_movi(TCGContext *s, TCGType type, static void tcg_out_op(TCGContext *s, TCGOpcode opc, const TCGArg *args, const int *const_args); #if TCG_TARGET_MAYBE_vec +static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, + TCGReg dst, TCGReg src); +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, unsigned vece, const TCGArg *args, const int *const_args); #else +static inline bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece, + TCGReg dst, TCGReg src) +{ + g_assert_not_reached(); +} +static inline void tcg_out_dupi_vec(TCGContext *s, TCGType type, + TCGReg dst, tcg_target_long arg) +{ + g_assert_not_reached(); +} static inline void tcg_out_vec_op(TCGContext *s, TCGOpcode opc, unsigned vecl, unsigned vece, const TCGArg *args, const int *const_args)