From patchwork Wed Aug 23 20:23:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 716115 Delivered-To: patch@linaro.org Received: by 2002:adf:f747:0:b0:317:ecd7:513f with SMTP id z7csp1002776wrp; Wed, 23 Aug 2023 13:27:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGiHYhg2okEMR6YD8xZIXdYYrvXs6RBOItXPEL+217pmYfpkTmMSz3sL46+RE9H/p6XjFc0 X-Received: by 2002:a0c:f0c8:0:b0:64f:5d57:b6be with SMTP id d8-20020a0cf0c8000000b0064f5d57b6bemr2452634qvl.21.1692822439398; Wed, 23 Aug 2023 13:27:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692822439; cv=none; d=google.com; s=arc-20160816; b=dx0cAvoVoR4jAwa5HT7roHt5ACsAben7wzY4l2RFRAYPLFJHkT3mvLXGe9KirQ0VxJ tBOzXzOcI92ZwPtj5/kXcYXbmAHlSOBjc8tk7zB2capyWqCRV1pUo4KxhfjfVHR398Lu q2HrbdK4suJgF632tLRLerjgNAdvyUsI1R6mmaDngWprauVxeh5XHAvg9JMmVDqWaz1J nxhbcCTLiqbu3NqJUaQ8/z5P3eIDugwfDgxve904ugofvUASfp6GN6oSTjVpooM9RwlB ir22UItCRz+8rs2vfp0gEgpxLv3FWbM+wz1phC0/BRxynjxSdnSFTQxm46uW7gRlqyEM J9Lg== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=D7NIoRhXITmVWSRN6hbMfoA30tKZp5gKe/MKfIU5oaA=; fh=iKWO5kImkBaf5P/04M2d2o+fJodoyCg8YLKe8/cbiwg=; b=DhrmV1zU60LBUlznz1E3mQ7z9HTkd2kfm+Z3j2EBe1UVxZhYLmpcernzeLx2uR8tFS Ebz7RV4tC5jDjhNbhkQnW5BylJ5d1UNOTqb6h9FQn4fQfQ6SzlNQdu0hNsOFrvwdVz1Z 6O9PTcqjOwkhI4iLngU9da20gQXXdrQxtn3XN/xeego7vvXBWHoHYrPM63cm176gbqaR dG9GKczCw/rSkFzPe8AmLwi2RzDenaVjDIJzC54Dit8+dQ99C6dgvHrQL3YXyzwn/9vJ VjL/o1J1J6tOpPW01U+WBJCqrq3La5sMHevNagtZhp10hSI22CFSt91tFdJC2yJKjFh1 +l+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vNpyvuQC; 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=pass (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 a21-20020a0ca995000000b0064f47af2650si3511268qvb.34.2023.08.23.13.27.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Aug 2023 13:27:19 -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=pass header.i=@linaro.org header.s=google header.b=vNpyvuQC; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOk-0000Qk-Qs; Wed, 23 Aug 2023 16:24:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYuOb-0008RA-84 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:05 -0400 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOW-0005Vk-Sq for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:04 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1bd9b4f8e0eso40226145ad.1 for ; Wed, 23 Aug 2023 13:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822233; x=1693427033; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=D7NIoRhXITmVWSRN6hbMfoA30tKZp5gKe/MKfIU5oaA=; b=vNpyvuQCKkCNwxgHHz1aVZz56q4+lzC6GSnOpRx2Wu/SFkI26j4+3jW0AIqTZthd0F +oC1IIpzn19jk41D+3Pu0pt7Q/dLlNBAHMsSl0+7AslJIzVS+T4aUkJpz4I1qYVe7UwS TXPrVgsD0G8KQnobmpXXIzB2kG6TQgeh0q48Uez2926PC0DR3dtJFaNgGFOwbIDrDG/x mO+ivJR9rZiisdKWV+JcgX6507TZhjOv/itjPzaf5FOFNOza9hxEszt8X1iM2IEEBW59 P60g8hp2hoimEvCQpYXynRPXZtEGYHmgpsCndZ34aDma08hA3jbFg+Gz7SyVyE5HoxyF 0RFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822233; x=1693427033; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D7NIoRhXITmVWSRN6hbMfoA30tKZp5gKe/MKfIU5oaA=; b=j7GyquiYYUwv6gFP5n3DYX7AITiXYyCmUhUDfUDgJdv6ovJn1sLH95tjfwwzwxOg+o Wz0/mgDl1fGeZ8hm90Di6gA+dmqi9pT2abGGNt9dcyVrOIdt1KsFiPBuvQGzLC+Zsr5U oGvXuMkgNxddQYpXKnZlDpJwZmCqD1dY+hiO4OsGqxz8IojA9PEy8EkzypMYSCBrtWrn MeCn5p3xpnYa+ck36LYz9Dyqw3V40sDBckse+Eae4/KDEd5OoAmDyobhMUcaP1SU7hTv wAS+u/sMK1xLXXf2RGVcOqCgN8WiF3U5tjF6OPo0MFCdjirSP4TFpQJECnnLqIzCprls ujJA== X-Gm-Message-State: AOJu0YwjnqgMBY403Z9RO9N4b1p+H+scI4Ib9GuL8zrOsPhWEvUnrI0S PPYU3JLWblwqKJlR72bZGbTI7cqdZ0NTHOAbX6o= X-Received: by 2002:a17:902:f54f:b0:1bd:f1ae:309d with SMTP id h15-20020a170902f54f00b001bdf1ae309dmr12547544plf.9.1692822232680; Wed, 23 Aug 2023 13:23:52 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:72f0:1ea7:85d2:141e]) by smtp.gmail.com with ESMTPSA id iz22-20020a170902ef9600b001b9da42cd7dsm11418641plb.279.2023.08.23.13.23.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:52 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 27/48] tcg/aarch64: Implement negsetcond_* Date: Wed, 23 Aug 2023 13:23:05 -0700 Message-Id: <20230823202326.1353645-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230823202326.1353645-1-richard.henderson@linaro.org> References: <20230823202326.1353645-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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.29 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-bounces+patch=linaro.org@nongnu.org Trivial, as aarch64 has an instruction for this: CSETM. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.h | 4 ++-- tcg/aarch64/tcg-target.c.inc | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index bfa3e5aae9..98727ea53b 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -86,7 +86,7 @@ typedef enum { #define TCG_TARGET_HAS_sextract_i32 1 #define TCG_TARGET_HAS_extract2_i32 1 #define TCG_TARGET_HAS_movcond_i32 1 -#define TCG_TARGET_HAS_negsetcond_i32 0 +#define TCG_TARGET_HAS_negsetcond_i32 1 #define TCG_TARGET_HAS_add2_i32 1 #define TCG_TARGET_HAS_sub2_i32 1 #define TCG_TARGET_HAS_mulu2_i32 0 @@ -123,7 +123,7 @@ typedef enum { #define TCG_TARGET_HAS_sextract_i64 1 #define TCG_TARGET_HAS_extract2_i64 1 #define TCG_TARGET_HAS_movcond_i64 1 -#define TCG_TARGET_HAS_negsetcond_i64 0 +#define TCG_TARGET_HAS_negsetcond_i64 1 #define TCG_TARGET_HAS_add2_i64 1 #define TCG_TARGET_HAS_sub2_i64 1 #define TCG_TARGET_HAS_mulu2_i64 0 diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 35ca80cd56..7d8d114c9e 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -2262,6 +2262,16 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, TCG_REG_XZR, tcg_invert_cond(args[3])); break; + case INDEX_op_negsetcond_i32: + a2 = (int32_t)a2; + /* FALLTHRU */ + case INDEX_op_negsetcond_i64: + tcg_out_cmp(s, ext, a1, a2, c2); + /* Use CSETM alias of CSINV Wd, WZR, WZR, invert(cond). */ + tcg_out_insn(s, 3506, CSINV, ext, a0, TCG_REG_XZR, + TCG_REG_XZR, tcg_invert_cond(args[3])); + break; + case INDEX_op_movcond_i32: a2 = (int32_t)a2; /* FALLTHRU */ @@ -2868,6 +2878,8 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpcode op) case INDEX_op_sub_i64: case INDEX_op_setcond_i32: case INDEX_op_setcond_i64: + case INDEX_op_negsetcond_i32: + case INDEX_op_negsetcond_i64: return C_O1_I2(r, r, rA); case INDEX_op_mul_i32: