From patchwork Wed Feb 17 20:20:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 383912 Delivered-To: patch@linaro.org Received: by 2002:a02:c80e:0:0:0:0:0 with SMTP id p14csp3143110jao; Wed, 17 Feb 2021 13:19:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxa0GBS4yxELivI8pNP9CMx8uzFQU9HWbr+jandkjBXP6ng4ed1Lvx5kZnmQ7KBx0y+FJrR X-Received: by 2002:a5b:488:: with SMTP id n8mr2168498ybp.224.1613596787763; Wed, 17 Feb 2021 13:19:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613596787; cv=none; d=google.com; s=arc-20160816; b=m6quySxdeqwDf+Rf2hxZyR7vUhzV5u9RqebGcGfLnXq/zWyK4GKKjUJZ7P3MXYMLt8 p3Bq03ypwCgMTZCoJJV4n5SVMVIRvOvDndLeqQPjJgRQ5EAAmivwJq/vYzZPkILys59b SokvJJlzJ1EbN8zMGMhM2hO4Nn+NZHzoFP8jBunwOP/bO8kYxHNPvioTlZdZZH9Ohq3E CxilcTs19B/jlUdWngQa98QNLxxTXYbHyFSp4JY99Z8dvxxPlRuqmewnQHxHEw59p4uf r2DwNfxD7ZNVhupcpbt49PHpNS8BJ6mMda36Eyxw93b8TmW6EKF33mIH++4/AfVxhGDE oNpQ== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=8UhCzfaKYlwmE690TaVTdGnsli7nQ9Ath2fy3ZA2wa8=; b=px558AofyEpmWNcK1DE8uKqeEhsNXOSQ8Ku0k6XU5rmxk6fgyEOWlqmpFqkYvu+eB3 MZfB0lLIArIUzjAPPrTDI+X61ImuRuJEYnAaKulh6y5VB0KlRM1iwait8opckvf5JNVG XGmPrV1t+fNe7iMQ37sLn1fOtVkWnSsJXrhggUmzc/Y+vNvWvGnt0yK98KfIkaZgn4H3 qFkZCE+pUy9GL3lHqovuDh0qXxrDqAi7jB/5yuMN6c2fwshBrov5z7QCCERGYcyisNqt 8n0hUxNe66IFLovMFiS67ut6tDJnufoAmcfysVKYS9CAPYsJatXGOS4WjRPa9j1CVMCb +a1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=AP3b9Fxb; 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 u4si3745141ybp.232.2021.02.17.13.19.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Feb 2021 13:19:47 -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=AP3b9Fxb; 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 ([::1]:49838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCUEd-0001Qh-3m for patch@linaro.org; Wed, 17 Feb 2021 16:19:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCTMz-0001z6-U0 for qemu-devel@nongnu.org; Wed, 17 Feb 2021 15:24:22 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]:54573) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lCTMx-0007ln-1P for qemu-devel@nongnu.org; Wed, 17 Feb 2021 15:24:21 -0500 Received: by mail-pj1-x1034.google.com with SMTP id gb24so2147311pjb.4 for ; Wed, 17 Feb 2021 12:24:18 -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 :mime-version:content-transfer-encoding; bh=8UhCzfaKYlwmE690TaVTdGnsli7nQ9Ath2fy3ZA2wa8=; b=AP3b9FxbA0Vkh8EdThmuZDPiknz3Nl/Lig36mk3YIOaZ0ATiXMcQ5AY3c8Bo7ya+30 /SBoMDyISVQXRDTOrJzWF+LqlPKlU+K4Z8ddkbi7HI8639XcBKSemww3g7DXcWy9swmF +Kp2mKpJzbfadj7VCSMduNdV7YD4OPclFSPfKw90sCKg3D86rqHRXjyMf60MF3NOMtO/ SWbQC/FWOKczJMxfaZ/MwEk8iQ4tA4+dOo+O0XrUEbJj6IT8p9N4qUqxNQHimjdO0Me5 lg8wwOoil+UsGGXCghEbJLA7jUNXqTr8q9TS4/KAgXhSYmIy+9XVtXdKGEDQ0B7A53Jr xkbQ== 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:mime-version:content-transfer-encoding; bh=8UhCzfaKYlwmE690TaVTdGnsli7nQ9Ath2fy3ZA2wa8=; b=ib+dR3iSsRf4hzyG+gQ16Hda9J1FuV0W/tsNuI4ydrdfHggGjIH4tazNs//3J+0qaM HfLpJPZRrAfT5R78H52NaSun1gtsouxrqW9NB5aGE6dRmEaqy2zbfft00rpy1fsnh/sw vgGahF4uD6rEBw86V4Qnt940RJnvacAW8FYP+QRFeXNNLQVzLo/wN71Z7LmN1n4uVn3V ArfuPHbxZlkkskEsYgXBxnbrhGk3lZqTJJVzIifJTkp4CmSwqKo5YyIgwpX83Dr1pViv ZVFYNvQ+MN2AeWTx5XT7viJY0knqEUVdHleBWSftKJWczjZ9MyTAAUAiroSYBVc1685w o30Q== X-Gm-Message-State: AOAM532QSU/APEkBrykenpO3OZFbCJxP8uqp5jE3FwPdDUBTZ+HsrOcT ux3LTClr1faJpcJvFHrWIC9osFDo5N7E/g== X-Received: by 2002:a17:902:d48b:b029:e1:f87:265d with SMTP id c11-20020a170902d48bb02900e10f87265dmr669310plg.1.1613593457668; Wed, 17 Feb 2021 12:24:17 -0800 (PST) Received: from localhost.localdomain (047-051-160-125.biz.spectrum.com. [47.51.160.125]) by smtp.gmail.com with ESMTPSA id v126sm3232038pfv.163.2021.02.17.12.24.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 12:24:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 64/71] tcg/tci: Implement andc, orc, eqv, nand, nor Date: Wed, 17 Feb 2021 12:20:29 -0800 Message-Id: <20210217202036.1724901-65-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210217202036.1724901-1-richard.henderson@linaro.org> References: <20210217202036.1724901-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sw@weilnetz.de, alex.bennee@linaro.org, f4bug@amsat.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" These were already present in tcg-target.c.inc, but not in the interpreter. Signed-off-by: Richard Henderson --- tcg/tci/tcg-target.h | 20 ++++++++++---------- tcg/tci.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 10 deletions(-) -- 2.25.1 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index f53773a555..5945272a43 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -67,20 +67,20 @@ #define TCG_TARGET_HAS_ext16s_i32 1 #define TCG_TARGET_HAS_ext8u_i32 1 #define TCG_TARGET_HAS_ext16u_i32 1 -#define TCG_TARGET_HAS_andc_i32 0 +#define TCG_TARGET_HAS_andc_i32 1 #define TCG_TARGET_HAS_deposit_i32 1 #define TCG_TARGET_HAS_extract_i32 0 #define TCG_TARGET_HAS_sextract_i32 0 #define TCG_TARGET_HAS_extract2_i32 0 -#define TCG_TARGET_HAS_eqv_i32 0 -#define TCG_TARGET_HAS_nand_i32 0 -#define TCG_TARGET_HAS_nor_i32 0 +#define TCG_TARGET_HAS_eqv_i32 1 +#define TCG_TARGET_HAS_nand_i32 1 +#define TCG_TARGET_HAS_nor_i32 1 #define TCG_TARGET_HAS_clz_i32 0 #define TCG_TARGET_HAS_ctz_i32 0 #define TCG_TARGET_HAS_ctpop_i32 0 #define TCG_TARGET_HAS_neg_i32 1 #define TCG_TARGET_HAS_not_i32 1 -#define TCG_TARGET_HAS_orc_i32 0 +#define TCG_TARGET_HAS_orc_i32 1 #define TCG_TARGET_HAS_rot_i32 1 #define TCG_TARGET_HAS_movcond_i32 1 #define TCG_TARGET_HAS_muls2_i32 0 @@ -108,16 +108,16 @@ #define TCG_TARGET_HAS_ext8u_i64 1 #define TCG_TARGET_HAS_ext16u_i64 1 #define TCG_TARGET_HAS_ext32u_i64 1 -#define TCG_TARGET_HAS_andc_i64 0 -#define TCG_TARGET_HAS_eqv_i64 0 -#define TCG_TARGET_HAS_nand_i64 0 -#define TCG_TARGET_HAS_nor_i64 0 +#define TCG_TARGET_HAS_andc_i64 1 +#define TCG_TARGET_HAS_eqv_i64 1 +#define TCG_TARGET_HAS_nand_i64 1 +#define TCG_TARGET_HAS_nor_i64 1 #define TCG_TARGET_HAS_clz_i64 0 #define TCG_TARGET_HAS_ctz_i64 0 #define TCG_TARGET_HAS_ctpop_i64 0 #define TCG_TARGET_HAS_neg_i64 1 #define TCG_TARGET_HAS_not_i64 1 -#define TCG_TARGET_HAS_orc_i64 0 +#define TCG_TARGET_HAS_orc_i64 1 #define TCG_TARGET_HAS_rot_i64 1 #define TCG_TARGET_HAS_movcond_i64 1 #define TCG_TARGET_HAS_muls2_i64 0 diff --git a/tcg/tci.c b/tcg/tci.c index 2391dd4d3b..02fad3370d 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -530,6 +530,36 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env, tci_args_rrr(insn, &r0, &r1, &r2); regs[r0] = regs[r1] ^ regs[r2]; break; +#if TCG_TARGET_HAS_andc_i32 || TCG_TARGET_HAS_andc_i64 + CASE_32_64(andc) + tci_args_rrr(insn, &r0, &r1, &r2); + regs[r0] = regs[r1] & ~regs[r2]; + break; +#endif +#if TCG_TARGET_HAS_orc_i32 || TCG_TARGET_HAS_orc_i64 + CASE_32_64(orc) + tci_args_rrr(insn, &r0, &r1, &r2); + regs[r0] = regs[r1] | ~regs[r2]; + break; +#endif +#if TCG_TARGET_HAS_eqv_i32 || TCG_TARGET_HAS_eqv_i64 + CASE_32_64(eqv) + tci_args_rrr(insn, &r0, &r1, &r2); + regs[r0] = ~(regs[r1] ^ regs[r2]); + break; +#endif +#if TCG_TARGET_HAS_nand_i32 || TCG_TARGET_HAS_nand_i64 + CASE_32_64(nand) + tci_args_rrr(insn, &r0, &r1, &r2); + regs[r0] = ~(regs[r1] & regs[r2]); + break; +#endif +#if TCG_TARGET_HAS_nor_i32 || TCG_TARGET_HAS_nor_i64 + CASE_32_64(nor) + tci_args_rrr(insn, &r0, &r1, &r2); + regs[r0] = ~(regs[r1] | regs[r2]); + break; +#endif /* Arithmetic operations (32 bit). */ @@ -1120,6 +1150,16 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info) case INDEX_op_or_i64: case INDEX_op_xor_i32: case INDEX_op_xor_i64: + case INDEX_op_andc_i32: + case INDEX_op_andc_i64: + case INDEX_op_orc_i32: + case INDEX_op_orc_i64: + case INDEX_op_eqv_i32: + case INDEX_op_eqv_i64: + case INDEX_op_nand_i32: + case INDEX_op_nand_i64: + case INDEX_op_nor_i32: + case INDEX_op_nor_i64: case INDEX_op_div_i32: case INDEX_op_div_i64: case INDEX_op_rem_i32: