From patchwork Thu Mar 7 14:41:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 10843133 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2B2CE1575 for ; Thu, 7 Mar 2019 15:15:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 163C928D59 for ; Thu, 7 Mar 2019 15:15:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AC5E2E2E1; Thu, 7 Mar 2019 15:15:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9EAE828D59 for ; Thu, 7 Mar 2019 15:15:47 +0000 (UTC) Received: from localhost ([127.0.0.1]:53130 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1uP6-0007hv-49 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 07 Mar 2019 09:53:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1uDI-0006nU-MS for qemu-devel@nongnu.org; Thu, 07 Mar 2019 09:41:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1uDH-0003WP-Sb for qemu-devel@nongnu.org; Thu, 07 Mar 2019 09:41:36 -0500 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]:33419) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1uDH-0003Ve-Ko for qemu-devel@nongnu.org; Thu, 07 Mar 2019 09:41:35 -0500 Received: by mail-pf1-x443.google.com with SMTP id i19so11590946pfd.0 for ; Thu, 07 Mar 2019 06:41:35 -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=s0qTRbXmiKKgECm+6qdf0NYhapsmzFo3yJBCyUawoJ4=; b=ukLjx2DZyrDY/UgHJKXs1UxOl3wto3mXk2AMYf5zQgO5H9+nEJNNVgs7Od6UJTsJ9E G3UDqkQVzgkavmE6vWcaOX47I6ulRHwOdGhVYYqF3ri4hNga4Y4dfEMuxk5vhZz2Y8Xn vkEIH37Z/RK09sN9352NRME1m++2PEWGQ0J7Qatc52rC7AkidPp8pME2xGy7D++95B5v 3GU/VRFZerJdWYRaPxExCYtXzMRmPEmW0vdvJklIVzrxmeryfNCT+PLRL0kql5+ruPxx l8gkj9DuJ4Lte3miwQuE19jwkdgW+kjeiwAtBZGArS1LmTSZYLOauv5N/lqUlz/aHS0C lfPQ== 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=s0qTRbXmiKKgECm+6qdf0NYhapsmzFo3yJBCyUawoJ4=; b=k+KBRAAQyx6HW6oM/PkzgkvqjKTBzxZYcNLZPwoxlPROcdPaogX0FT8uRp6sWd+z3y vofQm2zjJxQbGg/wBJEJE3GE4+SUOZ43Il1zfYXwK04wwb9Q9+ZLWQGqi+zTLvcTwia6 IrnzUpV27x1TXfZmOk/HPDIJgK/7qhGj0Fpoqlg7TN6te2zlI/E9HGG4Ai7quzNmw8K4 6KgDyZM2r8+tJTtuHYuc6FJY2F817WH78RNZ6znvz0FM8KhWeOdCTAzxJdNEeEqra98k 5MzqodSaX5OlXmLzAGKxSbEP5pG5JUEkhYGToG3BybHXFgMz+MR4zXJRZcEAGxx4Z7Ly 1bMg== X-Gm-Message-State: APjAAAWCxRAv8n3dLLp+jHrlOfoXb5fs2coPTF8x8PHoz23JgBKvSk02 R+hUn+XSRfRXyFOtm87K6r2PxLtRFSQ= X-Google-Smtp-Source: APXvYqxpqThtFSRo6DNeAaxk4KpAOMGwxhztVIaZq5UZwf+sZ1NB+0Rc8zt9xX1kMHmgPhRf5CHpaA== X-Received: by 2002:a63:1616:: with SMTP id w22mr11618882pgl.200.1551969694258; Thu, 07 Mar 2019 06:41:34 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id p2sm6222838pgs.7.2019.03.07.06.41.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2019 06:41:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 06:41:22 -0800 Message-Id: <20190307144126.31847-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190307144126.31847-1-richard.henderson@linaro.org> References: <20190307144126.31847-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::443 Subject: [Qemu-devel] [PATCH 5/9] tcg/i386: Support INDEX_op_extract2_{i32, i64} 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: david@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.h | 4 ++-- tcg/i386/tcg-target.inc.c | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index 2c58eaa9ed..241bf19413 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -124,7 +124,7 @@ extern bool have_avx2; #define TCG_TARGET_HAS_deposit_i32 1 #define TCG_TARGET_HAS_extract_i32 1 #define TCG_TARGET_HAS_sextract_i32 1 -#define TCG_TARGET_HAS_extract2_i32 0 +#define TCG_TARGET_HAS_extract2_i32 1 #define TCG_TARGET_HAS_movcond_i32 1 #define TCG_TARGET_HAS_add2_i32 1 #define TCG_TARGET_HAS_sub2_i32 1 @@ -163,7 +163,7 @@ extern bool have_avx2; #define TCG_TARGET_HAS_deposit_i64 1 #define TCG_TARGET_HAS_extract_i64 1 #define TCG_TARGET_HAS_sextract_i64 0 -#define TCG_TARGET_HAS_extract2_i64 0 +#define TCG_TARGET_HAS_extract2_i64 1 #define TCG_TARGET_HAS_movcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 #define TCG_TARGET_HAS_sub2_i64 1 diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c index e0670e5098..1fa833840e 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/tcg-target.inc.c @@ -452,6 +452,7 @@ static inline int tcg_target_const_match(tcg_target_long val, TCGType type, #define OPC_SHUFPS (0xc6 | P_EXT) #define OPC_SHLX (0xf7 | P_EXT38 | P_DATA16) #define OPC_SHRX (0xf7 | P_EXT38 | P_SIMDF2) +#define OPC_SHRD_Ib (0xac | P_EXT) #define OPC_TESTL (0x85) #define OPC_TZCNT (0xbc | P_EXT | P_SIMDF3) #define OPC_UD2 (0x0b | P_EXT) @@ -2587,6 +2588,12 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc, } break; + OP_32_64(extract2): + /* Note that SHRD outputs to the r/m operand. */ + tcg_out_modrm(s, OPC_SHRD_Ib + rexw, a2, a0); + tcg_out8(s, args[3]); + break; + case INDEX_op_mb: tcg_out_mb(s, a0); break; @@ -2845,6 +2852,7 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode op) static const TCGTargetOpDef r_0 = { .args_ct_str = { "r", "0" } }; static const TCGTargetOpDef r_r_ri = { .args_ct_str = { "r", "r", "ri" } }; static const TCGTargetOpDef r_r_re = { .args_ct_str = { "r", "r", "re" } }; + static const TCGTargetOpDef r_0_r = { .args_ct_str = { "r", "0", "r" } }; static const TCGTargetOpDef r_0_re = { .args_ct_str = { "r", "0", "re" } }; static const TCGTargetOpDef r_0_ci = { .args_ct_str = { "r", "0", "ci" } }; static const TCGTargetOpDef r_L = { .args_ct_str = { "r", "L" } }; @@ -2970,6 +2978,9 @@ static const TCGTargetOpDef *tcg_target_op_def(TCGOpcode op) case INDEX_op_ctpop_i32: case INDEX_op_ctpop_i64: return &r_r; + case INDEX_op_extract2_i32: + case INDEX_op_extract2_i64: + return &r_0_r; case INDEX_op_deposit_i32: case INDEX_op_deposit_i64: