From patchwork Wed May 1 05:05:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 163182 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp4122545ill; Tue, 30 Apr 2019 22:09:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLcdrN5pSuk19zXGOuuLhgPcFXRrYNm5TZjXD4jjjFzONqsaUWS2zWlos1Zj42xm1gjzYs X-Received: by 2002:a5d:4eca:: with SMTP id s10mr1093780wrv.319.1556687362305; Tue, 30 Apr 2019 22:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556687362; cv=none; d=google.com; s=arc-20160816; b=IcagYzHTLevUsoYdLqvOS6v0OyM07/I/rNXYQQ5X8sz+R2Uf+1F1B3Wa6/KC/c+PRs jQeLlVtwS1bDYG1v8TB39DVDGhY9+23s9L6rEoy76IpJ4YR/WMfimHU2oh5l5scq2iwS AQtRQh9CqVteMPqtDNR8MNmSFLgPP9asVhL1RAXqOS4JHkGmZCaZUzv11b7cMtrbY1aX w7Nt2kxbuwGJiFtLgjqj9HXdW5rK/Cab3yEpYkcjbeqrRqPW+nEAPABjY3k/DoKYbNbU xfxrUZ61UX9DP06OQnNo8sVoya6mW5dMQz1OFyU4sEnwc6odlMxp1olSY8mfjVqZMeUI 6ykw== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=rtRPUDY4TdKCbPvS0GzwaINTK6SrdvAgOdsr0QnNjbg=; b=jLsyaLyn0MNUt8Txy10yyPaZ+r2RCHob6Ao2hrLQtYOWmgLbAcPFA7A0GVtoWaWT6L gmVMLdo+Q/3ct1zz0dcRlNbMFkNWCEtPkVuxwygSgYkLL+IDvzU2myaFFrS+nocQTaDa FO7DGSG3K1UA6+3UIHfYMOVDh+W7BLLSdOlGFCAgq86PnrQnimY8zEtyImiRikKMIePh SEWpUEkVOpDnfdDbFtUz0dGXw73Rmd+4xPuIXrlOk0XMswNj4ZZgom7DBJ6WnbxuS6u2 R+Pvw6XsAXVCEmfHPeMRPedh5XuVxnimWXBHH13S2QePCHT4idQnZrv01WooJp0sKVsu aogg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YkWklY4M; 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 c3si26926466wrv.444.2019.04.30.22.09.22 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 30 Apr 2019 22:09:22 -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=YkWklY4M; 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]:36241 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLhUf-0000SZ-4U for patch@linaro.org; Wed, 01 May 2019 01:09:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLhRN-0006Px-SH for qemu-devel@nongnu.org; Wed, 01 May 2019 01:06:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLhRK-0002qs-Qz for qemu-devel@nongnu.org; Wed, 01 May 2019 01:05:57 -0400 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]:34455) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hLhRK-0002qg-LO for qemu-devel@nongnu.org; Wed, 01 May 2019 01:05:54 -0400 Received: by mail-pf1-x441.google.com with SMTP id b3so8156766pfd.1 for ; Tue, 30 Apr 2019 22:05:54 -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; bh=rtRPUDY4TdKCbPvS0GzwaINTK6SrdvAgOdsr0QnNjbg=; b=YkWklY4MUSrqX7mMOxEnKMMJWvhhNZCYDyRC7u31LuwmDgIlWlmw2PBMVt+YRDn/Pt IOHy3fMnuU/x8mecmftZHyoVeOWQuwKsZVZqOvdoCz+NBFhBFmQxz4H1Cz7e8/a63t4U RyNRr9D6zDF9oNkqHHUjVaqUd5L+4zZYbTncSgvUn42Ar3tTqrIFqO27e4/G5JahE7q/ nJT/m4AIJkDE9c/mBeP9NL+984FPEzoIOLKG1IpsiEsO0A4ys+WdPETCeH4GngGJqaYj URZNngTccAVIy5FMt568wujRzzK7g2zorpmk90BcycyKmXlp5thWpYsJhu2n72Hf3q46 1s+Q== 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; bh=rtRPUDY4TdKCbPvS0GzwaINTK6SrdvAgOdsr0QnNjbg=; b=CobM8vbobNbYuiL5MBb3OZlyIitMXz+WXn+cLQa5yEjS6+yiZkNwuXcSNuZRRr5Xhr QrAUKu15hQT+b1kKKdUEK3QnZVqsPGwV/ZEXJvomdOu0WZQD/GGmiDMnS1AeBHfF7CbG NRzbWZEhwbWFZbHhHYxXBhCkXWnPhyQRfCCUZhhAGfKtw00X/AMttg5K7n02BEv1C6GX t+QZ3kFgIch4HrEEJrjOMTW2sFyXRE1ehm+zauoVB+WG4T4DTJnX6ApvA69/hbUYabPZ eIGku9FNDqLL+ADSC6YTyA0E3cGAVkH1CmA/ij2BOq1qQjqP9PvXLNn0WjH9DvXm5Jgp NIiA== X-Gm-Message-State: APjAAAUud0dgF3BA8AA+Q2fiPKWGYBTtE/arTWtgfxfZJy77NnBCU+yj g4Bd7z2Isvl3SSIVqAEJi5fnk5NeIOk= X-Received: by 2002:a63:5953:: with SMTP id j19mr71395596pgm.260.1556687153322; Tue, 30 Apr 2019 22:05:53 -0700 (PDT) Received: from localhost.localdomain (97-113-189-189.tukw.qwest.net. [97.113.189.189]) by smtp.gmail.com with ESMTPSA id t127sm9687251pfb.106.2019.04.30.22.05.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Apr 2019 22:05:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 30 Apr 2019 22:05:15 -0700 Message-Id: <20190501050536.15580-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190501050536.15580-1-richard.henderson@linaro.org> References: <20190501050536.15580-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::441 Subject: [Qemu-devel] [PATCH v2 08/29] 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: , 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.1 Reviewed-by: Alex Bennée diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index ee89734318..e443b5df23 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) { @@ -2201,7 +2209,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 1198c76392..0d621670c7 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/tcg-target.inc.c @@ -855,7 +855,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) { @@ -888,6 +888,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 68d86361e2..3ef4d3478d 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -109,10 +109,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)