From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822490; cv=none; d=zohomail.com; s=zohoarc; b=PY2k7RVOytb+XxMf3D2BcvAcS2WcNJZ9ErC4o0BI8l8lgUjn87F+KRmhg/6+K6LBx9FHqXYWoNwAWJ7pnynl69Ai3ha98/+MHY1h/UXai4sgH/aYqlyVFXG4h0X+3CPdE0ymg2L/FSv7sLxd0GpMzxU+d5/yi6w3N32nIZA0cMw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822490; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Sag9wYjn+T6sNPgSHmtKDLhQdqb9BHIQ8q3YF6+2bV0=; b=VBDmVUsdQbozjnxk5ohO+uF0SgpYA0As+RJEPawaeE+OtxYNEj1LLOdQ7wWOQWFvE2EbWYTyg+vU+bg4hzOpwU+Y80k46yxg2usIS3tucOUdteeECmqhRZ3U+MIKhiI39XnOn2wPO/yQPFeOaA63mi4fBIKCauAQDKqLe19L8GI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822490236641.5311133323082; Wed, 23 Aug 2023 13:28:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOj-0000K5-4m; Wed, 23 Aug 2023 16:24:13 -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 1qYuOT-0008KA-4k for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:58 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOB-0005TM-VO for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:49 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1bda9207132so48316985ad.0 for ; Wed, 23 Aug 2023 13:23:30 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822209; x=1693427009; 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=Sag9wYjn+T6sNPgSHmtKDLhQdqb9BHIQ8q3YF6+2bV0=; b=C0qtO0Kl87dxlFvgLLgkHnHWv/+fc9hWcETKjsH8OsH5clCkBhGvwA6ebOLqpnquks ZqPHevlc4ZrnvE17BUw2TNXUv0IXsav/yUYGGB7USqoYfexhfjiCXkMfuqlXDQ77ozt0 I9OxF71hulGYdGxMzqkyfHT4gJGk7b8J/KvgsD4u70HjXGiZBxmaIoqegGAwLWsOhSgz KoNzbjwIxFGCPEKTWbT7ayR7bk9nVL44VYpThqAYNlUzKyjywn1OT5uRX5dtDdpMGokm FkCzoAjKSFq/R8yI/PnaA8RMdMNian1/+KOa9MKFTviEIJxKi/NoqmnK3XMPPjYZ9Ooz kcwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822209; x=1693427009; 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=Sag9wYjn+T6sNPgSHmtKDLhQdqb9BHIQ8q3YF6+2bV0=; b=Fk7OeTr1Xe1eKNEt7EH57u/o9udeZrOMdB1vbg1/5Z5N589XXbOarnVMYP6W3FrAqI fc9zo3v3NmEbG/Tp0hPKFUBo4yT4Jnv1NLq4EnwU9EOzPnkzDiJxMFbJ59TuidQj5h30 PDU3tPdGUWmpWA/WODfyGcCpn+C8tD0RcIcC5HXYJtQZ2fbvepOrHw64qi2H8LD/9gZ0 2uVR2HQgmHyewRu5ru3IB3+eeNL+GkKdHqizeJWmtJYLpNNwRyruEg5330M02CpXTAom qw2lu1FVfKMJGRFx0lwlW12kgrWhTttO9s3X2NZTvl232ULe+3SyT/DeOmUXB1dO3RAa CTFw== X-Gm-Message-State: AOJu0YwNw4uDVZ6++cI22Af7GkercRMm/RwiMbGz9JZxN9FsOJhAer5m bDhCaXwhaTXGy2Vws6+2eYmgLfHbMaKnz00CbW8= X-Google-Smtp-Source: AGHT+IHC8HZrtrwH6/j7XsTNIUtChh7IgdZVeZ4/mdW6xqcDf/lA9oukib11xg03tEyrKBh7PcPCaw== X-Received: by 2002:a17:902:c20d:b0:1c0:bf62:c921 with SMTP id 13-20020a170902c20d00b001c0bf62c921mr908199pll.18.1692822209146; Wed, 23 Aug 2023 13:23:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 01/48] accel/kvm: Widen pc/saved_insn for kvm_sw_breakpoint Date: Wed, 23 Aug 2023 13:22:39 -0700 Message-Id: <20230823202326.1353645-2-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822490623100001 Content-Type: text/plain; charset="utf-8" From: Anton Johansson via Widens the pc and saved_insn fields of kvm_sw_breakpoint from target_ulong to vaddr. The pc argument of kvm_find_sw_breakpoint is also widened to match. Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson Message-Id: <20230807155706.9580-2-anjo@rev.ng> Signed-off-by: Richard Henderson --- include/sysemu/kvm.h | 6 +++--- accel/kvm/kvm-all.c | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 115f0cca79..5670306dbf 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -411,14 +411,14 @@ struct kvm_guest_debug; struct kvm_debug_exit_arch; =20 struct kvm_sw_breakpoint { - target_ulong pc; - target_ulong saved_insn; + vaddr pc; + vaddr saved_insn; int use_count; QTAILQ_ENTRY(kvm_sw_breakpoint) entry; }; =20 struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *cpu, - target_ulong pc); + vaddr pc); =20 int kvm_sw_breakpoints_active(CPUState *cpu); =20 diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 7b3da8dc3a..76a6d91d15 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -3306,8 +3306,7 @@ bool kvm_arm_supports_user_irq(void) } =20 #ifdef KVM_CAP_SET_GUEST_DEBUG -struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *cpu, - target_ulong pc) +struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *cpu, vaddr pc) { struct kvm_sw_breakpoint *bp; =20 --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822421; cv=none; d=zohomail.com; s=zohoarc; b=e04hIVjsT5DLMIRCGqkHtu2/4fqAjTvMGwZwtjtFZq+Nw86WOI8KF1UysJPPemNcjQiKcMQXZHx5RNfgpinaAASxgwdyUEu6q8tqvfiPjtIw4q8agS1AzwVo4oJPU0Yyw56JTydXgudT5X6j2xzMi757RpdNDvv3fGVEXySlbrM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822421; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7loHC2CVphFZ2VQ7U0c6/4a/FgpsUAqIthrt73VkroA=; b=NHvnlsS4OvTlIIJomtfI/+IKTwTwkRQQWtNCKPlRrvucqAxD0qpYIyvR0ZV5E/ZEyzSIeJHTcxKYQFSg1pgY+kk3O/wqz5DlqyEIwphVxQkb2akYJjtRZomcsgYxhIww+lokk+3F5ikunQ/8f1N3QHmTtpndwRyxSiqAYAdljWs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169282242178153.77072947278907; Wed, 23 Aug 2023 13:27:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOh-0000Hs-EO; Wed, 23 Aug 2023 16:24:11 -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-0008RG-8p for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:05 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOV-0005TU-HU for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:03 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1c0bae4da38so1811355ad.0 for ; Wed, 23 Aug 2023 13:23:31 -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.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822210; x=1693427010; 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=7loHC2CVphFZ2VQ7U0c6/4a/FgpsUAqIthrt73VkroA=; b=cYZgAojiow4xVWv/z2SVJh+VLAZOSqqFfQ1VjrL98S57l3b9h9VW7krFosgfwjPx0o MPF5CxUAoj6A3B6YQZga3i2UJrZE3Tahb7KkrxsEUyZDsSdwBHSt18AYFy0RHYNOY3J1 UB7A+z6tXni0BcHeWO80lX492dntN29F2Vuhg0R7EoqG2PGVyjzsOULf3YnW0LZJBIX0 Z78VadbZGz8Ugdd34ZRW/QvV/dRUBDQEs+YMFEG0kiYejfVj+dZ1drDDKGNf58KP1Hws +KZqbTXH8VKn1LmkLNd0zlOoZU37FiIKwHvSioAfoXcy2Vjeda9MpFm3jmV/CHBvTo3O arzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822210; x=1693427010; 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=7loHC2CVphFZ2VQ7U0c6/4a/FgpsUAqIthrt73VkroA=; b=Sf7nK5C8JZLUqkKLFWMYtBioYaIXTXYYq/vXryxrtDIHFlvmlu6IFpBwRS9gLSMJBa ChMHIbt5sE4i6w32HfZRa2g9c1umY9xnzuybCFdBL/YMSBGdQ0L0+6EDJraYJ30Koyje QUkhmChzHPJl5O+ns/WJaCn+P3GIWyzw/fyoJcr3CiDicroyj0mrlQpm55tKxuy0ZC8B HjallWT6d951E9SSJFSmai2EhL9If1Y9zhRw3mNZytzW3nsfQ+5PU06fskpIlab1hnG3 bseSAZfQD/AMIRYvhPhkMaCkabZ9VOr7WklZTb7hdtuqt/SQfOZ0Ru6xLsOtvf7oiF4G 6uKA== X-Gm-Message-State: AOJu0Yz0+bbxElijuoErzazeic83MPjd48scHnfcTUjBV7K3gPURe/7G eZ+PJvyMes+DW8eangC606bAW+X2QhTlQ5cMwAI= X-Google-Smtp-Source: AGHT+IGvOyCGi1lj4ojEgYQaHa5KDLqo1Rr5+yD/oOK8NG/j0knrKoDb3G0mfbh5X/lfw2SWnP5TEQ== X-Received: by 2002:a17:902:64cf:b0:1bc:17ab:8d68 with SMTP id y15-20020a17090264cf00b001bc17ab8d68mr16449996pli.16.1692822210001; Wed, 23 Aug 2023 13:23:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 02/48] accel/hvf: Widen pc/saved_insn for hvf_sw_breakpoint Date: Wed, 23 Aug 2023 13:22:40 -0700 Message-Id: <20230823202326.1353645-3-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822423252100002 Content-Type: text/plain; charset="utf-8" From: Anton Johansson via Widens the pc and saved_insn fields of hvf_sw_breakpoint from target_ulong to vaddr. Other hvf_* functions accessing hvf_sw_breakpoint are also widened to match. Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson Message-Id: <20230807155706.9580-3-anjo@rev.ng> Signed-off-by: Richard Henderson --- include/sysemu/hvf.h | 6 +++--- accel/hvf/hvf-accel-ops.c | 4 ++-- accel/hvf/hvf-all.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/sysemu/hvf.h b/include/sysemu/hvf.h index 70549b9158..4cbae87ced 100644 --- a/include/sysemu/hvf.h +++ b/include/sysemu/hvf.h @@ -39,14 +39,14 @@ DECLARE_INSTANCE_CHECKER(HVFState, HVF_STATE, =20 #ifdef NEED_CPU_H struct hvf_sw_breakpoint { - target_ulong pc; - target_ulong saved_insn; + vaddr pc; + vaddr saved_insn; int use_count; QTAILQ_ENTRY(hvf_sw_breakpoint) entry; }; =20 struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu, - target_ulong pc); + vaddr pc); int hvf_sw_breakpoints_active(CPUState *cpu); =20 int hvf_arch_insert_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint = *bp); diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index a44cf1c144..3c94c79747 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -474,7 +474,7 @@ static void hvf_start_vcpu_thread(CPUState *cpu) cpu, QEMU_THREAD_JOINABLE); } =20 -static int hvf_insert_breakpoint(CPUState *cpu, int type, hwaddr addr, hwa= ddr len) +static int hvf_insert_breakpoint(CPUState *cpu, int type, vaddr addr, vadd= r len) { struct hvf_sw_breakpoint *bp; int err; @@ -512,7 +512,7 @@ static int hvf_insert_breakpoint(CPUState *cpu, int typ= e, hwaddr addr, hwaddr le return 0; } =20 -static int hvf_remove_breakpoint(CPUState *cpu, int type, hwaddr addr, hwa= ddr len) +static int hvf_remove_breakpoint(CPUState *cpu, int type, vaddr addr, vadd= r len) { struct hvf_sw_breakpoint *bp; int err; diff --git a/accel/hvf/hvf-all.c b/accel/hvf/hvf-all.c index 4920787af6..db05b81be5 100644 --- a/accel/hvf/hvf-all.c +++ b/accel/hvf/hvf-all.c @@ -51,7 +51,7 @@ void assert_hvf_ok(hv_return_t ret) abort(); } =20 -struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu, target_ulo= ng pc) +struct hvf_sw_breakpoint *hvf_find_sw_breakpoint(CPUState *cpu, vaddr pc) { struct hvf_sw_breakpoint *bp; =20 --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822401; cv=none; d=zohomail.com; s=zohoarc; b=cEEzjR87mWg/D08f2f9syR3Z67L8gPpawxsbCp8xIUjU2r8lR0PvQHI8SgobGKqaPw4m3uRzQhgbc89wNdOAUTd/VB/NCQKuFeT2/EFpi67+y3ZMYF7/AzPGRvNfhnXln/vsKE9GFkbQntn+8eRBkICDdaeBu+G/jz0ubRh/LQc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822401; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cSCfZX36SM4x81luXkG6DawpBtd9wgJBICXgd1wDuO8=; b=MkZdyqo+7PZzAuwQx/izMKLQSfBjAGTIuvupms3Tk3uxEZZXRrV0q6vWiyyOPFCsCCjjFtXnYsjV4L/X7h5/EGzRpqEfFLDDHZUgyBQVS3L6PSfZtcD1MODkbVgM0SSRwjtpUUfO8G299fMgkDHa+0tfaGBC/k9mILSQTAoS5o4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822401112606.248672635095; Wed, 23 Aug 2023 13:26:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOe-00008m-8G; Wed, 23 Aug 2023 16:24:08 -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 1qYuOV-0008L1-7v for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:59 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOK-0005TX-OM for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:52 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1bf3a2f44ffso44712445ad.1 for ; Wed, 23 Aug 2023 13:23:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822211; x=1693427011; 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=cSCfZX36SM4x81luXkG6DawpBtd9wgJBICXgd1wDuO8=; b=arWSiKRQoo+s42l/a19OIDtOIWh9F9gmR0fYIgkJKTprTFFwr6zS+QJZaST7ZsVJeD Q5xDwkmTkDs8Hj09mYmiODa5biDP9RljPH6lhhKGr9T0Zb50M9AAtDxILHzTYU3Af086 gc0ChXpPpUfO85PeK7JQqnWV8KhqnJU8yy4MfB/UOkRfd+M4De/8SwkWaQsHqkEd6J27 0iqFg2nF7ziF2VDBWKxZqvvyHB3aT5SVsD4vbS1kJCWsl0NZvzHGYQBaH2VX7xNkq9pl wjHtYE39ODLehgKCHtSdNCfC9slIRUrHyxMhw9ZoGIap3vT9TG5iwpvUE7cWeKdaf+dU GYUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822211; x=1693427011; 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=cSCfZX36SM4x81luXkG6DawpBtd9wgJBICXgd1wDuO8=; b=lCVrp95CSSH7VlrBKHFkxLV0y5bK7MB6cNmHlqjFTx2LtlqW+kstYSV+5xaPbZhpUS 6bcyMAYB1rRBYvSY27fde8Sd35QMu/NEux0bCI8/GfsgnuSW/qCFC3pkMEF7iEykSq+3 Q3ceZ9UDbs3foZqTF0elc/V+CnFAqfWpgn+DJzLk4POaoUCfManCjTK5jJ/1bGcjrhrS CRNlKAqpKkcBRwhIiJ1/oVA0aTJQ0n6ROC80C1K61PzkxCt4l9/iqZoHiTBNRpBEfLnV qz4XnKg9RXBWJnnDt9xtL6BMsLP1ZE00nDSeZub5fLCv7JqAGCJsJJOp1GTmthyDsG8y pfaw== X-Gm-Message-State: AOJu0Yzg3yWXifiu6tcQl/XkAbcXRtzpld/ecVT0FbMiJ2OVft/f27cv i5BYmYWDl99hhieGY2bpvkZ9wlb3k/vRF+1mUQk= X-Google-Smtp-Source: AGHT+IEtavz0SGWIDMMz6sURITUzFBojf6o5EAzd4Zi3ZTTU0fQ4g/wc9brOoJrRIjd772E/Pza0qg== X-Received: by 2002:a17:903:2305:b0:1bf:cdc:f402 with SMTP id d5-20020a170903230500b001bf0cdcf402mr17389974plh.48.1692822210919; Wed, 23 Aug 2023 13:23:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 03/48] sysemu/kvm: Use vaddr for kvm_arch_[insert|remove]_hw_breakpoint Date: Wed, 23 Aug 2023 13:22:41 -0700 Message-Id: <20230823202326.1353645-4-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822402049100001 Content-Type: text/plain; charset="utf-8" From: Anton Johansson via Changes the signature of the target-defined functions for inserting/removing kvm hw breakpoints. The address and length arguments are now of vaddr type, which both matches the type used internally in accel/kvm/kvm-all.c and makes the api target-agnostic. Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson Message-Id: <20230807155706.9580-4-anjo@rev.ng> Signed-off-by: Richard Henderson --- include/sysemu/kvm.h | 6 ++---- target/arm/kvm64.c | 6 ++---- target/i386/kvm/kvm.c | 8 +++----- target/ppc/kvm.c | 13 ++++++------- target/s390x/kvm/kvm.c | 6 ++---- 5 files changed, 15 insertions(+), 24 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 5670306dbf..19d87b20e8 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -426,10 +426,8 @@ int kvm_arch_insert_sw_breakpoint(CPUState *cpu, struct kvm_sw_breakpoint *bp); int kvm_arch_remove_sw_breakpoint(CPUState *cpu, struct kvm_sw_breakpoint *bp); -int kvm_arch_insert_hw_breakpoint(target_ulong addr, - target_ulong len, int type); -int kvm_arch_remove_hw_breakpoint(target_ulong addr, - target_ulong len, int type); +int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type); +int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type); void kvm_arch_remove_all_hw_breakpoints(void); =20 void kvm_arch_update_guest_debug(CPUState *cpu, struct kvm_guest_debug *db= g); diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 94bbd9661f..4d904a1d11 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -49,8 +49,7 @@ void kvm_arm_init_debug(KVMState *s) return; } =20 -int kvm_arch_insert_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type) { switch (type) { case GDB_BREAKPOINT_HW: @@ -65,8 +64,7 @@ int kvm_arch_insert_hw_breakpoint(target_ulong addr, } } =20 -int kvm_arch_remove_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type) { switch (type) { case GDB_BREAKPOINT_HW: diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index ebfaf3d24c..295228cafb 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -4995,7 +4995,7 @@ MemTxAttrs kvm_arch_post_run(CPUState *cpu, struct kv= m_run *run) kvm_rate_limit_on_bus_lock(); } =20 -#ifdef CONFIG_XEN_EMU =20 +#ifdef CONFIG_XEN_EMU /* * If the callback is asserted as a GSI (or PCI INTx) then check if * vcpu_info->evtchn_upcall_pending has been cleared, and deassert @@ -5156,8 +5156,7 @@ static int find_hw_breakpoint(target_ulong addr, int = len, int type) return -1; } =20 -int kvm_arch_insert_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type) { switch (type) { case GDB_BREAKPOINT_HW: @@ -5197,8 +5196,7 @@ int kvm_arch_insert_hw_breakpoint(target_ulong addr, return 0; } =20 -int kvm_arch_remove_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type) { int n; =20 diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index a8a935e267..91e73620d3 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -1444,15 +1444,15 @@ static int find_hw_watchpoint(target_ulong addr, in= t *flag) return -1; } =20 -int kvm_arch_insert_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type) { - if ((nb_hw_breakpoint + nb_hw_watchpoint) >=3D ARRAY_SIZE(hw_debug_poi= nts)) { + const unsigned breakpoint_index =3D nb_hw_breakpoint + nb_hw_watchpoin= t; + if (breakpoint_index >=3D ARRAY_SIZE(hw_debug_points)) { return -ENOBUFS; } =20 - hw_debug_points[nb_hw_breakpoint + nb_hw_watchpoint].addr =3D addr; - hw_debug_points[nb_hw_breakpoint + nb_hw_watchpoint].type =3D type; + hw_debug_points[breakpoint_index].addr =3D addr; + hw_debug_points[breakpoint_index].type =3D type; =20 switch (type) { case GDB_BREAKPOINT_HW: @@ -1488,8 +1488,7 @@ int kvm_arch_insert_hw_breakpoint(target_ulong addr, return 0; } =20 -int kvm_arch_remove_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type) { int n; =20 diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index a9e5880349..1b240fc8de 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c @@ -995,8 +995,7 @@ static int insert_hw_breakpoint(target_ulong addr, int = len, int type) return 0; } =20 -int kvm_arch_insert_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type) { switch (type) { case GDB_BREAKPOINT_HW: @@ -1014,8 +1013,7 @@ int kvm_arch_insert_hw_breakpoint(target_ulong addr, return insert_hw_breakpoint(addr, len, type); } =20 -int kvm_arch_remove_hw_breakpoint(target_ulong addr, - target_ulong len, int type) +int kvm_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type) { int size; struct kvm_hw_breakpoint *bp =3D find_hw_breakpoint(addr, len, type); --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822379; cv=none; d=zohomail.com; s=zohoarc; b=koi4jDPoLScYU4FE4Pv6V8AFfZrczVr29cm8kJyxczE4PN3twrGbGjBK5uas1ee/f9RhI9/GUc0+vF6QTAUAjc/VJ/IrLKKJLFm8jZxoN+DurDQqwehN4pmLX9LqIhTQ2sWEflDvp2ntV50Ooqzbb8ay/a8wZfpnUwFDfDktsYk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822379; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CumRRNy4oJ8v2b9mAzFsvwDx5ATFvQj9a3tTdZCeMgY=; b=EScldiMF+EoIkd2UljIQIcWClPZnGchcoEyL6VM4FsnjjJMiRQY+Icjb5LMjpIqGbdMF/sCorpuOV2UGkH54p/njBh0B+r1NXRy12EWuiNzhHtid+nC6ZZ3yNIsl8QZJhLDx/gvE5ys7rDzexNNvJ+xynIbknz7MNfDIzvVWK4o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822379698216.77407157317566; Wed, 23 Aug 2023 13:26:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOc-0008TG-3N; Wed, 23 Aug 2023 16:24:06 -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 1qYuOV-0008L4-8E for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:59 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOK-0005Te-Tx for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:56 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1bdc19b782aso41149995ad.0 for ; Wed, 23 Aug 2023 13:23:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822211; x=1693427011; 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=CumRRNy4oJ8v2b9mAzFsvwDx5ATFvQj9a3tTdZCeMgY=; b=IBK7O0FZJlTLvn7Bo/q7XODxYtsOqyOH6bq64ko7eRsmU92/tmq0MWOwa/YcYMF8mN JPLbupyEaSDVjxG7u5QRzKeO7o3bEcjNTLKTtjSEd0M/Lesu9BycWI5QWTAa5RlrNQQW Q8l8pbiWeqYc3uCprODQy4ZuCm2l0x+MKMpomLQ42PbhFP68e6eYsK1dkU+aJO8WIxud QjWIqLWniE1pEv73Kv4LHPvgxz2ZMO5X3363sIkAdTfmIMPXd7HbQyEqbbfAc9MDpk5g InqVzAtnyRvF5A1mVpVGIBwov6M7R+FQOyE5w33l3c2mibT4Rjfb4qa+zFhN6QNy51XU eI8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822211; x=1693427011; 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=CumRRNy4oJ8v2b9mAzFsvwDx5ATFvQj9a3tTdZCeMgY=; b=OaiR1JQ+hfZJZ540XNaW8d9OxSgmgOhYGoklD7MKDkKYh59InIriZeDGiAzdPc/kJa LDgMYx7YiBsg0sxMrF3fkOnlpLvIq45bNHSmVS6HRr8laXzYqp70oksj+QX3dYxTLB4/ xPvmBXtnKDNN8Zv4KN/rVob1cep/7vOOOw6i6I4k1ihqjofygfV39EIOtsOGS/WcpcID Lvvix8ZosysJtd4DVJodcUmvWbPoC0ilqSV2U6vjavFWI+mwL0udY7/ogjEi+htyOMJ+ Cf+1F3ZVxs8NqtEG/xf7Q9ns1MnRyHls921yXXemmDSF4LX20HaikqSi9p2npY1J5aaI BxjA== X-Gm-Message-State: AOJu0Yy4vi7lic/et+0iZvf9P1/WUwJaoasX056QWEFn+OaZit4A+Uqb /QNQ1wIytJG5tWNpx/GOtsWOPgdOdF09EjcJIcY= X-Google-Smtp-Source: AGHT+IGsYOvcY82rehuC9G6QEUvnh1Li8ScqD0/9//7HIFFHqdJwqQdrzi5Isui+Cvr44FtUh7My/w== X-Received: by 2002:a17:903:120a:b0:1b7:e86f:7631 with SMTP id l10-20020a170903120a00b001b7e86f7631mr13822817plh.19.1692822211651; Wed, 23 Aug 2023 13:23:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 04/48] sysemu/hvf: Use vaddr for hvf_arch_[insert|remove]_hw_breakpoint Date: Wed, 23 Aug 2023 13:22:42 -0700 Message-Id: <20230823202326.1353645-5-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822381054100003 Content-Type: text/plain; charset="utf-8" From: Anton Johansson via Changes the signature of the target-defined functions for inserting/removing hvf hw breakpoints. The address and length arguments are now of vaddr type, which both matches the type used internally in accel/hvf/hvf-all.c and makes the api target-agnostic. Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson Message-Id: <20230807155706.9580-5-anjo@rev.ng> Signed-off-by: Richard Henderson --- include/sysemu/hvf.h | 6 ++---- target/arm/hvf/hvf.c | 4 ++-- target/i386/hvf/hvf.c | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/sysemu/hvf.h b/include/sysemu/hvf.h index 4cbae87ced..4037cd6a73 100644 --- a/include/sysemu/hvf.h +++ b/include/sysemu/hvf.h @@ -51,10 +51,8 @@ int hvf_sw_breakpoints_active(CPUState *cpu); =20 int hvf_arch_insert_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint = *bp); int hvf_arch_remove_sw_breakpoint(CPUState *cpu, struct hvf_sw_breakpoint = *bp); -int hvf_arch_insert_hw_breakpoint(target_ulong addr, target_ulong len, - int type); -int hvf_arch_remove_hw_breakpoint(target_ulong addr, target_ulong len, - int type); +int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type); +int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type); void hvf_arch_remove_all_hw_breakpoints(void); =20 /* diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 8fce64bbf6..486f90be1d 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -2063,7 +2063,7 @@ int hvf_arch_remove_sw_breakpoint(CPUState *cpu, stru= ct hvf_sw_breakpoint *bp) return 0; } =20 -int hvf_arch_insert_hw_breakpoint(target_ulong addr, target_ulong len, int= type) +int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type) { switch (type) { case GDB_BREAKPOINT_HW: @@ -2077,7 +2077,7 @@ int hvf_arch_insert_hw_breakpoint(target_ulong addr, = target_ulong len, int type) } } =20 -int hvf_arch_remove_hw_breakpoint(target_ulong addr, target_ulong len, int= type) +int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type) { switch (type) { case GDB_BREAKPOINT_HW: diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c index b9cbcc02a8..cb2cd0b02f 100644 --- a/target/i386/hvf/hvf.c +++ b/target/i386/hvf/hvf.c @@ -690,12 +690,12 @@ int hvf_arch_remove_sw_breakpoint(CPUState *cpu, stru= ct hvf_sw_breakpoint *bp) return -ENOSYS; } =20 -int hvf_arch_insert_hw_breakpoint(target_ulong addr, target_ulong len, int= type) +int hvf_arch_insert_hw_breakpoint(vaddr addr, vaddr len, int type) { return -ENOSYS; } =20 -int hvf_arch_remove_hw_breakpoint(target_ulong addr, target_ulong len, int= type) +int hvf_arch_remove_hw_breakpoint(vaddr addr, vaddr len, int type) { return -ENOSYS; } --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822503; cv=none; d=zohomail.com; s=zohoarc; b=OjH3L8cjuQgg1qAL5AFVG6D2bI5RkNhLSFQn22+QuzyMvwJyijTZ2PXosbIm0Eart1ZJtj1jr0SF70WY7eYSh8lPr9i1UFDbFGxl9UlvjYJU5s/c2IimJPlQQnMZfgtjhemc2OYvT6/WZp0BbtV0jok37jT3CbqoN5uJkhf6eSw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822503; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9tQQXOQ1CSwcHY3EnS8b54xsDdXhUgB6voqkuM0gz8A=; b=g4Y6WjlYePUMxlorcz+7EzXipiyviZCgIywrKQulrqxZMjG1Rm7+06nyV+M1L7vjXtQwpzNkZ97T6RML0aiCzRUmcLOviLPTVwmvkc2EFLNbfTrAxwF50fY/IFe2Z8HRuIyjk/VfE9Fkr5QABH4ALKbIseu30jV0TjGQJk5Vytc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822503787523.4938122205394; Wed, 23 Aug 2023 13:28:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOf-0000DX-I9; Wed, 23 Aug 2023 16:24:09 -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-0008RJ-93 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:05 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOU-0005Ti-TQ for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:03 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1bf078d5fb7so41364005ad.0 for ; Wed, 23 Aug 2023 13:23:33 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822213; x=1693427013; 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=9tQQXOQ1CSwcHY3EnS8b54xsDdXhUgB6voqkuM0gz8A=; b=WJCUKIFAqqRCp4VCb0owXwJu6BCFQZciZcTeOHxNZBVepGFsJt5XaPHUVR6ckIu7RO 1gnG+l2q/L0647NNqYNors2g9/tW47HSq1QJeB5PQQV0OFmeRrC9SqN5FXd1d/j0zb/i 9QEjMKHhpuUDO+LRet80i0hITqSC0858+LxzSJIE3xt0nbzytGgRL0V10h9yUFEgvMf4 zFg1f+lmVaj5AF+4tybhbzUNs2oB5H7MxKScmbMn5wMxVksu8dv4EuHKPoZ0pC4ubIsb cXMwGcE8mWGi96kNdkpMYAs+NCpp3Y+iUBOmpha++q4fD5/q05OrbW67r2e68XlLRdwG 6Baw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822213; x=1693427013; 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=9tQQXOQ1CSwcHY3EnS8b54xsDdXhUgB6voqkuM0gz8A=; b=PGJHLYluj34p+3kbmQkaAGbEq6ZzpqjeNrODVuGdeRXjXLqZtN4R2MhiGL3kfstJPb ayDFL8ByeSGv6UmGELUzwIaLXC737YP39pw2kz1zjmg7mUxV62AdrVwwxlHWBU+ePO55 6bEj+1kqePil49l1/EXsoeW/DrqXVTKagHyIv2dr2smNI5a09itnrDPB/Rj0wLCfLxqt DyabjiqTgN7kYFwgKV6dZkS33D5b3vYZQM53X8G2qZv1NcO81gXoigYdICOF5za2/n6K OJ64PSVHBnjSpamoovvS4zd+3foIwKiWVVtLrqmCV1vFe0g6mmNo8AaW4kAzeqhWa3Ih 0Cwg== X-Gm-Message-State: AOJu0YxUp0T0g3HPX0nvJNWsm6o5HvKoO3iw4EgKLPcXEQ5mdqc/skyZ hV8lrRIC1quwaFzp4Zf9rrkIrfg2yFIeXbUTcpM= X-Google-Smtp-Source: AGHT+IG8x/je+rDTdx2qqOAcQzYXsgXqi5kg+tDXa9pxj94zmWGK6By96+nEXXaANXlDreOKafN5Jg== X-Received: by 2002:a17:902:b782:b0:1bf:22b7:86d with SMTP id e2-20020a170902b78200b001bf22b7086dmr10823721pls.3.1692822212824; Wed, 23 Aug 2023 13:23:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 05/48] include/exec: Replace target_ulong with abi_ptr in cpu_[st|ld]*() Date: Wed, 23 Aug 2023 13:22:43 -0700 Message-Id: <20230823202326.1353645-6-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822505790100014 Content-Type: text/plain; charset="utf-8" From: Anton Johansson via Changes the address type of the guest memory read/write functions from target_ulong to abi_ptr. (abi_ptr is currently typedef'd to target_ulong but that will change in a following commit.) This will reduce the coupling between accel/ and target/. Note: Function pointers that point to cpu_[st|ld]*() in target/riscv and target/rx are also updated in this commit. Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson Message-Id: <20230807155706.9580-6-anjo@rev.ng> Signed-off-by: Richard Henderson --- accel/tcg/atomic_template.h | 16 ++++++++-------- include/exec/cpu_ldst.h | 24 ++++++++++++------------ accel/tcg/cputlb.c | 10 +++++----- target/riscv/vector_helper.c | 2 +- target/rx/op_helper.c | 6 +++--- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/accel/tcg/atomic_template.h b/accel/tcg/atomic_template.h index e312acd16d..84c08b1425 100644 --- a/accel/tcg/atomic_template.h +++ b/accel/tcg/atomic_template.h @@ -69,7 +69,7 @@ # define END _le #endif =20 -ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, target_ulong addr, +ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, abi_ptr addr, ABI_TYPE cmpv, ABI_TYPE newv, MemOpIdx oi, uintptr_t retaddr) { @@ -87,7 +87,7 @@ ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, target_u= long addr, } =20 #if DATA_SIZE < 16 -ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, target_ulong addr, ABI_TYPE = val, +ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, abi_ptr addr, ABI_TYPE val, MemOpIdx oi, uintptr_t retaddr) { DATA_TYPE *haddr =3D atomic_mmu_lookup(env, addr, oi, DATA_SIZE, retad= dr); @@ -100,7 +100,7 @@ ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, target_ul= ong addr, ABI_TYPE val, } =20 #define GEN_ATOMIC_HELPER(X) \ -ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ +ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, abi_ptr addr, \ ABI_TYPE val, MemOpIdx oi, uintptr_t retaddr) \ { \ DATA_TYPE *haddr, ret; \ @@ -131,7 +131,7 @@ GEN_ATOMIC_HELPER(xor_fetch) * of CF_PARALLEL's value, we'll trace just a read and a write. */ #define GEN_ATOMIC_HELPER_FN(X, FN, XDATA_TYPE, RET) \ -ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ +ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, abi_ptr addr, \ ABI_TYPE xval, MemOpIdx oi, uintptr_t retaddr) \ { \ XDATA_TYPE *haddr, cmp, old, new, val =3D xval; \ @@ -172,7 +172,7 @@ GEN_ATOMIC_HELPER_FN(umax_fetch, MAX, DATA_TYPE, new) # define END _be #endif =20 -ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, target_ulong addr, +ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, abi_ptr addr, ABI_TYPE cmpv, ABI_TYPE newv, MemOpIdx oi, uintptr_t retaddr) { @@ -190,7 +190,7 @@ ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, target= _ulong addr, } =20 #if DATA_SIZE < 16 -ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, target_ulong addr, ABI_TYPE = val, +ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, abi_ptr addr, ABI_TYPE val, MemOpIdx oi, uintptr_t retaddr) { DATA_TYPE *haddr =3D atomic_mmu_lookup(env, addr, oi, DATA_SIZE, retad= dr); @@ -203,7 +203,7 @@ ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, target_ul= ong addr, ABI_TYPE val, } =20 #define GEN_ATOMIC_HELPER(X) \ -ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ +ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, abi_ptr addr, \ ABI_TYPE val, MemOpIdx oi, uintptr_t retaddr) \ { \ DATA_TYPE *haddr, ret; \ @@ -231,7 +231,7 @@ GEN_ATOMIC_HELPER(xor_fetch) * of CF_PARALLEL's value, we'll trace just a read and a write. */ #define GEN_ATOMIC_HELPER_FN(X, FN, XDATA_TYPE, RET) \ -ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ +ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, abi_ptr addr, \ ABI_TYPE xval, MemOpIdx oi, uintptr_t retaddr) \ { \ XDATA_TYPE *haddr, ldo, ldn, old, new, val =3D xval; \ diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index 645476f0e5..da10ba1433 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -223,31 +223,31 @@ void cpu_stq_mmu(CPUArchState *env, abi_ptr ptr, uint= 64_t val, void cpu_st16_mmu(CPUArchState *env, abi_ptr addr, Int128 val, MemOpIdx oi, uintptr_t ra); =20 -uint32_t cpu_atomic_cmpxchgb_mmu(CPUArchState *env, target_ulong addr, +uint32_t cpu_atomic_cmpxchgb_mmu(CPUArchState *env, abi_ptr addr, uint32_t cmpv, uint32_t newv, MemOpIdx oi, uintptr_t retaddr); -uint32_t cpu_atomic_cmpxchgw_le_mmu(CPUArchState *env, target_ulong addr, +uint32_t cpu_atomic_cmpxchgw_le_mmu(CPUArchState *env, abi_ptr addr, uint32_t cmpv, uint32_t newv, MemOpIdx oi, uintptr_t retaddr); -uint32_t cpu_atomic_cmpxchgl_le_mmu(CPUArchState *env, target_ulong addr, +uint32_t cpu_atomic_cmpxchgl_le_mmu(CPUArchState *env, abi_ptr addr, uint32_t cmpv, uint32_t newv, MemOpIdx oi, uintptr_t retaddr); -uint64_t cpu_atomic_cmpxchgq_le_mmu(CPUArchState *env, target_ulong addr, +uint64_t cpu_atomic_cmpxchgq_le_mmu(CPUArchState *env, abi_ptr addr, uint64_t cmpv, uint64_t newv, MemOpIdx oi, uintptr_t retaddr); -uint32_t cpu_atomic_cmpxchgw_be_mmu(CPUArchState *env, target_ulong addr, +uint32_t cpu_atomic_cmpxchgw_be_mmu(CPUArchState *env, abi_ptr addr, uint32_t cmpv, uint32_t newv, MemOpIdx oi, uintptr_t retaddr); -uint32_t cpu_atomic_cmpxchgl_be_mmu(CPUArchState *env, target_ulong addr, +uint32_t cpu_atomic_cmpxchgl_be_mmu(CPUArchState *env, abi_ptr addr, uint32_t cmpv, uint32_t newv, MemOpIdx oi, uintptr_t retaddr); -uint64_t cpu_atomic_cmpxchgq_be_mmu(CPUArchState *env, target_ulong addr, +uint64_t cpu_atomic_cmpxchgq_be_mmu(CPUArchState *env, abi_ptr addr, uint64_t cmpv, uint64_t newv, MemOpIdx oi, uintptr_t retaddr); =20 -#define GEN_ATOMIC_HELPER(NAME, TYPE, SUFFIX) \ -TYPE cpu_atomic_ ## NAME ## SUFFIX ## _mmu \ - (CPUArchState *env, target_ulong addr, TYPE val, \ +#define GEN_ATOMIC_HELPER(NAME, TYPE, SUFFIX) \ +TYPE cpu_atomic_ ## NAME ## SUFFIX ## _mmu \ + (CPUArchState *env, abi_ptr addr, TYPE val, \ MemOpIdx oi, uintptr_t retaddr); =20 #ifdef CONFIG_ATOMIC64 @@ -293,10 +293,10 @@ GEN_ATOMIC_HELPER_ALL(xchg) #undef GEN_ATOMIC_HELPER_ALL #undef GEN_ATOMIC_HELPER =20 -Int128 cpu_atomic_cmpxchgo_le_mmu(CPUArchState *env, target_ulong addr, +Int128 cpu_atomic_cmpxchgo_le_mmu(CPUArchState *env, abi_ptr addr, Int128 cmpv, Int128 newv, MemOpIdx oi, uintptr_t retaddr); -Int128 cpu_atomic_cmpxchgo_be_mmu(CPUArchState *env, target_ulong addr, +Int128 cpu_atomic_cmpxchgo_be_mmu(CPUArchState *env, abi_ptr addr, Int128 cmpv, Int128 newv, MemOpIdx oi, uintptr_t retaddr); =20 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index d68fa6867c..11095c4f5f 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -3133,14 +3133,14 @@ static void plugin_store_cb(CPUArchState *env, abi_= ptr addr, MemOpIdx oi) qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, oi, QEMU_PLUGIN_MEM_W); } =20 -void cpu_stb_mmu(CPUArchState *env, target_ulong addr, uint8_t val, +void cpu_stb_mmu(CPUArchState *env, abi_ptr addr, uint8_t val, MemOpIdx oi, uintptr_t retaddr) { helper_stb_mmu(env, addr, val, oi, retaddr); plugin_store_cb(env, addr, oi); } =20 -void cpu_stw_mmu(CPUArchState *env, target_ulong addr, uint16_t val, +void cpu_stw_mmu(CPUArchState *env, abi_ptr addr, uint16_t val, MemOpIdx oi, uintptr_t retaddr) { tcg_debug_assert((get_memop(oi) & MO_SIZE) =3D=3D MO_16); @@ -3148,7 +3148,7 @@ void cpu_stw_mmu(CPUArchState *env, target_ulong addr= , uint16_t val, plugin_store_cb(env, addr, oi); } =20 -void cpu_stl_mmu(CPUArchState *env, target_ulong addr, uint32_t val, +void cpu_stl_mmu(CPUArchState *env, abi_ptr addr, uint32_t val, MemOpIdx oi, uintptr_t retaddr) { tcg_debug_assert((get_memop(oi) & MO_SIZE) =3D=3D MO_32); @@ -3156,7 +3156,7 @@ void cpu_stl_mmu(CPUArchState *env, target_ulong addr= , uint32_t val, plugin_store_cb(env, addr, oi); } =20 -void cpu_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val, +void cpu_stq_mmu(CPUArchState *env, abi_ptr addr, uint64_t val, MemOpIdx oi, uintptr_t retaddr) { tcg_debug_assert((get_memop(oi) & MO_SIZE) =3D=3D MO_64); @@ -3164,7 +3164,7 @@ void cpu_stq_mmu(CPUArchState *env, target_ulong addr= , uint64_t val, plugin_store_cb(env, addr, oi); } =20 -void cpu_st16_mmu(CPUArchState *env, target_ulong addr, Int128 val, +void cpu_st16_mmu(CPUArchState *env, abi_ptr addr, Int128 val, MemOpIdx oi, uintptr_t retaddr) { tcg_debug_assert((get_memop(oi) & MO_SIZE) =3D=3D MO_128); diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index 4d06754826..bf7e0029a1 100644 --- a/target/riscv/vector_helper.c +++ b/target/riscv/vector_helper.c @@ -235,7 +235,7 @@ static inline int vext_elem_mask(void *v0, int index) } =20 /* elements operations for load and store */ -typedef void vext_ldst_elem_fn(CPURISCVState *env, target_ulong addr, +typedef void vext_ldst_elem_fn(CPURISCVState *env, abi_ptr addr, uint32_t idx, void *vd, uintptr_t retaddr); =20 #define GEN_VEXT_LD_ELEM(NAME, ETYPE, H, LDSUF) \ diff --git a/target/rx/op_helper.c b/target/rx/op_helper.c index dc0092ca99..691a12b2be 100644 --- a/target/rx/op_helper.c +++ b/target/rx/op_helper.c @@ -216,19 +216,19 @@ void helper_scmpu(CPURXState *env) } =20 static uint32_t (* const cpu_ldufn[])(CPUArchState *env, - target_ulong ptr, + abi_ptr ptr, uintptr_t retaddr) =3D { cpu_ldub_data_ra, cpu_lduw_data_ra, cpu_ldl_data_ra, }; =20 static uint32_t (* const cpu_ldfn[])(CPUArchState *env, - target_ulong ptr, + abi_ptr ptr, uintptr_t retaddr) =3D { cpu_ldub_data_ra, cpu_lduw_data_ra, cpu_ldl_data_ra, }; =20 static void (* const cpu_stfn[])(CPUArchState *env, - target_ulong ptr, + abi_ptr ptr, uint32_t val, uintptr_t retaddr) =3D { cpu_stb_data_ra, cpu_stw_data_ra, cpu_stl_data_ra, --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822339; cv=none; d=zohomail.com; s=zohoarc; b=Ri9X+FEA2A5GTYyKlazeeRymF8OsgS1TPZT+lfF9lvtXC82+xhKrKhI3+qU3FfUb2QD+aBVdbmZ7lM2eIuZY/TGLDXj8p6PqhbYbVAKv+hzMsrEUXcBde2XbAInfqEd02hc8PKjnodfGRtypkXdNL9oH+eb+zJl+ym8fjlFhDso= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822339; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=z7czmYNurSz0UJJSj6mQcZ7eC/i6fMnP8HLlVqYuy8o=; b=Kvt7JzqrmR4ql/SvtTb6hLQmJtKogwbx7HuJGP14Z95AVU4z8YPfjRnkYYsP8ZJASkj26kOskqgyDadun9klQoQ5ucBw+dxwO69DIKmyLJUyuIVDqdWRHK4n+L/I3BYfRJ5MwrF9AZGlS8PZkOnzB1D7qtlYKLP95AAYMTd5mt0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822339842302.17359649158345; Wed, 23 Aug 2023 13:25:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOi-0000K2-Tr; Wed, 23 Aug 2023 16:24:12 -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 1qYuOU-0008KC-Ks for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:58 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOK-0005Tm-BZ for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:49 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1bc8a2f71eeso40250715ad.0 for ; Wed, 23 Aug 2023 13:23:34 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822214; x=1693427014; 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=z7czmYNurSz0UJJSj6mQcZ7eC/i6fMnP8HLlVqYuy8o=; b=xotu/2RYb0UOGjkG1Od4S/JVWjez2QkB6r6OvinoWZfeffIHATJxnGZM7Xy5ZG92jb rQf/V0hv2wVm477GMeiWr0xEtyKKW7NMU5JP/veY36NKY7WGnxTiFijGDWlpvkC9/w96 LP/lsoe73XXr2NbOd2fnf/wkVBpscIeqcNNtq3bhbgiRrsPdwoqY6BkYPmazCj1wPpFZ 1GgP5Ac5sWbtlA07LmgaXJt514dOU77NmHnF0+GkbUg/Zmtw7xD1GDUQ9melMMqRKhP9 9AZsWger4pO/fz9pHjk2qfYeVT+ZsMktHWqi+E9jOWRiIW4UBuscQT2RyeTNSJtcqetN Z96w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822214; x=1693427014; 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=z7czmYNurSz0UJJSj6mQcZ7eC/i6fMnP8HLlVqYuy8o=; b=Bay+TdYqgTrjVWaz+caju5UmdZiqplj2jBlEMW43iz5R8z0AimEs2/zNZN+uuyfTBZ uUulipa1NTAbp+pK2vIkeSJtSAvTJUhaAaQ3/anVhpfnvEauUhgXiortun3TJcohcuL7 zmVbyLfF7ffTfKdXh4P7MvV5PAcQsyoQbUqjlHi5sa+DesrKu6nciq2URsodcMDALKJn azE2gj4PXYXXArg6CH2T0NKuTWEvSOqc+LlxixW4Qo/CcwggGKSwIIkmc7/KLfpC82Sd H2vVPmdTxxNhZzhBQYN4OXpOTmrFHrVDjM5oUf7x0eGug+88yc0QOKuyBLOqKbCLogEO utdQ== X-Gm-Message-State: AOJu0YwfA88oBWWE8sXwS+C7CVwJcivpWbFWCd6MB4aPdR4ozYXmoO+d zacwzxaNqp/o4tEOYUcf80U6OqqRbI7HcL1Xtws= X-Google-Smtp-Source: AGHT+IEVMhZnPzvM4D0NGtVfNnsFwQKcw8S/giuBgcTLZKCLJPW28K2/lwqpvbgo9peBZxtpKYOb0Q== X-Received: by 2002:a17:902:8c8a:b0:1b8:2537:541c with SMTP id t10-20020a1709028c8a00b001b82537541cmr9710898plo.32.1692822213935; Wed, 23 Aug 2023 13:23:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 06/48] include/exec: typedef abi_ptr to vaddr in softmmu Date: Wed, 23 Aug 2023 13:22:44 -0700 Message-Id: <20230823202326.1353645-7-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822340181100008 Content-Type: text/plain; charset="utf-8" From: Anton Johansson via In system mode, abi_ptr is primarily used for representing addresses when accessing guest memory with cpu_[st|ld]*(). Widening it from target_ulong to vaddr reduces the target dependence of these functions and is step towards building accel/ once for system mode. Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson Message-Id: <20230807155706.9580-7-anjo@rev.ng> Signed-off-by: Richard Henderson --- include/exec/cpu_ldst.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index da10ba1433..f3ce4eb1d0 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -121,8 +121,8 @@ static inline bool guest_range_valid_untagged(abi_ulong= start, abi_ulong len) h2g_nocheck(x); \ }) #else -typedef target_ulong abi_ptr; -#define TARGET_ABI_FMT_ptr TARGET_FMT_lx +typedef vaddr abi_ptr; +#define TARGET_ABI_FMT_ptr "%016" VADDR_PRIx #endif =20 uint32_t cpu_ldub_data(CPUArchState *env, abi_ptr ptr); --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822446; cv=none; d=zohomail.com; s=zohoarc; b=D6FrKCvJ0oix9XoLbeEw1Uaq4VSks32eqt18f3Qo7WQOCyvP1/OTAfmYeTZZ94VA59/P0jqOLWCNBwvdbazTdaGtEN5oEvx7AF7lin73wPiIU00VuUg/bqHyLuGqWVCjwxB6zeAonVsAJrK0cXdjhRaO3kSz9pnBI4DEWTVKGoU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822446; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rL9dYhZlLtnzzFut315rTSxIOrY7aBzaEd71D0pOj5E=; b=XaCmAiQOi/xHjcciitNS0vHo6O/0ELjwq4lR2HgPw3Rfmr8TQpFY3rOHtWdBakt6Jk9RTSgQ/RYt70GPIMZLheLDwRBhqLJNDJSjb/66O1xHaOUqSt8D27/OzPcuh6gyK9TGr1xfSVn0WAjLovQdDZ5Rzm79aCDvBbR/vXx0I0Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822446609389.93471702668444; Wed, 23 Aug 2023 13:27:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOg-0000Fo-Eu; Wed, 23 Aug 2023 16:24:10 -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 1qYuOV-0008Kx-49 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:59 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOK-0005Tq-RT for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:52 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1bf1935f6c2so1715225ad.1 for ; Wed, 23 Aug 2023 13:23:35 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822215; x=1693427015; 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=rL9dYhZlLtnzzFut315rTSxIOrY7aBzaEd71D0pOj5E=; b=s9LgB6hdO/95/Y8hh2Wi8YjyzTVBiVUZP8VxBD1m9S3a46P/SpTc+wKloSr1qcaH5I P7kHrFmpH7CiwU2F4kxhugmQhBHerwgdf9rljgUkGVabeNJ9NIdpi0o/eO4Nbvbbtyf6 v/t7PuwS0fr6rgzBmzlVKS8OJfoJmi8Y4qTGjKKTeSqsxDSL9O4s0o15aBF4iMggoS2b 5OBr8wx6F++fD3OYRwR9pD8QrbugdQqhIhNObWJrOv2IYBjKy4/5ifZ8ImoO6fh8uZTt eR65Rrqr+mLL7WUn5S1pvDSvk+ZGzCK+G/XcuWtzUZPhIgR/VIsHUol2XRvNSGbo4NDR 5g1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822215; x=1693427015; 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=rL9dYhZlLtnzzFut315rTSxIOrY7aBzaEd71D0pOj5E=; b=BU54zWL+Bal8TqLubYXwfvWjHJLcxHaTN8gXo5n3WkdDK5A+59qWGBoyIHOqCDQ7Rt ZGIjvmkDVZ2tRh1f57dz5znU6D2NftLg/lJKt7s52UiPRmOSnqbITp9qOZsDfZs+65jL aq2bm4I2OwHLRNv6EvsoSGxfqGpV4KQviel1tnAz0GAC5c8qBpflue8cti96OBNROcU6 neICnwChccNPM1wLxgXjGOcT9I4+aWRc+UkOS0mSo2+UepPJHu5IPnB9QNoAD+8t01pY w1a9auAUdP1itwlQ/FtpavXcZHVpK+QGKgWF4XX1rom2NIpfqda+Se49bFZMmOF9JpH9 rLiQ== X-Gm-Message-State: AOJu0YzZ2hfGQ7pUHSc5J2A9td2mTeY7Oc3RKQCJKqPhfZbrXGc3x1x/ ES+S6TSMJ4/hWtSQ20cM67X1S2bqhPpcWXMx1Wg= X-Google-Smtp-Source: AGHT+IFos+Ca1cKMqycQKVmtkHIqgC9uGm75NUqb6pXYdCKF3qHhEN5bE8x2890ZQc4yT7gMXKgrdg== X-Received: by 2002:a17:902:db0f:b0:1bd:d510:78fb with SMTP id m15-20020a170902db0f00b001bdd51078fbmr20662892plx.3.1692822214837; Wed, 23 Aug 2023 13:23:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 07/48] include/exec: Widen tlb_hit/tlb_hit_page() Date: Wed, 23 Aug 2023 13:22:45 -0700 Message-Id: <20230823202326.1353645-8-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822447481100001 Content-Type: text/plain; charset="utf-8" From: Anton Johansson via tlb_addr is changed from target_ulong to uint64_t to match the type of a CPUTLBEntry value, and the addressed is changed to vaddr. Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson Message-Id: <20230807155706.9580-8-anjo@rev.ng> Signed-off-by: Richard Henderson --- include/exec/cpu-all.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 94f44f1f59..c2c62160c6 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -397,7 +397,7 @@ QEMU_BUILD_BUG_ON(TLB_FLAGS_MASK & TLB_SLOW_FLAGS_MASK); * @addr: virtual address to test (must be page aligned) * @tlb_addr: TLB entry address (a CPUTLBEntry addr_read/write/code value) */ -static inline bool tlb_hit_page(target_ulong tlb_addr, target_ulong addr) +static inline bool tlb_hit_page(uint64_t tlb_addr, vaddr addr) { return addr =3D=3D (tlb_addr & (TARGET_PAGE_MASK | TLB_INVALID_MASK)); } @@ -408,7 +408,7 @@ static inline bool tlb_hit_page(target_ulong tlb_addr, = target_ulong addr) * @addr: virtual address to test (need not be page aligned) * @tlb_addr: TLB entry address (a CPUTLBEntry addr_read/write/code value) */ -static inline bool tlb_hit(target_ulong tlb_addr, target_ulong addr) +static inline bool tlb_hit(uint64_t tlb_addr, vaddr addr) { return tlb_hit_page(tlb_addr, addr & TARGET_PAGE_MASK); } --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822338; cv=none; d=zohomail.com; s=zohoarc; b=WtbxVKYrzuCFeH2qhUpq1y5fIbt6WoDKa3jFVWAV9j2DWipPRbFWimS1kaPrcnP3+cFOxFZe9KKgKUsG8cZvvzwt7EjecHbcO+9lCSK85eIhx2Y9Q0oJ+M9WHDLrV8mQkI0JJ8AH8lEFswxVju8riiA+uRoS1daXSAD0Iw6Fjro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822338; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qAp8kyXyMTKWzGhsCmv8dMp5tljJJ11V4daC8NGaro0=; b=HhftmjaK4TacRyIzeYE+oUIj7hI8I9kQixbX501lfYarFPYLhjdvcxNRGMWcj+dQ9xJLGr9t8sodv71/6npzjSneIJHm6aP1izySGBmslpGDSRscU+SOVk6E7SY0nEgPossKi3CKq67eI7Vplf2kNGhFTVIbCuqQ70GI59j4k0s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822338431202.46676297742147; Wed, 23 Aug 2023 13:25:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOe-00008h-7z; Wed, 23 Aug 2023 16:24:08 -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 1qYuOV-0008L6-8t for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:59 -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 1qYuOK-0005Tu-W5 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:56 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1bf078d5fb7so41364445ad.0 for ; Wed, 23 Aug 2023 13:23:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822215; x=1693427015; 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=qAp8kyXyMTKWzGhsCmv8dMp5tljJJ11V4daC8NGaro0=; b=mzX0pG9AV67RhAnia5Zj4ucDOEi5xZITeXhD4t7QsqPQ8NiJdlYGX1fyHYvcGj4yfM dajr3TQ5M7WYgFUYvinzQomMp9z+3i3ZCou97yE0nce7Ezsu/ILQ5Vm6mrqVAxsGgMrj A86la6yxp+jUkp85TB9P/C8BwuL/6IMwUa9HYVgSAqYbQg/CggntgUSbD8aG8Y6cL7tE sqA4yI1lqryhkVRkfsu39qEhLVggb5HtlCzsAgzG0L1JwliE1WkUOahG0KqArOoLa9ol NJJS3tkRpcvfm+5SC7htE0aAJw33ng8jlXwHQzgTr4OBkOccqggwxDj/bSZm4LrSp53x u5SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822215; x=1693427015; 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=qAp8kyXyMTKWzGhsCmv8dMp5tljJJ11V4daC8NGaro0=; b=lnGAABhkP5FU1jlwg/ATSjgRIdsIF8DubnHnOmp9GtDqKfdPVWXUT36an19Ara2edD vmY8iRRbkZHB0595mK65PE2RTdbwan3JCN3uWcdVHUsYw+dFtAHOXz43U5irZAeUWqO+ RHHViia781dlgvlKjVCmQsWon9N/ct0z8Ar05vzDgq36Je7tgrT9+z/Fg9nDFdZO1Z7I LKH9gHwGjKNTtiyatDTBnsxeaurZ1b8LbfH7Gi52VUTyVVdU7KdfBLcfZdRCd/lnhrMm fYvIfTkWCc6m3Fo2TigDZkvhpVtro5o6tdVZUEjUXtErfvXM7E7G6OeFR9y4U15h7xi+ STOw== X-Gm-Message-State: AOJu0Yw91TTYHW87ZNuENFJEDNuQ6543aQDSBHupOOC31iJ7aovEXIBh IKfAckAyI6b8jO/CPrcK3mdSoRg97v/0VHZHnDk= X-Google-Smtp-Source: AGHT+IFN5Y4Cuuu2b4tTKO84Vm7u0KeZpH1drQAS49Gb1QUWe61HMVrGLTy3jTydOJEGWhUZwGzfDA== X-Received: by 2002:a17:903:32ce:b0:1bc:56c3:ebb7 with SMTP id i14-20020a17090332ce00b001bc56c3ebb7mr14508997plr.20.1692822215710; Wed, 23 Aug 2023 13:23:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 08/48] accel/tcg: Widen address arg in tlb_compare_set() Date: Wed, 23 Aug 2023 13:22:46 -0700 Message-Id: <20230823202326.1353645-9-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822340167100007 Content-Type: text/plain; charset="utf-8" From: Anton Johansson via Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson Message-Id: <20230807155706.9580-9-anjo@rev.ng> Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 11095c4f5f..bd2cf4b0be 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1108,7 +1108,7 @@ static void tlb_add_large_page(CPUArchState *env, int= mmu_idx, } =20 static inline void tlb_set_compare(CPUTLBEntryFull *full, CPUTLBEntry *ent, - target_ulong address, int flags, + vaddr address, int flags, MMUAccessType access_type, bool enable) { if (enable) { --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822299; cv=none; d=zohomail.com; s=zohoarc; b=CxNdEX6Zblio3r19rtvnVrN5Gbo/gE+H5NkN3BydG98WkS6P/nFid6OqpOnhzV5VM/7epjhm9ZZFQluzQLYVESvSEXhtNHaKO9KvKRjoL89xa0DC1PnVFeBzXCgM7BSEq0Eh8XyXQCiFtnUytIyYy060+V0AUGkDWa24N1PYTEE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822299; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lPTy0zFcuTzFVoJv9IKIJHnsjTn7YyrriC1uBaddXZM=; b=cqNARF2cge2ORcPTES+tg6xvmRF+/FSOWoE/rQnXFWhPqwmaGqBcETsRl8qg5TkK+jWfo5RwvhWSbVUuCl175YM7QaDkwX1Sk14iBUASVZzE+NdAP1xnTXswS8OwK0GKibE/2DEOtAByEKWo4vktGkiOdj7h8Ov9m2iG922LYLk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822299328225.55358172370666; Wed, 23 Aug 2023 13:24:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOi-0000JD-33; Wed, 23 Aug 2023 16:24:12 -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 1qYuOV-0008L8-A8 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:59 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuON-0005Ty-Uj for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:57 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1c06f6f98c0so28090595ad.3 for ; Wed, 23 Aug 2023 13:23:37 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822216; x=1693427016; 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=lPTy0zFcuTzFVoJv9IKIJHnsjTn7YyrriC1uBaddXZM=; b=SxsqY1RVerrh9rkA6vKVTtHzbPKxg8v7UvjxExXpbJ8Pi9uEq2Z5eeycLBLmw0Uuw9 Ei0gS273OWFr/WShVSayZHPQnhpVU/eFM11YbKLJp98MRni9bbcr3RrotbbvZbnOMreD WC11QlLxmDHBncXtwqpLKLFgYsm8rViMrwmFWXpAX/kXKpPBoSD0koOwj4WGtZIF6/gI fiGcVVfIY2neBFYh6k6SxWOp1B3Q+HHh/E2o0ySyvHFfwVwq+rtlQfMiBhktdz7z5pzx 98p85sbXaTiEBNebWjnbO3C7bSB2I9+R2iItzP5KOCCirduaTJD+bzomP+f21Ub1n7rO zBNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822216; x=1693427016; 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=lPTy0zFcuTzFVoJv9IKIJHnsjTn7YyrriC1uBaddXZM=; b=fkL0qdxOWtpUyiRs7IjbjxioZAzyVBPq9fEq2qJ1ups2/wFHU3S49Tb6bmGCfQLTNf uLxSMlkVmdFNZt8B6BRllmwBY+VRLOAPaxU0COMIvtTHzZwkO3k9e5E6ewjjsvDCq+lS 5Za10z7RBB4WzdbeJjEq+Io0S+Bt23HCBJFTDyxZzP48KrcPk/sj6riL/mJTZvZWD8Dp NoxrYxFbRhggqfoPzdF+r3MRC4pmRAVbeO9N2RAs651ysARX9bLtVuUcGdscRyI0OX/C vulfIda0OjPL6z1mmtKXUw9mhq8V7+szuQMSQ4w0SAYxQ76tNl5ohb8Nohvj+v3lhVtE 4hnA== X-Gm-Message-State: AOJu0YwWTlBXy/KOfxkOnefdMjIa9Sg6HIHkoZ1y28sLhFNN8pyAn5gG ax8kD8bJAuOKOBBEDWTHFCInO+skn35b5lpbKQI= X-Google-Smtp-Source: AGHT+IE8j0tR9XiVnvZa7fh0EiMKBK0I4J0rzC4O1ZETpRy8GXngv0J5OE6p0AN+l7UAgsuP6n3iLA== X-Received: by 2002:a17:902:e881:b0:1b9:e091:8037 with SMTP id w1-20020a170902e88100b001b9e0918037mr16872898plg.30.1692822216499; Wed, 23 Aug 2023 13:23:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 09/48] accel/tcg: Update run_on_cpu_data static assert Date: Wed, 23 Aug 2023 13:22:47 -0700 Message-Id: <20230823202326.1353645-10-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822300865100002 Content-Type: text/plain; charset="utf-8" From: Anton Johansson via As we are now using vaddr for representing guest addresses, update the static assert to check that vaddr fits in the run_on_cpu_data union. Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson Message-Id: <20230807155706.9580-10-anjo@rev.ng> Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index bd2cf4b0be..c643d66190 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -74,8 +74,9 @@ } while (0) =20 /* run_on_cpu_data.target_ptr should always be big enough for a - * target_ulong even on 32 bit builds */ -QEMU_BUILD_BUG_ON(sizeof(target_ulong) > sizeof(run_on_cpu_data)); + * vaddr even on 32 bit builds + */ +QEMU_BUILD_BUG_ON(sizeof(vaddr) > sizeof(run_on_cpu_data)); =20 /* We currently can't handle more than 16 bits in the MMUIDX bitmask. */ --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822313; cv=none; d=zohomail.com; s=zohoarc; b=dAzA+OOGG6efLBbi/wvzVerOlhqrg3ILEEsvVBe7GUTkz1emYJ6qMN8pA7qRcd5n9GtaNQc6aqr5b++8tz1UC4fQEnXRKQnOzzm5NitxlWY+1pskSqDQyEVmXwQLg8RXjFDc0jNKHb+1sYJAP13xm49Ll1uIt1BNCEB+K8TIxyM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822313; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Sx0epkogYDT5CuB/Oub20dQ94By4bi1YJwfsT53fmL8=; b=LFV4rZYq03etrRPOefZaLBmUkPO3ZWSCRTWiI/jG8fwTEP4aKY6TFh0fk/CkIovjDeFsyIa1AskPbe2MGhIcE4cDcepMebTPAr1PSHfSGfbkTPhqThpsI/SgQOaR7jTC6pvKm0gLRbsZ/Pzbp9U+0crsS9Sf9zaXHZ14l98vnE4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822313011619.4060866923219; Wed, 23 Aug 2023 13:25:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOd-0008TV-D8; Wed, 23 Aug 2023 16:24:07 -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 1qYuOV-0008L9-AZ for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:00 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOK-0005U2-Tx for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:54 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1bc0d39b52cso41167065ad.2 for ; Wed, 23 Aug 2023 13:23:38 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822217; x=1693427017; 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=Sx0epkogYDT5CuB/Oub20dQ94By4bi1YJwfsT53fmL8=; b=qVXGHT32KGoNLNcX+9X/4IPhjGqiluSnvf8NBdexwJv4AtHQkO17tRfbMd1wqaCLC/ cePOu+xjbVa8SvQLYZFm4X5X+puXBRKxM2lcNpVZDEIMM8JXAUFlH9KbnmAsaVVz6GmQ 68DMUd8jZqGolEGLUp/FHEsKqS3Ym+1EYf0uOmUlOFP+dg3iVjNATIXb7QyFzHSI/yBw AECpNCFv6gwIILzE1kl/kWD6QRM5t1m47VjWhNm3nFGMk3Tc1DrXd2IHNa+t8RUv5AHp 4hcd230GcLHh04dwshlbx5DbNDCaJEEL5rcSh2+v0hRKx6oQGisVdKK4RZ/+oPQoNTE+ aYIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822217; x=1693427017; 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=Sx0epkogYDT5CuB/Oub20dQ94By4bi1YJwfsT53fmL8=; b=RlxNcj4+37JRITUnXeNf7pxkbiSETyb6HHgmdaHeswfozG/A/t6lRXb+RO7rDSHOND GSHQFU8jK36XHfR+49dIKTNPrzOxJHtoyUw4fQEis3kF/aVDJjo5KTxAaBB+y9l0kPJz uVER8wdoZ0wU11XZCvQwYI70iJSVAQfd05YWovph83/gbcnRin60nEIOaJnlpA3T+1sE 3B8egnVrYmHkesDbiY+iewzf0fGCAFF/qCk5PSPt1GtSht5SoJ6XdrwRGWP10jmskeu/ xztUD1xopD0bgV2YQVr0445eiZScAcXHcpBp3oKE/79y2r53Jn6HyIGB1/iOWVaYZnK/ B8Dg== X-Gm-Message-State: AOJu0YxiZPO3TDXE4GXkFJfKxpJxkTGD019XeqeUFTNWz9p9x3CEcRTl Z1FPUx2lRsC9XSEbr/arEUpiH9BwVMZ4VubJzv0= X-Google-Smtp-Source: AGHT+IFYgGbEnphxRv4I3/E5TlBTeTrfLyH3nOb4YP714Ko+YtCjxmoE/eSZq5OmGG8EkoKpfmLI3A== X-Received: by 2002:a17:903:234a:b0:1c0:8a05:f356 with SMTP id c10-20020a170903234a00b001c08a05f356mr7771903plh.54.1692822217532; Wed, 23 Aug 2023 13:23:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 10/48] target/m68k: Use tcg_gen_deposit_i32 in gen_partset_reg Date: Wed, 23 Aug 2023 13:22:48 -0700 Message-Id: <20230823202326.1353645-11-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822314010100003 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson --- target/m68k/translate.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index e07161d76f..d08e823b6c 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -697,19 +697,12 @@ static inline int ext_opsize(int ext, int pos) */ static void gen_partset_reg(int opsize, TCGv reg, TCGv val) { - TCGv tmp; switch (opsize) { case OS_BYTE: - tcg_gen_andi_i32(reg, reg, 0xffffff00); - tmp =3D tcg_temp_new(); - tcg_gen_ext8u_i32(tmp, val); - tcg_gen_or_i32(reg, reg, tmp); + tcg_gen_deposit_i32(reg, reg, val, 0, 8); break; case OS_WORD: - tcg_gen_andi_i32(reg, reg, 0xffff0000); - tmp =3D tcg_temp_new(); - tcg_gen_ext16u_i32(tmp, val); - tcg_gen_or_i32(reg, reg, tmp); + tcg_gen_deposit_i32(reg, reg, val, 0, 16); break; case OS_LONG: case OS_SINGLE: --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822366; cv=none; d=zohomail.com; s=zohoarc; b=FsUXjIe0El8B0baR32IB15r76zfRXcPQAtiCrQf+w/lFRGwO9WwKZLVqmjReuwY8hq1rr6R2PijvJQ3cmLbqC+MdZswzW0JbSTogUe/DzN+heEtvsxusms15OfVNIClIIEYppgtmrfnDJJc2pIhwV/vZM96LdrKa4RlfuoOlZP8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822366; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=m32t45SXSN5mAoXF6SAGM5jFZ/43uDf4E7JMPMdT2hs=; b=eAGPE7G8PKer9AYLJx4I6mamS74mq6JcPL7sYHIxCL58tr3U739ACOAuRO8Jfpau6jVCmTtiggDffaZgUk1433fGLwRwfSX4Va4LgdmdyyRpiZP12eyc38GmLm97NDATUbd4ilYV/JGNHA2P5KJQ2dgdl+2bDAITkVmpiMuyzsY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822365994583.9159841479355; Wed, 23 Aug 2023 13:26:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOc-0008TA-2V; Wed, 23 Aug 2023 16:24:06 -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 1qYuOV-0008L7-9v for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:00 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOK-0005U6-U9 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:57 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1bf62258c4dso29335585ad.2 for ; Wed, 23 Aug 2023 13:23:39 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822218; x=1693427018; 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=m32t45SXSN5mAoXF6SAGM5jFZ/43uDf4E7JMPMdT2hs=; b=Hh2WLv3F0ZtJCHCEOzNDgYmaq9voSAFwHlOCU88WZ8Q8ZLJ/e6HA13yJZQgx0QQCWb MIRRRwCLNB63bX3vbgkkKVyd7H/xj17QNkBWPi5YYNM+N+GABHKu/bdaLKhwwBy5zGzq umW0rwh/aDtWeKdS32PwZiOlIYxfY8lk3idJxdQTnsWUHDXPN8PWpSEPzSGbKSrmHgcX LvFakOebIFairX5Qcxlc2dZYy28S3EZboJUtogkGWj/FncD4cqyFEwwq9as2pDL5Thym H7VAiABHu+IHqihpMNaconawflHr1JHrM8aqJOVhZPWX8I1z06BF6bA+z3magWQCmGaR U4tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822218; x=1693427018; 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=m32t45SXSN5mAoXF6SAGM5jFZ/43uDf4E7JMPMdT2hs=; b=SVOYYnpfe0CoXK0KoMZKgpdlFNRBIXjnbO5jM2bh7EuQfaNYQbKaQCSRCunTHF8Lg3 J57OX5wxeyElSoUvXbYo7E13W64yttBXMl1V9wZt6pAjv8HV2UGw+5N1HxCSbY9IWOQG BwqHEGrvWHRv+2U4SdCYrA41cHsae389e06lEGEuNpvPv0wlQVa+RAE3qZk6Nt1YbtJX 9XpIiCBXBdp0rY16JfjwoJ80m15xOjwXIMaoqLCGVEycBFCkT4xTli2R9X0whrKFwFMw yq/RTxgCAfvZdVxgtYr/OgReR0cwaXeINbtqHXJSO5l3234IfXSKtxPPUiLPSBqETTMq KNtg== X-Gm-Message-State: AOJu0YyrHijPVTPdzr65wPUIueaPFDuQ71sjyivVl9ilYjus+qop8DoB 1zuA/bJSB4w42yiHIhXJ0nKFuAaRyhP9EvdJelQ= X-Google-Smtp-Source: AGHT+IGGT9tD21aEYZnfbM+RI8gvgoeDISQuDEUHvLnJNkr8gpTTpP6Y6U+r2DudJX23Ur0+6rOEPg== X-Received: by 2002:a17:902:9a4a:b0:1bd:ba57:5a8f with SMTP id x10-20020a1709029a4a00b001bdba575a8fmr10866321plv.13.1692822218459; Wed, 23 Aug 2023 13:23:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 11/48] tcg/i386: Drop BYTEH deposits for 64-bit Date: Wed, 23 Aug 2023 13:22:49 -0700 Message-Id: <20230823202326.1353645-12-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822366972100002 Content-Type: text/plain; charset="utf-8" It is more useful to allow low-part deposits into all registers than to restrict allocation for high-byte deposits. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/i386/tcg-target-con-set.h | 2 +- tcg/i386/tcg-target-con-str.h | 1 - tcg/i386/tcg-target.h | 4 ++-- tcg/i386/tcg-target.c.inc | 7 +++---- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tcg/i386/tcg-target-con-set.h b/tcg/i386/tcg-target-con-set.h index 5ea3a292f0..3949d49538 100644 --- a/tcg/i386/tcg-target-con-set.h +++ b/tcg/i386/tcg-target-con-set.h @@ -33,7 +33,7 @@ C_O1_I1(r, q) C_O1_I1(r, r) C_O1_I1(x, r) C_O1_I1(x, x) -C_O1_I2(Q, 0, Q) +C_O1_I2(q, 0, q) C_O1_I2(q, r, re) C_O1_I2(r, 0, ci) C_O1_I2(r, 0, r) diff --git a/tcg/i386/tcg-target-con-str.h b/tcg/i386/tcg-target-con-str.h index 24e6bcb80d..95a30e58cd 100644 --- a/tcg/i386/tcg-target-con-str.h +++ b/tcg/i386/tcg-target-con-str.h @@ -19,7 +19,6 @@ REGS('D', 1u << TCG_REG_EDI) REGS('r', ALL_GENERAL_REGS) REGS('x', ALL_VECTOR_REGS) REGS('q', ALL_BYTEL_REGS) /* regs that can be used as a byte operand */ -REGS('Q', ALL_BYTEH_REGS) /* regs with a second byte (e.g. %ah) */ REGS('L', ALL_GENERAL_REGS & ~SOFTMMU_RESERVE_REGS) /* qemu_ld/st */ REGS('s', ALL_BYTEL_REGS & ~SOFTMMU_RESERVE_REGS) /* qemu_st8_i32 data = */ =20 diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index 2a2e3fffa8..30cce01ca4 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -227,8 +227,8 @@ typedef enum { #define TCG_TARGET_HAS_cmpsel_vec -1 =20 #define TCG_TARGET_deposit_i32_valid(ofs, len) \ - (((ofs) =3D=3D 0 && (len) =3D=3D 8) || ((ofs) =3D=3D 8 && (len) =3D=3D= 8) || \ - ((ofs) =3D=3D 0 && (len) =3D=3D 16)) + (((ofs) =3D=3D 0 && ((len) =3D=3D 8 || (len) =3D=3D 16)) || \ + (TCG_TARGET_REG_BITS =3D=3D 32 && (ofs) =3D=3D 8 && (len) =3D=3D 8)) #define TCG_TARGET_deposit_i64_valid TCG_TARGET_deposit_i32_valid =20 /* Check for the possibility of high-byte extraction and, for 64-bit, diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index a6b2eae995..ba40dd0f4d 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -144,7 +144,6 @@ static TCGReg tcg_target_call_oarg_reg(TCGCallReturnKin= d kind, int slot) # define TCG_REG_L1 TCG_REG_EDX #endif =20 -#define ALL_BYTEH_REGS 0x0000000fu #if TCG_TARGET_REG_BITS =3D=3D 64 # define ALL_GENERAL_REGS 0x0000ffffu # define ALL_VECTOR_REGS 0xffff0000u @@ -152,7 +151,7 @@ static TCGReg tcg_target_call_oarg_reg(TCGCallReturnKin= d kind, int slot) #else # define ALL_GENERAL_REGS 0x000000ffu # define ALL_VECTOR_REGS 0x00ff0000u -# define ALL_BYTEL_REGS ALL_BYTEH_REGS +# define ALL_BYTEL_REGS 0x0000000fu #endif #ifdef CONFIG_SOFTMMU # define SOFTMMU_RESERVE_REGS ((1 << TCG_REG_L0) | (1 << TCG_REG_L1)) @@ -2752,7 +2751,7 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcod= e opc, if (args[3] =3D=3D 0 && args[4] =3D=3D 8) { /* load bits 0..7 */ tcg_out_modrm(s, OPC_MOVB_EvGv | P_REXB_R | P_REXB_RM, a2, a0); - } else if (args[3] =3D=3D 8 && args[4] =3D=3D 8) { + } else if (TCG_TARGET_REG_BITS =3D=3D 32 && args[3] =3D=3D 8 && ar= gs[4] =3D=3D 8) { /* load bits 8..15 */ tcg_out_modrm(s, OPC_MOVB_EvGv, a2, a0 + 4); } else if (args[3] =3D=3D 0 && args[4] =3D=3D 16) { @@ -3312,7 +3311,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpc= ode op) =20 case INDEX_op_deposit_i32: case INDEX_op_deposit_i64: - return C_O1_I2(Q, 0, Q); + return C_O1_I2(q, 0, q); =20 case INDEX_op_setcond_i32: case INDEX_op_setcond_i64: --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822332; cv=none; d=zohomail.com; s=zohoarc; b=Zxk7z+MVjh6pfZ8R/Z/rMVSWybPuPHts0rJ8R51kkMj35YKn9GWYUuEU8YKXzCU2kMmvxhc14l1pxdF1U36Odh+VzO8tABNULDzasQANHLDyGNxatCMLyfLqQ1AOimzhuY3UogPqsHRCoEQmURwVUx9cJu+LZ2KgctYnC58iHT0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822332; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JJH5DAXKpxVvxGZBhnGdGfJdujLL25EIiq+q/aDhCI4=; b=XTtKmRu1xis6z/FJvP+XKKs6m7OpvfK2G2jT9D0YI9OB+uX8uFGd6KwNp8RFt7hfuds7OLyljSsrZoLyX9/dwUK+pGnuWDg6gE2Ej4jFppcP61DFzmPO7J1L1MCMODb4MmEHKPPrUbg4wBKhNYI5jYb6eUUCP8/ZASnB2GgGs78= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16928223324911001.2328149400461; Wed, 23 Aug 2023 13:25:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOd-0008US-Cp; Wed, 23 Aug 2023 16:24:07 -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 1qYuOV-0008L5-8P for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:59 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOK-0005UA-Tu for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:56 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1bbc87ded50so41173835ad.1 for ; Wed, 23 Aug 2023 13:23:40 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822219; x=1693427019; 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=JJH5DAXKpxVvxGZBhnGdGfJdujLL25EIiq+q/aDhCI4=; b=bZus8SsOIdrq9tLnLASKzh/xUmascleeVXt1dbn48NJyfFv3YQJcDgwFGeZtqa05e1 COOjjSN7Sduo9XyaXBek36wJlrRjKBYtvLJbLfUu/2kcp6HzUpzL/JTJgzNFKnIIgdHE Obo1aZap80oSnvznvkOKiqh+KGk/A//R5wqHplicGLqZEuAxGXllO4n4njSSxpnRzoZu /gdLesAmX9cn12736ISxyDr5innthnMTsAx3IyeOXLsuWwz6vyce8JIV4mKBaf/VTS3u FomJ0UDSILUvpBP+FuBuniF662zQC9HBgm3Ft5mdUIR05JzpJR0ydQK/K0OtpOKG38vD NWmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822219; x=1693427019; 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=JJH5DAXKpxVvxGZBhnGdGfJdujLL25EIiq+q/aDhCI4=; b=FarHbEMpuqKYYtq3kj9fDtzvdp46Ek7dV2ewaJjiyvqSQkg3X+GWPL5aKkpO946yfz TEmqLQzAfBiMZGsTw998wXWWb7SUeGAQl1vEkBpdUUH6rncdPid8oi/7O8yoO5WfOfAV DJ0qvGUi/IRXxXI40iiri7Hal+UD6yH2abWuh01/+q+r23P6ERXnUJEtYeN+iHuxboJ9 xr/UYxq7SqzGtKdOthUrVBxKd2rHZ4b5l32pl1CAo2ZDuZztqJXyOsgU0GvuJ/d/8R8m WcAEgG8LA2Q4lmAZEs/DloIVi95gD5+3NiHGu3vJG5jT9qBBGJckJ/K1TsCgkW3f3fYO l16A== X-Gm-Message-State: AOJu0YxvozRvQzN9NX/yFIYJCxv2wxu1GWKiu5KgVF0ZhMbm4P/Ba6O9 LOr1YxE8tetbt/P1sHcpXhaV0LWizf85sTBc9XY= X-Google-Smtp-Source: AGHT+IGUp+FtYjGk5nKC9mwh4gxXOROtSss3Hnr1juZyXZKERd1IMvckURulCmxBp8558fcq1st2mA== X-Received: by 2002:a17:903:124b:b0:1b7:e646:4cc4 with SMTP id u11-20020a170903124b00b001b7e6464cc4mr14122325plh.28.1692822219307; Wed, 23 Aug 2023 13:23:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 12/48] tcg: Fold deposit with zero to and Date: Wed, 23 Aug 2023 13:22:50 -0700 Message-Id: <20230823202326.1353645-13-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822332732100001 Inserting a zero into a value, or inserting a value into zero at offset 0 may be implemented with AND. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/optimize.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tcg/optimize.c b/tcg/optimize.c index d2156367a3..bbd9bb64c6 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1279,6 +1279,8 @@ static bool fold_ctpop(OptContext *ctx, TCGOp *op) =20 static bool fold_deposit(OptContext *ctx, TCGOp *op) { + TCGOpcode and_opc; + if (arg_is_const(op->args[1]) && arg_is_const(op->args[2])) { uint64_t t1 =3D arg_info(op->args[1])->val; uint64_t t2 =3D arg_info(op->args[2])->val; @@ -1287,6 +1289,41 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op) return tcg_opt_gen_movi(ctx, op, op->args[0], t1); } =20 + switch (ctx->type) { + case TCG_TYPE_I32: + and_opc =3D INDEX_op_and_i32; + break; + case TCG_TYPE_I64: + and_opc =3D INDEX_op_and_i64; + break; + default: + g_assert_not_reached(); + } + + /* Inserting a value into zero at offset 0. */ + if (arg_is_const(op->args[1]) + && arg_info(op->args[1])->val =3D=3D 0 + && op->args[3] =3D=3D 0) { + uint64_t mask =3D MAKE_64BIT_MASK(0, op->args[4]); + + op->opc =3D and_opc; + op->args[1] =3D op->args[2]; + op->args[2] =3D temp_arg(tcg_constant_internal(ctx->type, mask)); + ctx->z_mask =3D mask & arg_info(op->args[1])->z_mask; + return false; + } + + /* Inserting zero into a value. */ + if (arg_is_const(op->args[2]) + && arg_info(op->args[2])->val =3D=3D 0) { + uint64_t mask =3D deposit64(-1, op->args[3], op->args[4], 0); + + op->opc =3D and_opc; + op->args[2] =3D temp_arg(tcg_constant_internal(ctx->type, mask)); + ctx->z_mask =3D mask & arg_info(op->args[1])->z_mask; + return false; + } + ctx->z_mask =3D deposit64(arg_info(op->args[1])->z_mask, op->args[3], op->args[4], arg_info(op->args[2])->z_mask); --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822502; cv=none; d=zohomail.com; s=zohoarc; b=C0UaFZMMj+HlbT+mLEoVVZJlRgp1chYWS8Ka2cJt2x1eTxlLDpYF1C3CBroLVgLQL2ZVicbyID0rbDTlphtNzaNng/cGJcM8dA5m3usYgKDKfRit1faiSjaSfi8O5gP4NEwTao/7ItR+KA5e2Pt1Xt+gRIbwQnjLquOUicVBFHM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822502; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iNRynbj4NWiJ6TTSh4DJmwLcdDkEd+nKNCg+6WFAujM=; b=T9UOfPy4IvQxXUkFFgfs5f1qJ9tGTVAzqrL2lGC6+uYROhNagErREJ/s7IDJDAHCarQT8DG0yKnh8/GbB82eru29DlJlCjM4f8yAMCy2BnQj2c6xwNvD5aNcOTwbA69Z4iVb2+o/+FqF0Nipd20hEv2KTCcgeaGN8pAo9bSxP50= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822502925613.7754214139304; Wed, 23 Aug 2023 13:28:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOl-0000SU-6e; Wed, 23 Aug 2023 16:24:15 -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 1qYuOV-0008L2-7r for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:59 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOK-0005UE-Tv for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:56 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1bba48b0bd2so40993695ad.3 for ; Wed, 23 Aug 2023 13:23:41 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822220; x=1693427020; 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=iNRynbj4NWiJ6TTSh4DJmwLcdDkEd+nKNCg+6WFAujM=; b=Z810D/YYnhAYsR9gW//kp7mYn5VjaT/c2zQSGKlknSM3Pn/WwRHVrxf4UxEjidyLfo JL6WALMG6jfreUQW74DbRmyJhreGLHTBSfIf5cntv17TQoGAv0cUmPPKwu4edkqwBa6y 3GU/9oI2OLX5cUZ0DiZw0Y6MPN/iRRBpvm2x+GtvBVOMUEk1XNGu3b+MfJaAhlWfDtZ+ mQhuvs7xXPDzVo1/W4bhYh43e1HJvK1Cpmt8DP8wJz78azdnO/vs9tpz+ZV1jkcuRpT6 yc/7yM8ErOeI3jo1/7Z/xMxEwxxGzq4Qsdsq287qT9RyQ05Pq7bMl2JVeMQDSleSQ9NB UzjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822220; x=1693427020; 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=iNRynbj4NWiJ6TTSh4DJmwLcdDkEd+nKNCg+6WFAujM=; b=I7jlSMjIwDk3H1iyzM2p+YIHyiXKx53lrva7YXlJWu+A5esz3oKRtDqFqsOggGPq0Q Wc4NLKx2WIo/SBIKGxFpvBTnTnQS7kI9TCNTVV/kR102U5Me/VLHrqzhNUPIviX3Rbz0 V1LKdbDbe4QsvvVaiez+EyixUoa6elzOlzC8sdp5ewRnKxVVWKhaPZOz69/apA8zp1HO CbvjtApEXa/hDRLkeD8B0r9ZJOhXHVw1SITry6l6mA1bIsk7UROBnt/Mno6RtNO4+6xv HzqLqp2cIT8jp+q7lPZPLnC5USrDV+JoqN17medE8NBkiz7SQv4XHumJT9Z1cpGI1rt3 9orA== X-Gm-Message-State: AOJu0Yx3UX70atvytyia0S0Lk5mBjuN4mzY7/pZyA4E056ZCHAfnGUOL bl31GqzRvJNw69Cfq1Nssu3zTCiAZGzK4xSS524= X-Google-Smtp-Source: AGHT+IHJb9kyogWCtIGTtGZAi0NxwqAOzIL9IfW+6M2laqgmwcd9njEJMQWIw5y/aWBrqUD5a88QEA== X-Received: by 2002:a17:902:da8b:b0:1bf:78d:5cde with SMTP id j11-20020a170902da8b00b001bf078d5cdemr12154039plx.59.1692822220220; Wed, 23 Aug 2023 13:23:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 13/48] tcg/i386: Allow immediate as input to deposit_* Date: Wed, 23 Aug 2023 13:22:51 -0700 Message-Id: <20230823202326.1353645-14-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822505150100007 Content-Type: text/plain; charset="utf-8" We can use MOVB and MOVW with an immediate just as easily as with a register input. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/i386/tcg-target-con-set.h | 2 +- tcg/i386/tcg-target.c.inc | 26 ++++++++++++++++++++++---- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/tcg/i386/tcg-target-con-set.h b/tcg/i386/tcg-target-con-set.h index 3949d49538..7d00a7dde8 100644 --- a/tcg/i386/tcg-target-con-set.h +++ b/tcg/i386/tcg-target-con-set.h @@ -33,7 +33,7 @@ C_O1_I1(r, q) C_O1_I1(r, r) C_O1_I1(x, r) C_O1_I1(x, x) -C_O1_I2(q, 0, q) +C_O1_I2(q, 0, qi) C_O1_I2(q, r, re) C_O1_I2(r, 0, ci) C_O1_I2(r, 0, r) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index ba40dd0f4d..3045b56002 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -276,6 +276,7 @@ static bool tcg_target_const_match(int64_t val, TCGType= type, int ct) #define OPC_MOVL_GvEv (0x8b) /* loads, more or less */ #define OPC_MOVB_EvIz (0xc6) #define OPC_MOVL_EvIz (0xc7) +#define OPC_MOVB_Ib (0xb0) #define OPC_MOVL_Iv (0xb8) #define OPC_MOVBE_GyMy (0xf0 | P_EXT38) #define OPC_MOVBE_MyGy (0xf1 | P_EXT38) @@ -2750,13 +2751,30 @@ static inline void tcg_out_op(TCGContext *s, TCGOpc= ode opc, OP_32_64(deposit): if (args[3] =3D=3D 0 && args[4] =3D=3D 8) { /* load bits 0..7 */ - tcg_out_modrm(s, OPC_MOVB_EvGv | P_REXB_R | P_REXB_RM, a2, a0); + if (const_a2) { + tcg_out_opc(s, OPC_MOVB_Ib | P_REXB_RM | LOWREGMASK(a0), + 0, a0, 0); + tcg_out8(s, a2); + } else { + tcg_out_modrm(s, OPC_MOVB_EvGv | P_REXB_R | P_REXB_RM, a2,= a0); + } } else if (TCG_TARGET_REG_BITS =3D=3D 32 && args[3] =3D=3D 8 && ar= gs[4] =3D=3D 8) { /* load bits 8..15 */ - tcg_out_modrm(s, OPC_MOVB_EvGv, a2, a0 + 4); + if (const_a2) { + tcg_out8(s, OPC_MOVB_Ib + a0 + 4); + tcg_out8(s, a2); + } else { + tcg_out_modrm(s, OPC_MOVB_EvGv, a2, a0 + 4); + } } else if (args[3] =3D=3D 0 && args[4] =3D=3D 16) { /* load bits 0..15 */ - tcg_out_modrm(s, OPC_MOVL_EvGv | P_DATA16, a2, a0); + if (const_a2) { + tcg_out_opc(s, OPC_MOVL_Iv | P_DATA16 | LOWREGMASK(a0), + 0, a0, 0); + tcg_out16(s, a2); + } else { + tcg_out_modrm(s, OPC_MOVL_EvGv | P_DATA16, a2, a0); + } } else { g_assert_not_reached(); } @@ -3311,7 +3329,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpc= ode op) =20 case INDEX_op_deposit_i32: case INDEX_op_deposit_i64: - return C_O1_I2(q, 0, q); + return C_O1_I2(q, 0, qi); =20 case INDEX_op_setcond_i32: case INDEX_op_setcond_i64: --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822337; cv=none; d=zohomail.com; s=zohoarc; b=g2xEqzu8jDv9lRMaLhczNCy0AwyfUp0PDkudgGDQ282FQLsFZ1KZdJEA4PP36d8tWCOA9q9IJOvCFnCZziakxpNXFd9/rPyL/FxtAd8w1+JTN/b9p5efULBsRyLIayD7tlDNVml51pG34A4QWr5prHojTlbjIWapZ4bE+MdNXxE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822337; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xVbtbg9YLiki2PHPwQ3RAo+50+pEwE5ioy9dgOI0Jcc=; b=SaUFTk8M+NiFCLmOBfzhqUxoSa8MLNtnM920kg6j1bv4y7bp2+7Lg0jzq0dleVCatRWy05oRuB75482dYYw1ql+I4fAVaeeNyTchQR7IBRSsghA9GzgGcE42Ck9KXA0oVYAOcRVeYwdpeQRRgzkrIGWa7tcd0nv5f5BxObWhQOA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16928223374985.296018652306088; Wed, 23 Aug 2023 13:25:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOh-0000HV-7n; Wed, 23 Aug 2023 16:24:11 -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 1qYuOV-0008Ky-67 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:59 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOK-0005UL-P7 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:51 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1bc3d94d40fso47176655ad.3 for ; Wed, 23 Aug 2023 13:23:42 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822221; x=1693427021; 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=xVbtbg9YLiki2PHPwQ3RAo+50+pEwE5ioy9dgOI0Jcc=; b=FQkS0RQLs4C2fXU2MhPTK1f9VNjcQl9Ze87TDbd5VVtWmhasOkGSWH0d/+M/sRRtmC AMOCN24WQZdv3Ga3beySQ086XY/sx6IQvhRS48h46f7iUTZfg/w0ws1p2om0lN0v9hue QPhb1kCljiwi3/TMnM07+4e5cGDMzO11wqtadPISGc96IvDtEZKjWyxQriqDF7+zghYf A9oIrF2BiJ9JiKAyeNAIXCHXRTpZVnx5ey7bP7Evc2HNG6vMg65NROyTdTmYdszhK5LG 9OB3je1bQ9C+ifaehwibu4C1ZU338ayyiViB6OU/tAlSmjvJJPshLnOp/3nLx/NGvI23 gmtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822221; x=1693427021; 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=xVbtbg9YLiki2PHPwQ3RAo+50+pEwE5ioy9dgOI0Jcc=; b=WhQQrBGW+S2g4t+wmX81xApU51l4jNw4wxv0zRQHzdc1uYMViie18lkHo54QRBa/Zs tJdjrjo4xwC2AwqEKxpNFPCMZuNwuDEzUj1ynjKfXp2nGg3iXxHrB/vyMyNH/EPHj7PR ezH1AVs3/OitsR3dBMzvkVL+jWMUwFKXdaDXE0Z/J1WiHcKWP1oBrd2wn9mEAusYxZmR TJ6g+ym7w//4md0x66XaFbkHwTgLpulbXU5hoeQlEZn73roitcVlZUu8QTUJaq/NTsSO ieSpCzrTRuwNfEHxkgC6LzbUKzIn7jhG8W29iOZlKb9F1eqIhThiEyu85MqEXpNXoS91 lhWA== X-Gm-Message-State: AOJu0Yy2Qflt4GHL03gBAz5LrzneTYAfqKP3bFC30dVPkCeTbcGEfdpY m9hKnUbnJUonjMDrLRzW828D5ryHQ/HhYXro7vU= X-Google-Smtp-Source: AGHT+IF26qfYycFCRcoizlQHBdDRIKa+WKHKMdAUNdjcIjZWfvplLme41912LvQvE2OIgGkfa1Mm/w== X-Received: by 2002:a17:902:a409:b0:1bd:c783:dac3 with SMTP id p9-20020a170902a40900b001bdc783dac3mr12152449plq.63.1692822221185; Wed, 23 Aug 2023 13:23:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 14/48] docs/devel/tcg-ops: Bury mentions of trunc_shr_i64_i32() Date: Wed, 23 Aug 2023 13:22:52 -0700 Message-Id: <20230823202326.1353645-15-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822338722100001 From: Philippe Mathieu-Daud=C3=A9 Commit 609ad70562 ("tcg: Split trunc_shr_i32 opcode into extr[lh]_i64_i32") remove trunc_shr_i64_i32(). Update the backend documentation. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20230822162847.71206-1-philmd@linaro.org> Signed-off-by: Richard Henderson --- docs/devel/tcg-ops.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst index 6a166c5665..53695e1623 100644 --- a/docs/devel/tcg-ops.rst +++ b/docs/devel/tcg-ops.rst @@ -882,14 +882,15 @@ sub2_i32, brcond2_i32). On a 64 bit target, the values are transferred between 32 and 64-bit registers using the following ops: =20 -- trunc_shr_i64_i32 +- extrl_i64_i32 +- extrh_i64_i32 - ext_i32_i64 - extu_i32_i64 =20 They ensure that the values are correctly truncated or extended when moved from a 32-bit to a 64-bit register or vice-versa. Note that the -trunc_shr_i64_i32 is an optional op. It is not necessary to implement -it if all the following conditions are met: +extrl_i64_i32 and extrh_i64_i32 are optional ops. It is not necessary +to implement them if all the following conditions are met: =20 - 64-bit registers can hold 32-bit values - 32-bit values in a 64-bit register do not need to stay zero or --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822471; cv=none; d=zohomail.com; s=zohoarc; b=dU6wUea0Fa3pQ0kpsT2EJNGeh2JtN0UIxohZBpMyHxZCBXXi/mHC9sf4AN4l3Z/fv+VXfW4LFQFXZSVZBk6Zc/fz1xn/SDLWKD7fc1b20l0DtLHj4ZZfKqO9Oh2qlOvBIgP/yNazUhrHyjeDkQlQApJhGe3KsV9jwuDxcmOBP8g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822471; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZPRAx5YETBqoL7VyE1c9XODTcIwclR3GJzVrX98m0+Q=; b=dlaksKAOlwi1jjEW/H+/NTmGjObwzzQgVgjv+bZ9g1g7eGlxObbfGm/+wygMNSihxJYHsjKER9m7aOFY66HLC9x5wPkA4DIuuYnZcM4MwCpUgA1WEjoptK+0rmPZBCF+nStFmCE+vy+l2bZD+Rry+KJhYCjNZokV/QINGB2Ihvc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822471760115.39556123366663; Wed, 23 Aug 2023 13:27:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOl-0000XF-Tx; Wed, 23 Aug 2023 16:24:15 -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 1qYuOV-0008L3-8W for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:59 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOK-0005UP-EQ for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:55 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-68a4bcf8a97so2873661b3a.1 for ; Wed, 23 Aug 2023 13:23:43 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822222; x=1693427022; 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=ZPRAx5YETBqoL7VyE1c9XODTcIwclR3GJzVrX98m0+Q=; b=C3qloZVGNtJvHs1ZTBMVHKAgEQbIEFcne2M2J5kZHlv0qbLCHmi9bfvzv4DKa7XxwN 4e3ipQ3UpHB4ONb84f5dFtNuuGL3QOYFr4ZhHf+l37BC/bW/RZySg+q75XboepwaRvvO NCGiF3DICsXpmNr5Y8hhP13+uPmadBiIgg4UWuZr0qjJLGSOavsOiAhlQdJpycrvyU7r LabwMhn5FvbP7+t3pXSMmTKqFxQyDV2u+cIFe8ny7qyha+aSTsOcxr7dlp8bIFE2lTrA TLoNziRgBDGwTBKrxU3AJzqyEgRxXw0ta6AHMN48xA9MxnI5z54q5A3PujQTE808ToH0 cLlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822222; x=1693427022; 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=ZPRAx5YETBqoL7VyE1c9XODTcIwclR3GJzVrX98m0+Q=; b=lOUl4tCOjr4nF+95MjcAh/GjFP4tzmmtBocsUT+PanQ8JlbgVi7cec3YTzpRVmoL8t R4SSE+g1U7F+qnUeGF5Hg5TI7AN6qGZRsFyw+USyuLphKu9IwwLOdjRU9tJS07Fq+hoM vEa/HRG3hlDo5195/4DlJ23mVUFf0Ou2nJilEeV3SwCR2OGd0z6RFmaX9Rp+mA26fB9x wW5eMeZIe5zqdW07e4cLGg1X3d2Fm176KU5BgA/tnAS0moSVvD0SHMXLSV5DwofC0t6V L4oSa2MvNYH4DVvvfzmMIYrZyQVa5Hkup2+aTqEWNlP4bIf82YAXiyCkNNiVn0Rg5Z/O 34Bw== X-Gm-Message-State: AOJu0Yz/cUOw6wodN+wKo7KoqYs37bm5gKhZjkGAWKuNNa3wtWRLgWsR sbv2vPGchZY1JeiwvIDNJPZTWygeKLboDcoDFaY= X-Google-Smtp-Source: AGHT+IG4XcG2XewdTGOPNWbEJad8/e7sQjzmn+nUU7Ih83TDYQ0TxfcMflWBZfU2uoD1iY7hSp7C8A== X-Received: by 2002:a05:6a21:33a7:b0:12f:90d8:9755 with SMTP id yy39-20020a056a2133a700b0012f90d89755mr14416389pzb.15.1692822222019; Wed, 23 Aug 2023 13:23:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 15/48] tcg: Unify TCG_TARGET_HAS_extr[lh]_i64_i32 Date: Wed, 23 Aug 2023 13:22:53 -0700 Message-Id: <20230823202326.1353645-16-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822473452100009 Replace the separate defines with TCG_TARGET_HAS_extr_i64_i32, so that the two parts of backend-specific type changing cannot be out of sync. Reported-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Richard Henderson Message-id: <20230822175127.1173698-1-richard.henderson@linaro.org> --- include/tcg/tcg-opc.h | 4 ++-- include/tcg/tcg.h | 3 +-- tcg/aarch64/tcg-target.h | 3 +-- tcg/i386/tcg-target.h | 3 +-- tcg/loongarch64/tcg-target.h | 3 +-- tcg/mips/tcg-target.h | 3 +-- tcg/ppc/tcg-target.h | 3 +-- tcg/riscv/tcg-target.h | 3 +-- tcg/s390x/tcg-target.h | 3 +-- tcg/sparc64/tcg-target.h | 3 +-- tcg/tci/tcg-target.h | 3 +-- tcg/tcg-op.c | 4 ++-- tcg/tcg.c | 3 +-- 13 files changed, 15 insertions(+), 26 deletions(-) diff --git a/include/tcg/tcg-opc.h b/include/tcg/tcg-opc.h index acfa5ba753..c64dfe558c 100644 --- a/include/tcg/tcg-opc.h +++ b/include/tcg/tcg-opc.h @@ -152,10 +152,10 @@ DEF(extract2_i64, 1, 2, 1, IMPL64 | IMPL(TCG_TARGET_H= AS_extract2_i64)) DEF(ext_i32_i64, 1, 1, 0, IMPL64) DEF(extu_i32_i64, 1, 1, 0, IMPL64) DEF(extrl_i64_i32, 1, 1, 0, - IMPL(TCG_TARGET_HAS_extrl_i64_i32) + IMPL(TCG_TARGET_HAS_extr_i64_i32) | (TCG_TARGET_REG_BITS =3D=3D 32 ? TCG_OPF_NOT_PRESENT : 0)) DEF(extrh_i64_i32, 1, 1, 0, - IMPL(TCG_TARGET_HAS_extrh_i64_i32) + IMPL(TCG_TARGET_HAS_extr_i64_i32) | (TCG_TARGET_REG_BITS =3D=3D 32 ? TCG_OPF_NOT_PRESENT : 0)) =20 DEF(brcond_i64, 0, 2, 2, TCG_OPF_BB_END | TCG_OPF_COND_BRANCH | IMPL64) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 0875971719..ea7e55eeb8 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -68,8 +68,7 @@ typedef uint64_t TCGRegSet; =20 #if TCG_TARGET_REG_BITS =3D=3D 32 /* Turn some undef macros into false macros. */ -#define TCG_TARGET_HAS_extrl_i64_i32 0 -#define TCG_TARGET_HAS_extrh_i64_i32 0 +#define TCG_TARGET_HAS_extr_i64_i32 0 #define TCG_TARGET_HAS_div_i64 0 #define TCG_TARGET_HAS_rem_i64 0 #define TCG_TARGET_HAS_div2_i64 0 diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index ce64de06e5..12765cc281 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -92,8 +92,7 @@ typedef enum { #define TCG_TARGET_HAS_muls2_i32 0 #define TCG_TARGET_HAS_muluh_i32 0 #define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_extrl_i64_i32 0 -#define TCG_TARGET_HAS_extrh_i64_i32 0 +#define TCG_TARGET_HAS_extr_i64_i32 0 #define TCG_TARGET_HAS_qemu_st8_i32 0 =20 #define TCG_TARGET_HAS_div_i64 1 diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index 30cce01ca4..32dd795259 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -159,8 +159,7 @@ typedef enum { =20 #if TCG_TARGET_REG_BITS =3D=3D 64 /* Keep 32-bit values zero-extended in a register. */ -#define TCG_TARGET_HAS_extrl_i64_i32 1 -#define TCG_TARGET_HAS_extrh_i64_i32 1 +#define TCG_TARGET_HAS_extr_i64_i32 1 #define TCG_TARGET_HAS_div2_i64 1 #define TCG_TARGET_HAS_rot_i64 1 #define TCG_TARGET_HAS_ext8s_i64 1 diff --git a/tcg/loongarch64/tcg-target.h b/tcg/loongarch64/tcg-target.h index 26f1aab780..c94e0c6044 100644 --- a/tcg/loongarch64/tcg-target.h +++ b/tcg/loongarch64/tcg-target.h @@ -130,8 +130,7 @@ typedef enum { #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_extrl_i64_i32 1 -#define TCG_TARGET_HAS_extrh_i64_i32 1 +#define TCG_TARGET_HAS_extr_i64_i32 1 #define TCG_TARGET_HAS_ext8s_i64 1 #define TCG_TARGET_HAS_ext16s_i64 1 #define TCG_TARGET_HAS_ext32s_i64 1 diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index dd2efa795c..bdfa25bef4 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -132,8 +132,7 @@ extern bool use_mips32r2_instructions; #if TCG_TARGET_REG_BITS =3D=3D 64 #define TCG_TARGET_HAS_add2_i32 0 #define TCG_TARGET_HAS_sub2_i32 0 -#define TCG_TARGET_HAS_extrl_i64_i32 1 -#define TCG_TARGET_HAS_extrh_i64_i32 1 +#define TCG_TARGET_HAS_extr_i64_i32 1 #define TCG_TARGET_HAS_div_i64 1 #define TCG_TARGET_HAS_rem_i64 1 #define TCG_TARGET_HAS_not_i64 1 diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index 9a41fab8cc..37b54e6aeb 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -106,8 +106,7 @@ typedef enum { #if TCG_TARGET_REG_BITS =3D=3D 64 #define TCG_TARGET_HAS_add2_i32 0 #define TCG_TARGET_HAS_sub2_i32 0 -#define TCG_TARGET_HAS_extrl_i64_i32 0 -#define TCG_TARGET_HAS_extrh_i64_i32 0 +#define TCG_TARGET_HAS_extr_i64_i32 0 #define TCG_TARGET_HAS_div_i64 1 #define TCG_TARGET_HAS_rem_i64 have_isa_3_00 #define TCG_TARGET_HAS_rot_i64 1 diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h index e1d8110ee4..6cbd226ca9 100644 --- a/tcg/riscv/tcg-target.h +++ b/tcg/riscv/tcg-target.h @@ -131,8 +131,7 @@ extern bool have_zbb; #define TCG_TARGET_HAS_extract_i64 0 #define TCG_TARGET_HAS_sextract_i64 0 #define TCG_TARGET_HAS_extract2_i64 0 -#define TCG_TARGET_HAS_extrl_i64_i32 1 -#define TCG_TARGET_HAS_extrh_i64_i32 1 +#define TCG_TARGET_HAS_extr_i64_i32 1 #define TCG_TARGET_HAS_ext8s_i64 1 #define TCG_TARGET_HAS_ext16s_i64 1 #define TCG_TARGET_HAS_ext32s_i64 1 diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h index 9a405003b9..2edc2056ba 100644 --- a/tcg/s390x/tcg-target.h +++ b/tcg/s390x/tcg-target.h @@ -102,8 +102,7 @@ extern uint64_t s390_facilities[3]; #define TCG_TARGET_HAS_muls2_i32 0 #define TCG_TARGET_HAS_muluh_i32 0 #define TCG_TARGET_HAS_mulsh_i32 0 -#define TCG_TARGET_HAS_extrl_i64_i32 0 -#define TCG_TARGET_HAS_extrh_i64_i32 0 +#define TCG_TARGET_HAS_extr_i64_i32 0 #define TCG_TARGET_HAS_qemu_st8_i32 0 =20 #define TCG_TARGET_HAS_div2_i64 1 diff --git a/tcg/sparc64/tcg-target.h b/tcg/sparc64/tcg-target.h index d454278811..682e6f1613 100644 --- a/tcg/sparc64/tcg-target.h +++ b/tcg/sparc64/tcg-target.h @@ -114,8 +114,7 @@ extern bool use_vis3_instructions; #define TCG_TARGET_HAS_mulsh_i32 0 #define TCG_TARGET_HAS_qemu_st8_i32 0 =20 -#define TCG_TARGET_HAS_extrl_i64_i32 1 -#define TCG_TARGET_HAS_extrh_i64_i32 1 +#define TCG_TARGET_HAS_extr_i64_i32 1 #define TCG_TARGET_HAS_div_i64 1 #define TCG_TARGET_HAS_rem_i64 0 #define TCG_TARGET_HAS_rot_i64 0 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 37ee10c959..d33185fb36 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -76,8 +76,7 @@ #define TCG_TARGET_HAS_qemu_st8_i32 0 =20 #if TCG_TARGET_REG_BITS =3D=3D 64 -#define TCG_TARGET_HAS_extrl_i64_i32 0 -#define TCG_TARGET_HAS_extrh_i64_i32 0 +#define TCG_TARGET_HAS_extr_i64_i32 0 #define TCG_TARGET_HAS_bswap16_i64 1 #define TCG_TARGET_HAS_bswap32_i64 1 #define TCG_TARGET_HAS_bswap64_i64 1 diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 7aadb37756..68b93a3d4b 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -2681,7 +2681,7 @@ void tcg_gen_extrl_i64_i32(TCGv_i32 ret, TCGv_i64 arg) { if (TCG_TARGET_REG_BITS =3D=3D 32) { tcg_gen_mov_i32(ret, TCGV_LOW(arg)); - } else if (TCG_TARGET_HAS_extrl_i64_i32) { + } else if (TCG_TARGET_HAS_extr_i64_i32) { tcg_gen_op2(INDEX_op_extrl_i64_i32, tcgv_i32_arg(ret), tcgv_i64_arg(arg)); } else { @@ -2693,7 +2693,7 @@ void tcg_gen_extrh_i64_i32(TCGv_i32 ret, TCGv_i64 arg) { if (TCG_TARGET_REG_BITS =3D=3D 32) { tcg_gen_mov_i32(ret, TCGV_HIGH(arg)); - } else if (TCG_TARGET_HAS_extrh_i64_i32) { + } else if (TCG_TARGET_HAS_extr_i64_i32) { tcg_gen_op2(INDEX_op_extrh_i64_i32, tcgv_i32_arg(ret), tcgv_i64_arg(arg)); } else { diff --git a/tcg/tcg.c b/tcg/tcg.c index ddfe9a96cb..a23348824b 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2000,9 +2000,8 @@ bool tcg_op_supported(TCGOpcode op) case INDEX_op_extract2_i64: return TCG_TARGET_HAS_extract2_i64; case INDEX_op_extrl_i64_i32: - return TCG_TARGET_HAS_extrl_i64_i32; case INDEX_op_extrh_i64_i32: - return TCG_TARGET_HAS_extrh_i64_i32; + return TCG_TARGET_HAS_extr_i64_i32; case INDEX_op_ext8s_i64: return TCG_TARGET_HAS_ext8s_i64; case INDEX_op_ext16s_i64: --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822514; cv=none; d=zohomail.com; s=zohoarc; b=S3uammoKlir/eET6n04h5KRdPNarIVNP/0JPHHzCwJ2AaDq8WKF/1eghzbG5vTPhdhdRWiuZmVqmTnLCzlh0z9WyYfoQ7z3orprNGQvL19GncHT6vRXVAzFyynTCZbXzyuV8R4HJKc6vpMVov9aE2tlBxNmmOaZmoHLluA3kvso= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822514; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=I7qig1c5iaSpJ+dJ+04qBmesjer5eZaJLaHZS6o9BNI=; b=fItrNcE/mo0l6S8h0fy4yP4T3h9UBQF+miruF0H2qzAjY49JI3tD7Wd0N3kJIS5JLBEEk0NFr4+3RkzOjojiXJE50f9f7jGRYzjmt3K5GljCd5g9DY0Jsg1uYshR46XzamKDvbYzdy1qSWFpa/v4bnGCaXh2Y2D5qoqjbzNX3Rk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822514059154.55955194959563; Wed, 23 Aug 2023 13:28:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOf-0000DF-Hs; Wed, 23 Aug 2023 16:24:09 -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 1qYuOV-0008Kv-3E for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:59 -0400 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOK-0005UT-Ja for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:51 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1bdc19b782aso41151265ad.0 for ; Wed, 23 Aug 2023 13:23:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822223; x=1693427023; 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=I7qig1c5iaSpJ+dJ+04qBmesjer5eZaJLaHZS6o9BNI=; b=PAVqndzr8asHPfs87ldf+ThUdkrRADKIN7vbK7XinB6GaItKbpxCFQztkS16b/X03g t8GdFoexB1ZqYBiI8dCRJ4GAdkLfKU2uC+siMwIEZp0LhXxBKB9fofE/ZID/JCRdkFCO rn3DreuB0hw/X5sVPxQl5Cp3mW8mXVVwXVZ9VUIFESliyrha7et0mjV/ToZmxZiAurp9 eTPYYBtR/L1BwIRKaQFg4cdcgPXOaSaMmRk34/HTHxGoexTIIMvIelCjsKyoMchRgWo0 k3Pa76HXGU1ta7kOGjAmJl4mGknEGRG48xg2wRVcQ10N5sOfzYgMZyh+LKGLZyXdNNCk Rirg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822223; x=1693427023; 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=I7qig1c5iaSpJ+dJ+04qBmesjer5eZaJLaHZS6o9BNI=; b=G7kQ+Z43oBpd6rLlu6cvuayCsDyAloqaxnYueAQVCjoIUSl145eckNCAjKkDe7bbd8 H2SYeJhXs4OlJQSRhG19S3wrMU1PRVIVc+FgKxXAERKED20jI+HDWVBPIwAGZtH4ZFhZ n9PmbhvXvV2awur+Sy7DCMLEP9CQBk3pum5R/xyOPFERp79TZhGcEIDmVuSGhJa76wdS fsLfsQ9H8/cMOI0D5eQDuuQAWzQi6F7906WdP7X8X2X63dzJw3qi4iNdNA4qRKsUS15c /A82ElqdWhffocGnxeB6BW0YdQSuxabnAJ1cHj+niXh2VgBjrrXm/vFSvCFZAscW+2t6 HALQ== X-Gm-Message-State: AOJu0YzCcJfyDYg9JaRT5F9Hwt3rg8QwMHREM9SIlSjlmuHdxTvF35/2 OAvrl2xTZeQ1oNa+x0JHtYMXA2R+hhyeCKbGJC4= X-Google-Smtp-Source: AGHT+IHsQZI5h5EmxVZrWs5XS5MkDcIU5tUZnYKznp10RWOglYimckjZ6b/t9hnj+9ssa6ZnFeNdlA== X-Received: by 2002:a17:902:e54c:b0:1bb:c7bc:ceb4 with SMTP id n12-20020a170902e54c00b001bbc7bcceb4mr14133500plf.60.1692822222893; Wed, 23 Aug 2023 13:23:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 16/48] tcg: Introduce negsetcond opcodes Date: Wed, 23 Aug 2023 13:22:54 -0700 Message-Id: <20230823202326.1353645-17-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822515786100001 Content-Type: text/plain; charset="utf-8" Introduce a new opcode for negative setcond. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- docs/devel/tcg-ops.rst | 6 ++++++ include/tcg/tcg-op-common.h | 4 ++++ include/tcg/tcg-op.h | 2 ++ include/tcg/tcg-opc.h | 2 ++ include/tcg/tcg.h | 1 + tcg/aarch64/tcg-target.h | 2 ++ tcg/arm/tcg-target.h | 1 + tcg/i386/tcg-target.h | 2 ++ tcg/loongarch64/tcg-target.h | 3 +++ tcg/mips/tcg-target.h | 2 ++ tcg/ppc/tcg-target.h | 2 ++ tcg/riscv/tcg-target.h | 2 ++ tcg/s390x/tcg-target.h | 2 ++ tcg/sparc64/tcg-target.h | 2 ++ tcg/tci/tcg-target.h | 2 ++ tcg/optimize.c | 41 +++++++++++++++++++++++++++++++++++- tcg/tcg-op.c | 36 +++++++++++++++++++++++++++++++ tcg/tcg.c | 6 ++++++ 18 files changed, 117 insertions(+), 1 deletion(-) diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst index 53695e1623..9e2a931d85 100644 --- a/docs/devel/tcg-ops.rst +++ b/docs/devel/tcg-ops.rst @@ -498,6 +498,12 @@ Conditional moves | | Set *dest* to 1 if (*t1* *cond* *t2*) is true, otherwise set to 0. =20 + * - negsetcond_i32/i64 *dest*, *t1*, *t2*, *cond* + + - | *dest* =3D -(*t1* *cond* *t2*) + | + | Set *dest* to -1 if (*t1* *cond* *t2*) is true, otherwise set to = 0. + * - movcond_i32/i64 *dest*, *c1*, *c2*, *v1*, *v2*, *cond* =20 - | *dest* =3D (*c1* *cond* *c2* ? *v1* : *v2*) diff --git a/include/tcg/tcg-op-common.h b/include/tcg/tcg-op-common.h index be382bbf77..a53b15933b 100644 --- a/include/tcg/tcg-op-common.h +++ b/include/tcg/tcg-op-common.h @@ -344,6 +344,8 @@ void tcg_gen_setcond_i32(TCGCond cond, TCGv_i32 ret, TCGv_i32 arg1, TCGv_i32 arg2); void tcg_gen_setcondi_i32(TCGCond cond, TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2); +void tcg_gen_negsetcond_i32(TCGCond cond, TCGv_i32 ret, + TCGv_i32 arg1, TCGv_i32 arg2); void tcg_gen_movcond_i32(TCGCond cond, TCGv_i32 ret, TCGv_i32 c1, TCGv_i32 c2, TCGv_i32 v1, TCGv_i32 v2); void tcg_gen_add2_i32(TCGv_i32 rl, TCGv_i32 rh, TCGv_i32 al, @@ -540,6 +542,8 @@ void tcg_gen_setcond_i64(TCGCond cond, TCGv_i64 ret, TCGv_i64 arg1, TCGv_i64 arg2); void tcg_gen_setcondi_i64(TCGCond cond, TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2); +void tcg_gen_negsetcond_i64(TCGCond cond, TCGv_i64 ret, + TCGv_i64 arg1, TCGv_i64 arg2); void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret, TCGv_i64 c1, TCGv_i64 c2, TCGv_i64 v1, TCGv_i64 v2); void tcg_gen_add2_i64(TCGv_i64 rl, TCGv_i64 rh, TCGv_i64 al, diff --git a/include/tcg/tcg-op.h b/include/tcg/tcg-op.h index d63683c47b..80cfcf8104 100644 --- a/include/tcg/tcg-op.h +++ b/include/tcg/tcg-op.h @@ -200,6 +200,7 @@ DEF_ATOMIC2(tcg_gen_atomic_umax_fetch, i64) #define tcg_gen_brcondi_tl tcg_gen_brcondi_i64 #define tcg_gen_setcond_tl tcg_gen_setcond_i64 #define tcg_gen_setcondi_tl tcg_gen_setcondi_i64 +#define tcg_gen_negsetcond_tl tcg_gen_negsetcond_i64 #define tcg_gen_mul_tl tcg_gen_mul_i64 #define tcg_gen_muli_tl tcg_gen_muli_i64 #define tcg_gen_div_tl tcg_gen_div_i64 @@ -317,6 +318,7 @@ DEF_ATOMIC2(tcg_gen_atomic_umax_fetch, i64) #define tcg_gen_brcondi_tl tcg_gen_brcondi_i32 #define tcg_gen_setcond_tl tcg_gen_setcond_i32 #define tcg_gen_setcondi_tl tcg_gen_setcondi_i32 +#define tcg_gen_negsetcond_tl tcg_gen_negsetcond_i32 #define tcg_gen_mul_tl tcg_gen_mul_i32 #define tcg_gen_muli_tl tcg_gen_muli_i32 #define tcg_gen_div_tl tcg_gen_div_i32 diff --git a/include/tcg/tcg-opc.h b/include/tcg/tcg-opc.h index c64dfe558c..6eff3d9106 100644 --- a/include/tcg/tcg-opc.h +++ b/include/tcg/tcg-opc.h @@ -46,6 +46,7 @@ DEF(mb, 0, 0, 1, 0) =20 DEF(mov_i32, 1, 1, 0, TCG_OPF_NOT_PRESENT) DEF(setcond_i32, 1, 2, 1, 0) +DEF(negsetcond_i32, 1, 2, 1, IMPL(TCG_TARGET_HAS_negsetcond_i32)) DEF(movcond_i32, 1, 4, 1, IMPL(TCG_TARGET_HAS_movcond_i32)) /* load/store */ DEF(ld8u_i32, 1, 1, 1, 0) @@ -111,6 +112,7 @@ DEF(ctpop_i32, 1, 1, 0, IMPL(TCG_TARGET_HAS_ctpop_i32)) =20 DEF(mov_i64, 1, 1, 0, TCG_OPF_64BIT | TCG_OPF_NOT_PRESENT) DEF(setcond_i64, 1, 2, 1, IMPL64) +DEF(negsetcond_i64, 1, 2, 1, IMPL64 | IMPL(TCG_TARGET_HAS_negsetcond_i64)) DEF(movcond_i64, 1, 4, 1, IMPL64 | IMPL(TCG_TARGET_HAS_movcond_i64)) /* load/store */ DEF(ld8u_i64, 1, 1, 1, IMPL64) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index ea7e55eeb8..61d7c81b44 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -97,6 +97,7 @@ typedef uint64_t TCGRegSet; #define TCG_TARGET_HAS_sextract_i64 0 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_movcond_i64 0 +#define TCG_TARGET_HAS_negsetcond_i64 0 #define TCG_TARGET_HAS_add2_i64 0 #define TCG_TARGET_HAS_sub2_i64 0 #define TCG_TARGET_HAS_mulu2_i64 0 diff --git a/tcg/aarch64/tcg-target.h b/tcg/aarch64/tcg-target.h index 12765cc281..bfa3e5aae9 100644 --- a/tcg/aarch64/tcg-target.h +++ b/tcg/aarch64/tcg-target.h @@ -86,6 +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_add2_i32 1 #define TCG_TARGET_HAS_sub2_i32 1 #define TCG_TARGET_HAS_mulu2_i32 0 @@ -122,6 +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_add2_i64 1 #define TCG_TARGET_HAS_sub2_i64 1 #define TCG_TARGET_HAS_mulu2_i64 0 diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index c649db72a6..ad66f11574 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -116,6 +116,7 @@ extern bool use_neon_instructions; #define TCG_TARGET_HAS_sextract_i32 use_armv7_instructions #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_mulu2_i32 1 #define TCG_TARGET_HAS_muls2_i32 1 #define TCG_TARGET_HAS_muluh_i32 0 diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index 32dd795259..ebc0b1a6ce 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -150,6 +150,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_add2_i32 1 #define TCG_TARGET_HAS_sub2_i32 1 #define TCG_TARGET_HAS_mulu2_i32 1 @@ -186,6 +187,7 @@ typedef enum { #define TCG_TARGET_HAS_sextract_i64 0 #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_add2_i64 1 #define TCG_TARGET_HAS_sub2_i64 1 #define TCG_TARGET_HAS_mulu2_i64 1 diff --git a/tcg/loongarch64/tcg-target.h b/tcg/loongarch64/tcg-target.h index c94e0c6044..559be67186 100644 --- a/tcg/loongarch64/tcg-target.h +++ b/tcg/loongarch64/tcg-target.h @@ -86,6 +86,7 @@ typedef enum { =20 /* optional instructions */ #define TCG_TARGET_HAS_movcond_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 0 #define TCG_TARGET_HAS_div_i32 1 #define TCG_TARGET_HAS_rem_i32 1 #define TCG_TARGET_HAS_div2_i32 0 @@ -122,6 +123,7 @@ typedef enum { =20 /* 64-bit operations */ #define TCG_TARGET_HAS_movcond_i64 1 +#define TCG_TARGET_HAS_negsetcond_i64 0 #define TCG_TARGET_HAS_div_i64 1 #define TCG_TARGET_HAS_rem_i64 1 #define TCG_TARGET_HAS_div2_i64 0 @@ -156,6 +158,7 @@ typedef enum { #define TCG_TARGET_HAS_muls2_i64 0 #define TCG_TARGET_HAS_muluh_i64 1 #define TCG_TARGET_HAS_mulsh_i64 1 + #define TCG_TARGET_HAS_qemu_ldst_i128 0 =20 #define TCG_TARGET_DEFAULT_MO (0) diff --git a/tcg/mips/tcg-target.h b/tcg/mips/tcg-target.h index bdfa25bef4..c0576f66d7 100644 --- a/tcg/mips/tcg-target.h +++ b/tcg/mips/tcg-target.h @@ -128,6 +128,7 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_muluh_i32 1 #define TCG_TARGET_HAS_mulsh_i32 1 #define TCG_TARGET_HAS_bswap32_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 0 =20 #if TCG_TARGET_REG_BITS =3D=3D 64 #define TCG_TARGET_HAS_add2_i32 0 @@ -149,6 +150,7 @@ extern bool use_mips32r2_instructions; #define TCG_TARGET_HAS_mulsh_i64 1 #define TCG_TARGET_HAS_ext32s_i64 1 #define TCG_TARGET_HAS_ext32u_i64 1 +#define TCG_TARGET_HAS_negsetcond_i64 0 #endif =20 /* optional instructions detected at runtime */ diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index 37b54e6aeb..a2ca0b44ce 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -97,6 +97,7 @@ typedef enum { #define TCG_TARGET_HAS_sextract_i32 0 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_movcond_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 0 #define TCG_TARGET_HAS_mulu2_i32 0 #define TCG_TARGET_HAS_muls2_i32 0 #define TCG_TARGET_HAS_muluh_i32 1 @@ -134,6 +135,7 @@ typedef enum { #define TCG_TARGET_HAS_sextract_i64 0 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_movcond_i64 1 +#define TCG_TARGET_HAS_negsetcond_i64 0 #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/riscv/tcg-target.h b/tcg/riscv/tcg-target.h index 6cbd226ca9..0efb3fc0b8 100644 --- a/tcg/riscv/tcg-target.h +++ b/tcg/riscv/tcg-target.h @@ -88,6 +88,7 @@ extern bool have_zbb; =20 /* optional instructions */ #define TCG_TARGET_HAS_movcond_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 0 #define TCG_TARGET_HAS_div_i32 1 #define TCG_TARGET_HAS_rem_i32 1 #define TCG_TARGET_HAS_div2_i32 0 @@ -123,6 +124,7 @@ extern bool have_zbb; #define TCG_TARGET_HAS_qemu_st8_i32 0 =20 #define TCG_TARGET_HAS_movcond_i64 1 +#define TCG_TARGET_HAS_negsetcond_i64 0 #define TCG_TARGET_HAS_div_i64 1 #define TCG_TARGET_HAS_rem_i64 1 #define TCG_TARGET_HAS_div2_i64 0 diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h index 2edc2056ba..123a4b1645 100644 --- a/tcg/s390x/tcg-target.h +++ b/tcg/s390x/tcg-target.h @@ -96,6 +96,7 @@ extern uint64_t s390_facilities[3]; #define TCG_TARGET_HAS_sextract_i32 0 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_movcond_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 0 #define TCG_TARGET_HAS_add2_i32 1 #define TCG_TARGET_HAS_sub2_i32 1 #define TCG_TARGET_HAS_mulu2_i32 0 @@ -131,6 +132,7 @@ extern uint64_t s390_facilities[3]; #define TCG_TARGET_HAS_sextract_i64 0 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_movcond_i64 1 +#define TCG_TARGET_HAS_negsetcond_i64 0 #define TCG_TARGET_HAS_add2_i64 1 #define TCG_TARGET_HAS_sub2_i64 1 #define TCG_TARGET_HAS_mulu2_i64 1 diff --git a/tcg/sparc64/tcg-target.h b/tcg/sparc64/tcg-target.h index 682e6f1613..79889db760 100644 --- a/tcg/sparc64/tcg-target.h +++ b/tcg/sparc64/tcg-target.h @@ -106,6 +106,7 @@ extern bool use_vis3_instructions; #define TCG_TARGET_HAS_sextract_i32 0 #define TCG_TARGET_HAS_extract2_i32 0 #define TCG_TARGET_HAS_movcond_i32 1 +#define TCG_TARGET_HAS_negsetcond_i32 0 #define TCG_TARGET_HAS_add2_i32 1 #define TCG_TARGET_HAS_sub2_i32 1 #define TCG_TARGET_HAS_mulu2_i32 1 @@ -142,6 +143,7 @@ extern bool use_vis3_instructions; #define TCG_TARGET_HAS_sextract_i64 0 #define TCG_TARGET_HAS_extract2_i64 0 #define TCG_TARGET_HAS_movcond_i64 1 +#define TCG_TARGET_HAS_negsetcond_i64 0 #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/tci/tcg-target.h b/tcg/tci/tcg-target.h index d33185fb36..91ca33b616 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -70,6 +70,7 @@ #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_negsetcond_i32 0 #define TCG_TARGET_HAS_muls2_i32 1 #define TCG_TARGET_HAS_muluh_i32 0 #define TCG_TARGET_HAS_mulsh_i32 0 @@ -104,6 +105,7 @@ #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_negsetcond_i64 0 #define TCG_TARGET_HAS_muls2_i64 1 #define TCG_TARGET_HAS_add2_i32 1 #define TCG_TARGET_HAS_sub2_i32 1 diff --git a/tcg/optimize.c b/tcg/optimize.c index bbd9bb64c6..3013eb04e6 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1567,14 +1567,22 @@ static bool fold_movcond(OptContext *ctx, TCGOp *op) if (arg_is_const(op->args[3]) && arg_is_const(op->args[4])) { uint64_t tv =3D arg_info(op->args[3])->val; uint64_t fv =3D arg_info(op->args[4])->val; - TCGOpcode opc; + TCGOpcode opc, negopc =3D 0; =20 switch (ctx->type) { case TCG_TYPE_I32: opc =3D INDEX_op_setcond_i32; + if (TCG_TARGET_HAS_negsetcond_i32) { + negopc =3D INDEX_op_negsetcond_i32; + } + tv =3D (int32_t)tv; + fv =3D (int32_t)fv; break; case TCG_TYPE_I64: opc =3D INDEX_op_setcond_i64; + if (TCG_TARGET_HAS_negsetcond_i64) { + negopc =3D INDEX_op_negsetcond_i64; + } break; default: g_assert_not_reached(); @@ -1586,6 +1594,14 @@ static bool fold_movcond(OptContext *ctx, TCGOp *op) } else if (fv =3D=3D 1 && tv =3D=3D 0) { op->opc =3D opc; op->args[3] =3D tcg_invert_cond(cond); + } else if (negopc) { + if (tv =3D=3D -1 && fv =3D=3D 0) { + op->opc =3D negopc; + op->args[3] =3D cond; + } else if (fv =3D=3D -1 && tv =3D=3D 0) { + op->opc =3D negopc; + op->args[3] =3D tcg_invert_cond(cond); + } } } return false; @@ -1796,6 +1812,26 @@ static bool fold_setcond(OptContext *ctx, TCGOp *op) return false; } =20 +static bool fold_negsetcond(OptContext *ctx, TCGOp *op) +{ + TCGCond cond =3D op->args[3]; + int i; + + if (swap_commutative(op->args[0], &op->args[1], &op->args[2])) { + op->args[3] =3D cond =3D tcg_swap_cond(cond); + } + + i =3D do_constant_folding_cond(ctx->type, op->args[1], op->args[2], co= nd); + if (i >=3D 0) { + return tcg_opt_gen_movi(ctx, op, op->args[0], -i); + } + + /* Value is {0,-1} so all bits are repetitions of the sign. */ + ctx->s_mask =3D -1; + return false; +} + + static bool fold_setcond2(OptContext *ctx, TCGOp *op) { TCGCond cond =3D op->args[5]; @@ -2253,6 +2289,9 @@ void tcg_optimize(TCGContext *s) CASE_OP_32_64(setcond): done =3D fold_setcond(&ctx, op); break; + CASE_OP_32_64(negsetcond): + done =3D fold_negsetcond(&ctx, op); + break; case INDEX_op_setcond2_i32: done =3D fold_setcond2(&ctx, op); break; diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 68b93a3d4b..a954004cff 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -276,6 +276,21 @@ void tcg_gen_setcondi_i32(TCGCond cond, TCGv_i32 ret, tcg_gen_setcond_i32(cond, ret, arg1, tcg_constant_i32(arg2)); } =20 +void tcg_gen_negsetcond_i32(TCGCond cond, TCGv_i32 ret, + TCGv_i32 arg1, TCGv_i32 arg2) +{ + if (cond =3D=3D TCG_COND_ALWAYS) { + tcg_gen_movi_i32(ret, -1); + } else if (cond =3D=3D TCG_COND_NEVER) { + tcg_gen_movi_i32(ret, 0); + } else if (TCG_TARGET_HAS_negsetcond_i32) { + tcg_gen_op4i_i32(INDEX_op_negsetcond_i32, ret, arg1, arg2, cond); + } else { + tcg_gen_setcond_i32(cond, ret, arg1, arg2); + tcg_gen_neg_i32(ret, ret); + } +} + void tcg_gen_muli_i32(TCGv_i32 ret, TCGv_i32 arg1, int32_t arg2) { if (arg2 =3D=3D 0) { @@ -1567,6 +1582,27 @@ void tcg_gen_setcondi_i64(TCGCond cond, TCGv_i64 ret, } } =20 +void tcg_gen_negsetcond_i64(TCGCond cond, TCGv_i64 ret, + TCGv_i64 arg1, TCGv_i64 arg2) +{ + if (cond =3D=3D TCG_COND_ALWAYS) { + tcg_gen_movi_i64(ret, -1); + } else if (cond =3D=3D TCG_COND_NEVER) { + tcg_gen_movi_i64(ret, 0); + } else if (TCG_TARGET_HAS_negsetcond_i64) { + tcg_gen_op4i_i64(INDEX_op_negsetcond_i64, ret, arg1, arg2, cond); + } else if (TCG_TARGET_REG_BITS =3D=3D 32) { + tcg_gen_op6i_i32(INDEX_op_setcond2_i32, TCGV_LOW(ret), + TCGV_LOW(arg1), TCGV_HIGH(arg1), + TCGV_LOW(arg2), TCGV_HIGH(arg2), cond); + tcg_gen_neg_i32(TCGV_LOW(ret), TCGV_LOW(ret)); + tcg_gen_mov_i32(TCGV_HIGH(ret), TCGV_LOW(ret)); + } else { + tcg_gen_setcond_i64(cond, ret, arg1, arg2); + tcg_gen_neg_i64(ret, ret); + } +} + void tcg_gen_muli_i64(TCGv_i64 ret, TCGv_i64 arg1, int64_t arg2) { if (arg2 =3D=3D 0) { diff --git a/tcg/tcg.c b/tcg/tcg.c index a23348824b..620dbe08da 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1879,6 +1879,8 @@ bool tcg_op_supported(TCGOpcode op) case INDEX_op_sar_i32: return true; =20 + case INDEX_op_negsetcond_i32: + return TCG_TARGET_HAS_negsetcond_i32; case INDEX_op_movcond_i32: return TCG_TARGET_HAS_movcond_i32; case INDEX_op_div_i32: @@ -1977,6 +1979,8 @@ bool tcg_op_supported(TCGOpcode op) case INDEX_op_extu_i32_i64: return TCG_TARGET_REG_BITS =3D=3D 64; =20 + case INDEX_op_negsetcond_i64: + return TCG_TARGET_HAS_negsetcond_i64; case INDEX_op_movcond_i64: return TCG_TARGET_HAS_movcond_i64; case INDEX_op_div_i64: @@ -2509,11 +2513,13 @@ static void tcg_dump_ops(TCGContext *s, FILE *f, bo= ol have_prefs) switch (c) { case INDEX_op_brcond_i32: case INDEX_op_setcond_i32: + case INDEX_op_negsetcond_i32: case INDEX_op_movcond_i32: case INDEX_op_brcond2_i32: case INDEX_op_setcond2_i32: case INDEX_op_brcond_i64: case INDEX_op_setcond_i64: + case INDEX_op_negsetcond_i64: case INDEX_op_movcond_i64: case INDEX_op_cmp_vec: case INDEX_op_cmpsel_vec: --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822453; cv=none; d=zohomail.com; s=zohoarc; b=D1vf1lI4EZBdSm0VHQxI55CAphJ56x/qeQAW93OG/+Gfl+cRu550AUlY8Yquq3P+D8BkQ1qdi90JAJfYwC24724ocFB4f8kGe0qtbp/HQFIbHLti3npcWc4byjBtH7lQGjmzTVaEdrjb/oico7a4i+2PFhaJs6YupH8lCIRzwqw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822453; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eu3fIpPsTAmAUm4CNWpy9XF1IfgRxwNd1C0FurvU9EA=; b=F+86raRkWIFvzSRGQU0j71eXzUdKUcMONHp1sBPdMWRIzvXeijfEBLCJho0DqVZFyLvyEhSHXsfviG/ucIQ8wQmPNuvYbxl733InlndiW4r1NuS0WwVNk51dYcmzmdu3VqaZX6BHzmF18urBzj77CyEcU5bVYWUo+Qz8VG5mrq0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822453363698.0904538167058; Wed, 23 Aug 2023 13:27:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOg-0000FG-8M; Wed, 23 Aug 2023 16:24:10 -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 1qYuOU-0008KE-LI for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:58 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOK-0005UX-EU for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:50 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1bdbbede5d4so48112635ad.2 for ; Wed, 23 Aug 2023 13:23:44 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822224; x=1693427024; 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=eu3fIpPsTAmAUm4CNWpy9XF1IfgRxwNd1C0FurvU9EA=; b=Tn7ULgmvymDzmEO/0adWQKiMu1+8bsu+kv4avgLomBL9O7/RrY1xzLrwBNAumN46KT 8bjQBPd4eg56H91K0kyxozPB2U3ctaxvqSz7h7o3NbM9QdwQEh6kL1WfRNuMoSg6vl/R v5yVnZ4ItFd4h3pvydf3OO09TCapol3jgxD+kOHSBkkSuCHw/NYmiOEpbifAFMaMfQRB lY303Ch7xDKr5VN/TyziH+UM/8a/T+JbOEfV45GQtESnxW736TztNLLXletq9lXn24HL ms6um1Z12GJbif5uecA0P6kheXJTPREi/6I6qf1px2bX2wFE0HoCuLGTbcLCbHCVAQTw +g1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822224; x=1693427024; 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=eu3fIpPsTAmAUm4CNWpy9XF1IfgRxwNd1C0FurvU9EA=; b=UGVBBuImhVlHT/RkVvxjscPqFguoonwtSfrkWMWKDr9G0wGq7jVus1tpaBYkDJD4hq 93qyOleQefq8TeDQ0aB+ApdmqE/fWm3yDL/UUmF++fEciEb6oGFYeifcTjSv2D1BM3zU QHx4tQwJeDklipjN0wMyQHsNPa4hTVMc1om+6zudG+f7iToHnW6HG2Dr+oUT1I3Iu7E/ gy4CkNE85JfbFQ+uuuVNWnA6KVXu0cmJIe3E961pWiXVEu56mlEk/vVhk6x8TEuL+LN9 rh76fG65PnLWmBQ42i6WonWGE13IfIh6DFgqoiuDLsRd4HEWWWP4a3VyDM39rJW4sYe6 mX6A== X-Gm-Message-State: AOJu0YxZdgzj8BlT25lz0SD0tU7lyt2wT7Cnw8xjkc7CK//hYD8pIY+s gM1fCJ4ojV0Nj40y7YWpEc/q9wdkeOnBUbRPRtA= X-Google-Smtp-Source: AGHT+IF4BYZqMnHIDPX3cNjojhrA/OO5ParXJLRViunzd7fhKK1lkPMPSD151ToWxadHlueSI3W8eQ== X-Received: by 2002:a17:903:447:b0:1b8:971c:b7b7 with SMTP id iw7-20020a170903044700b001b8971cb7b7mr13023515plb.56.1692822223775; Wed, 23 Aug 2023 13:23:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 17/48] tcg: Use tcg_gen_negsetcond_* Date: Wed, 23 Aug 2023 13:22:55 -0700 Message-Id: <20230823202326.1353645-18-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822454432100023 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/tcg-op-gvec.c | 6 ++---- tcg/tcg-op.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/tcg/tcg-op-gvec.c b/tcg/tcg-op-gvec.c index a062239804..e260a07c61 100644 --- a/tcg/tcg-op-gvec.c +++ b/tcg/tcg-op-gvec.c @@ -3692,8 +3692,7 @@ static void expand_cmp_i32(uint32_t dofs, uint32_t ao= fs, uint32_t bofs, for (i =3D 0; i < oprsz; i +=3D 4) { tcg_gen_ld_i32(t0, cpu_env, aofs + i); tcg_gen_ld_i32(t1, cpu_env, bofs + i); - tcg_gen_setcond_i32(cond, t0, t0, t1); - tcg_gen_neg_i32(t0, t0); + tcg_gen_negsetcond_i32(cond, t0, t0, t1); tcg_gen_st_i32(t0, cpu_env, dofs + i); } tcg_temp_free_i32(t1); @@ -3710,8 +3709,7 @@ static void expand_cmp_i64(uint32_t dofs, uint32_t ao= fs, uint32_t bofs, for (i =3D 0; i < oprsz; i +=3D 8) { tcg_gen_ld_i64(t0, cpu_env, aofs + i); tcg_gen_ld_i64(t1, cpu_env, bofs + i); - tcg_gen_setcond_i64(cond, t0, t0, t1); - tcg_gen_neg_i64(t0, t0); + tcg_gen_negsetcond_i64(cond, t0, t0, t1); tcg_gen_st_i64(t0, cpu_env, dofs + i); } tcg_temp_free_i64(t1); diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index a954004cff..b59a50a5a9 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -863,8 +863,7 @@ void tcg_gen_movcond_i32(TCGCond cond, TCGv_i32 ret, TC= Gv_i32 c1, } else { TCGv_i32 t0 =3D tcg_temp_ebb_new_i32(); TCGv_i32 t1 =3D tcg_temp_ebb_new_i32(); - tcg_gen_setcond_i32(cond, t0, c1, c2); - tcg_gen_neg_i32(t0, t0); + tcg_gen_negsetcond_i32(cond, t0, c1, c2); tcg_gen_and_i32(t1, v1, t0); tcg_gen_andc_i32(ret, v2, t0); tcg_gen_or_i32(ret, ret, t1); @@ -2563,8 +2562,7 @@ void tcg_gen_movcond_i64(TCGCond cond, TCGv_i64 ret, = TCGv_i64 c1, } else { TCGv_i64 t0 =3D tcg_temp_ebb_new_i64(); TCGv_i64 t1 =3D tcg_temp_ebb_new_i64(); - tcg_gen_setcond_i64(cond, t0, c1, c2); - tcg_gen_neg_i64(t0, t0); + tcg_gen_negsetcond_i64(cond, t0, c1, c2); tcg_gen_and_i64(t1, v1, t0); tcg_gen_andc_i64(ret, v2, t0); tcg_gen_or_i64(ret, ret, t1); --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822281; cv=none; d=zohomail.com; s=zohoarc; b=ahUfpLq7TnFqd1X5wJRQiftpf4FeKHhxLfNqaIAqQxPdgqUsThYUh29NS5hhzk7BxYtwrAAgk4Gh0xcfExikYHgmNeUpFan2ZBrwM9Q69i9AnIYBSO3OErmrhs2MKF7rVuEMOBHmjAqSzwbL9uFs0vgWp0lAM4btC5YIhIKeLC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822281; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Xi3TssmA/HigYWFgy245JlLJX03+VaDfRVBuqb9pW5c=; b=cHLmd8gwApefRhZ9NfWBqTg2bYLKsd/6MTLqbx+pQUMh2ns1GZkusqGIlbdBQkdQlV1skuMXwUf4iCpAlx9NX0Qh3TTrld5VIC0dGFM2boyGs0s3c/rkQl3id6sTuipKUmBdN2TfqXW89t6mk+epTLRcz1NB55IjYjMlLm5wf/A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822281268777.6238087378213; Wed, 23 Aug 2023 13:24:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOX-0008Le-02; Wed, 23 Aug 2023 16:24:01 -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 1qYuOU-0008KD-L8 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:58 -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 1qYuOK-0005Ub-Dc for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:50 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1bdc19b782aso41151525ad.0 for ; Wed, 23 Aug 2023 13:23:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822224; x=1693427024; 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=Xi3TssmA/HigYWFgy245JlLJX03+VaDfRVBuqb9pW5c=; b=jeHYdHVx7G26OSHg2qLUjGik1KPZAAF0dENH7IaHuBbqUuOpCZcs9uZwz0ctXpGCdj dbuXF8oqBFbMvteERt21z9uYyrOmHC+bYN46OqYvnPibJPR5SOeK/AlEZKTaAr5wgnr5 nB1ZG8AcKzsK+TgoQ8Sqca/WCZU3iPDFabUkYW8UJju9bvYcAXuXDFuUfPs66sDSo+cY wNw1yVJrrnC2XUYl1Cw5M9evAWIFzjTvwxnL5GaKQXp04WTc3D0k31hs337tI2POd5a7 l5hb1JiXTDd5HktZxoqJ08LdXusCk1DvZBiEujCPuwYoVDu0dyI9zBnE5ZxzIgbFdxMV bOVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822224; x=1693427024; 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=Xi3TssmA/HigYWFgy245JlLJX03+VaDfRVBuqb9pW5c=; b=OfivFUQhJlEyi703Z1O9jA8o+GN854GR2zXyYkriR6cuayPkAGHvr6UURbJw2eivsf sLdUH2UtomHt5bFSGRaV8HMObXL3Ns4zQ8rqxnsKrsULjkO+PV1I31JMgZ5NaTLhW0Hz nNPvhO569jDyMvMp8IxHgaxwajYDcOIQnn/kKyM+HXX6yC9m6hXkkq1EBMAHF5HMgWSK 50+jqcgHw+K6Zf0TzYXsFq9RHU/CrTA0oBweqRWhruKuY276EvYjrY3nUTDtfGSqSlfz ZDbSeC7nlfWkVrwfC+hWAT7ubAwsIL+XxDpiNc0h3vAcb6UxuW9zGFGVs4bBRhWngaPF OWeQ== X-Gm-Message-State: AOJu0YzhGMOFFhKbebjqQxrwRsxXeFTyQo2PkCaJ9oa+EBEAp5dM/MSD 8fg2Lv1ezJo8wc4UAx6oZt/uqjo874QkcNdq+i0= X-Google-Smtp-Source: AGHT+IHD5jvg1duptqf0W4I+h9UchgcXWAPldUcX0JhkeBT+SBxyv8FSaOcKc+8+oWXpURiU4iddKg== X-Received: by 2002:a17:902:dac9:b0:1c0:b8fd:9c7 with SMTP id q9-20020a170902dac900b001c0b8fd09c7mr1817008plx.43.1692822224674; Wed, 23 Aug 2023 13:23:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 18/48] target/alpha: Use tcg_gen_movcond_i64 in gen_fold_mzero Date: Wed, 23 Aug 2023 13:22:56 -0700 Message-Id: <20230823202326.1353645-19-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822281752100001 Content-Type: text/plain; charset="utf-8" The setcond + neg + and sequence is a complex method of performing a conditional move. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/alpha/translate.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 846f3d8091..0839182a1f 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -517,10 +517,9 @@ static void gen_fold_mzero(TCGCond cond, TCGv dest, TC= Gv src) =20 case TCG_COND_GE: case TCG_COND_LT: - /* For >=3D or <, map -0.0 to +0.0 via comparison and mask. */ - tcg_gen_setcondi_i64(TCG_COND_NE, dest, src, mzero); - tcg_gen_neg_i64(dest, dest); - tcg_gen_and_i64(dest, dest, src); + /* For >=3D or <, map -0.0 to +0.0. */ + tcg_gen_movcond_i64(TCG_COND_NE, dest, src, tcg_constant_i64(mzero= ), + src, tcg_constant_i64(0)); break; =20 default: --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822447; cv=none; d=zohomail.com; s=zohoarc; b=Nlx6c5utkiALzH47L3CR6lsK5thcEVP+H+hiMTUH9YC4GwHXX1bmMwGy5iD8ZCx+c9ejlZ8CpfzyW3HQFA8qMgf9JpXjTFJMXlDNbpAIvTeueiuf2Hd3TngFnxAaemtYv5l5bEg3+MOXbPtGkMQJJf64k1puGxXplHtI0HqPQFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822447; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gMdPzlTqXIVuvEs7JarBjvvs+ZKTDEbeaSAObbNwgl4=; b=j9WkMSsawqJUQ6CLSlInLb3++8jqtxcDvzycyRolVjZnrjMiK3RFsw87hsJEVbYX3R0nJ7sZmxrGf3lZK0fG71oAyRopa2EDyQ3+e0lawBNCOo5O6VlGqlWQBA+3Mm7dykontRpVG3iDGiegsqSmUuWme8MDG3COypnp6tHSxI0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169282244736637.42033724062219; Wed, 23 Aug 2023 13:27:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOk-0000Pn-Jp; 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 1qYuOV-0008L0-7u for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:59 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOK-0005Ug-Tf for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:56 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1c06f6f98c0so28091525ad.3 for ; Wed, 23 Aug 2023 13:23:46 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822225; x=1693427025; 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=gMdPzlTqXIVuvEs7JarBjvvs+ZKTDEbeaSAObbNwgl4=; b=zlPpja1gGc6nrGkTLzyh4qCgpRGZEl0TklNg6p0+jXikHFUu5uw6GDboyCJWCtX9Iw lEDpijV7vpFvOaCv8hVwsz7nezvqIDZjLRUVbEtEz2ZJkevXGyHrVd1HRvLrpn8hfLLM 5xOiUUPnhecu/jIh7pb0IBbfNSCC2kE+O0RLtj8ULFLrp0GXzbt2bRRGzLojeSPaz1Ne tjUiuKVL/8o3TyKKsXVBL5EErCaWedl61O9ahZ6awMf6Ooho9jUXYCaV1qIl1JI+xtf1 /mKlaTUhTLIR/9G328Ry4n7UbJttb5Af25YmtBBD1PrWtHuJN7iXHN7G5Igvgrc0npv1 pDOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822225; x=1693427025; 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=gMdPzlTqXIVuvEs7JarBjvvs+ZKTDEbeaSAObbNwgl4=; b=R6YeZiHY2HSIaUUY45LQuIA+rwQ3MTFjb4YKLUHU52mFpBrOALjpZYCWqWDETNsG5l fXEk/8Wv7YdEmwqVYeLOOcTU/Hg/EMTa3o9/3dg92L6eV5+p8dkO4TFKXDrRpZoPWvRz vjy5msJbXc5XOPMiJ+h/Xda+VtohHWDpeAMPyIg0iinLOTj1dictoLh6seWi7qB5fD8J AL5AIgIMgF8xRBKwpoBVeATbv+LgS86uYxf9etiq3lRla8ap2m69b34jnJJw0nKnMzT9 bAh6tC8cwibvhwp5KcO4met3eWrlP3wC36JQOY/zDv3is04OFvKs5KwjiFoGCl6y9S2V jirA== X-Gm-Message-State: AOJu0Yysj1eq4FNNQR24Yslbwi2IfMQPC8Xn2jbS0fiqjKRrZzR98DSz 5WeL3+O1YdS5dXEvjqI3bYbgJAbXNAcwvNfIuLI= X-Google-Smtp-Source: AGHT+IGVvTk3B1TNL8Mpmo6yKxCk1OaD1SPop0bZxjiQSM6Sw51rhONJYnwgy3ZYxMtnQPcuAFtxrg== X-Received: by 2002:a17:902:d342:b0:1bf:4a1f:2b57 with SMTP id l2-20020a170902d34200b001bf4a1f2b57mr9064433plk.13.1692822225522; Wed, 23 Aug 2023 13:23:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 19/48] target/arm: Use tcg_gen_negsetcond_* Date: Wed, 23 Aug 2023 13:22:57 -0700 Message-Id: <20230823202326.1353645-20-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822449700100008 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 22 +++++++++------------- target/arm/tcg/translate.c | 12 ++++-------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 5fa1257d32..da686cc953 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -4935,9 +4935,12 @@ static void disas_cond_select(DisasContext *s, uint3= 2_t insn) =20 if (rn =3D=3D 31 && rm =3D=3D 31 && (else_inc ^ else_inv)) { /* CSET & CSETM. */ - tcg_gen_setcond_i64(tcg_invert_cond(c.cond), tcg_rd, c.value, zero= ); if (else_inv) { - tcg_gen_neg_i64(tcg_rd, tcg_rd); + tcg_gen_negsetcond_i64(tcg_invert_cond(c.cond), + tcg_rd, c.value, zero); + } else { + tcg_gen_setcond_i64(tcg_invert_cond(c.cond), + tcg_rd, c.value, zero); } } else { TCGv_i64 t_true =3D cpu_reg(s, rn); @@ -8670,13 +8673,10 @@ static void handle_3same_64(DisasContext *s, int op= code, bool u, } break; case 0x6: /* CMGT, CMHI */ - /* 64 bit integer comparison, result =3D test ? (2^64 - 1) : 0. - * We implement this using setcond (test) and then negating. - */ cond =3D u ? TCG_COND_GTU : TCG_COND_GT; do_cmop: - tcg_gen_setcond_i64(cond, tcg_rd, tcg_rn, tcg_rm); - tcg_gen_neg_i64(tcg_rd, tcg_rd); + /* 64 bit integer comparison, result =3D test ? -1 : 0. */ + tcg_gen_negsetcond_i64(cond, tcg_rd, tcg_rn, tcg_rm); break; case 0x7: /* CMGE, CMHS */ cond =3D u ? TCG_COND_GEU : TCG_COND_GE; @@ -9265,14 +9265,10 @@ static void handle_2misc_64(DisasContext *s, int op= code, bool u, } break; case 0xa: /* CMLT */ - /* 64 bit integer comparison against zero, result is - * test ? (2^64 - 1) : 0. We implement via setcond(!test) and - * subtracting 1. - */ cond =3D TCG_COND_LT; do_cmop: - tcg_gen_setcondi_i64(cond, tcg_rd, tcg_rn, 0); - tcg_gen_neg_i64(tcg_rd, tcg_rd); + /* 64 bit integer comparison against zero, result is test ? -1 : 0= . */ + tcg_gen_negsetcond_i64(cond, tcg_rd, tcg_rn, tcg_constant_i64(0)); break; case 0x8: /* CMGT, CMGE */ cond =3D u ? TCG_COND_GE : TCG_COND_GT; diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index b71ac2d0d5..31d3130e4c 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -2946,13 +2946,11 @@ void gen_gvec_sqrdmlsh_qc(unsigned vece, uint32_t r= d_ofs, uint32_t rn_ofs, #define GEN_CMP0(NAME, COND) \ static void gen_##NAME##0_i32(TCGv_i32 d, TCGv_i32 a) \ { \ - tcg_gen_setcondi_i32(COND, d, a, 0); \ - tcg_gen_neg_i32(d, d); \ + tcg_gen_negsetcond_i32(COND, d, a, tcg_constant_i32(0)); \ } \ static void gen_##NAME##0_i64(TCGv_i64 d, TCGv_i64 a) \ { \ - tcg_gen_setcondi_i64(COND, d, a, 0); \ - tcg_gen_neg_i64(d, d); \ + tcg_gen_negsetcond_i64(COND, d, a, tcg_constant_i64(0)); \ } \ static void gen_##NAME##0_vec(unsigned vece, TCGv_vec d, TCGv_vec a) \ { \ @@ -3863,15 +3861,13 @@ void gen_gvec_mls(unsigned vece, uint32_t rd_ofs, u= int32_t rn_ofs, static void gen_cmtst_i32(TCGv_i32 d, TCGv_i32 a, TCGv_i32 b) { tcg_gen_and_i32(d, a, b); - tcg_gen_setcondi_i32(TCG_COND_NE, d, d, 0); - tcg_gen_neg_i32(d, d); + tcg_gen_negsetcond_i32(TCG_COND_NE, d, d, tcg_constant_i32(0)); } =20 void gen_cmtst_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b) { tcg_gen_and_i64(d, a, b); - tcg_gen_setcondi_i64(TCG_COND_NE, d, d, 0); - tcg_gen_neg_i64(d, d); + tcg_gen_negsetcond_i64(TCG_COND_NE, d, d, tcg_constant_i64(0)); } =20 static void gen_cmtst_vec(unsigned vece, TCGv_vec d, TCGv_vec a, TCGv_vec = b) --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822515; cv=none; d=zohomail.com; s=zohoarc; b=n3rzGeY0OLa658CFqv7lcybieHtwS17psXTxixyinXdhxffk48252BTxpcLX43aAQvuONv8WiBWO/DEQ/SV42zKm1oNUda2vHkXBu5mJzuVFbfJeI5kufEOoDS7HvnXXsVlGRSthJ8z4/icoevXVffP6kfl75Gux13mZhxVhClM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822515; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AT1qChCBl3ylCJc51IzPShNGnRnN6UDaf4m0aaMcNpE=; b=fVN94id7P3y0aqrrBckit+qhVMP9H+ADO7HDE9rfs5LlTcUwdZiR+OictPYGZJ+aVxUiC9ypu83KqqJRBfhK2/ha5GCP9opR0eAuvXHDzpjx9wx5nSiU9IEuSP50HTy7YitENsii9hwq0LowTRpPCqBTVlw1yfhoklpS3nZaPzE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169282251526324.013769828105296; Wed, 23 Aug 2023 13:28:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOj-0000KA-ME; Wed, 23 Aug 2023 16:24:13 -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 1qYuOV-0008Kz-6q for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:59 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOK-0005Ul-M8 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:51 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1bf078d5fb7so41366105ad.0 for ; Wed, 23 Aug 2023 13:23:47 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822226; x=1693427026; 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=AT1qChCBl3ylCJc51IzPShNGnRnN6UDaf4m0aaMcNpE=; b=WeGk6U7dBvoAN1XWWyExWkfIBXbS8gAUS1BS75JvoI6lPeiOCUCDPhlDBHYClx8aAs VkAPfc8GJdaSIX3HWSb/oyVRUt/EgpgH5+CYF59KwoB6b8K4XQBVLHadpWQwLZdAKM3C LJNlA8b9FsYrD5qPhMAadB394GD+QGvk+cnjTqGFheej4Go/LT+BN5H67xiP5RJT9u/d ywT4/UunZXmGDrdoTlNovLZqXMxLBlUmmw1G2LIK32cWVERf7J9uZtBhOXjc7f4KcR3n 3uXrNJhFdIVg/XGnYovGEipfyCOn1y33fnrXDiCkmkO5YxujtlD2gB0TYQqO8O+CTcB0 tO6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822226; x=1693427026; 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=AT1qChCBl3ylCJc51IzPShNGnRnN6UDaf4m0aaMcNpE=; b=L8GdGww0B42LkmFjePvl9gdSReOi6nkHKOqujdqRtJZarfxvjb9TOyo18Tbow3MxEK kM/VzLJtVlT/SSplXDZ6/rflN1yr7K35PEpae9Awt5ucJ8J3/NzF44zUDu/apmUa3msD TvovVNKZ1PkAwjHx25Rdvi1xF+U87W4DGedsXY1Z9xefVEQB6soeDCsg8vSr54qJ3Vr3 vZoXULrtjEqIxE2WeIe3kKeteQsJU2t+r46YmQTI11/J1jK33IYxXLv3qWdgh9a6jqj+ zX4jq4H0MU9HHqyryf6/tucUVRGZcaLnswEIFdBmeZU9GXWCK1ucDCN0z9OSKMEP4KZe GITw== X-Gm-Message-State: AOJu0YyInjUx9TjefY4+CuEbwdDe2VVdNQjeP1oripyC61Xjc8k/ouei qfHvso//905MJ5CgHjjTpXQJp/UEGr9IpKDz+Yg= X-Google-Smtp-Source: AGHT+IEUTNlj40nsuzlzWA5Eoff1jQA91yy+6XSvcxTP3JDJzqjPq1vyvIW/jmYL8hekw94jMOf9ug== X-Received: by 2002:a17:903:1212:b0:1b0:3df7:5992 with SMTP id l18-20020a170903121200b001b03df75992mr13728413plh.32.1692822226532; Wed, 23 Aug 2023 13:23:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 20/48] target/m68k: Use tcg_gen_negsetcond_* Date: Wed, 23 Aug 2023 13:22:58 -0700 Message-Id: <20230823202326.1353645-21-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822515835100004 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/m68k/translate.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index d08e823b6c..15b3701b8f 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -1350,8 +1350,7 @@ static void gen_cc_cond(DisasCompare *c, DisasContext= *s, int cond) case 14: /* GT (!(Z || (N ^ V))) */ case 15: /* LE (Z || (N ^ V)) */ c->v1 =3D tmp =3D tcg_temp_new(); - tcg_gen_setcond_i32(TCG_COND_EQ, tmp, QREG_CC_Z, c->v2); - tcg_gen_neg_i32(tmp, tmp); + tcg_gen_negsetcond_i32(TCG_COND_EQ, tmp, QREG_CC_Z, c->v2); tmp2 =3D tcg_temp_new(); tcg_gen_xor_i32(tmp2, QREG_CC_N, QREG_CC_V); tcg_gen_or_i32(tmp, tmp, tmp2); @@ -1430,9 +1429,8 @@ DISAS_INSN(scc) gen_cc_cond(&c, s, cond); =20 tmp =3D tcg_temp_new(); - tcg_gen_setcond_i32(c.tcond, tmp, c.v1, c.v2); + tcg_gen_negsetcond_i32(c.tcond, tmp, c.v1, c.v2); =20 - tcg_gen_neg_i32(tmp, tmp); DEST_EA(env, insn, OS_BYTE, tmp, NULL); } =20 @@ -2764,13 +2762,14 @@ DISAS_INSN(mull) tcg_gen_muls2_i32(QREG_CC_N, QREG_CC_V, src1, DREG(ext, 12)); /* QREG_CC_V is -(QREG_CC_V !=3D (QREG_CC_N >> 31)) */ tcg_gen_sari_i32(QREG_CC_Z, QREG_CC_N, 31); - tcg_gen_setcond_i32(TCG_COND_NE, QREG_CC_V, QREG_CC_V, QREG_CC= _Z); + tcg_gen_negsetcond_i32(TCG_COND_NE, QREG_CC_V, + QREG_CC_V, QREG_CC_Z); } else { tcg_gen_mulu2_i32(QREG_CC_N, QREG_CC_V, src1, DREG(ext, 12)); /* QREG_CC_V is -(QREG_CC_V !=3D 0), use QREG_CC_C as 0 */ - tcg_gen_setcond_i32(TCG_COND_NE, QREG_CC_V, QREG_CC_V, QREG_CC= _C); + tcg_gen_negsetcond_i32(TCG_COND_NE, QREG_CC_V, + QREG_CC_V, QREG_CC_C); } - tcg_gen_neg_i32(QREG_CC_V, QREG_CC_V); tcg_gen_mov_i32(DREG(ext, 12), QREG_CC_N); =20 tcg_gen_mov_i32(QREG_CC_Z, QREG_CC_N); @@ -3339,14 +3338,13 @@ static inline void shift_im(DisasContext *s, uint16= _t insn, int opsize) if (!logical && m68k_feature(s->env, M68K_FEATURE_M68K)) { /* if shift count >=3D bits, V is (reg !=3D 0) */ if (count >=3D bits) { - tcg_gen_setcond_i32(TCG_COND_NE, QREG_CC_V, reg, QREG_CC_V= ); + tcg_gen_negsetcond_i32(TCG_COND_NE, QREG_CC_V, reg, QREG_C= C_V); } else { TCGv t0 =3D tcg_temp_new(); tcg_gen_sari_i32(QREG_CC_V, reg, bits - 1); tcg_gen_sari_i32(t0, reg, bits - count - 1); - tcg_gen_setcond_i32(TCG_COND_NE, QREG_CC_V, QREG_CC_V, t0); + tcg_gen_negsetcond_i32(TCG_COND_NE, QREG_CC_V, QREG_CC_V, = t0); } - tcg_gen_neg_i32(QREG_CC_V, QREG_CC_V); } } else { tcg_gen_shri_i32(QREG_CC_C, reg, count - 1); @@ -3430,9 +3428,8 @@ static inline void shift_reg(DisasContext *s, uint16_= t insn, int opsize) /* Ignore the bits below the sign bit. */ tcg_gen_andi_i64(t64, t64, -1ULL << (bits - 1)); /* If any bits remain set, we have overflow. */ - tcg_gen_setcondi_i64(TCG_COND_NE, t64, t64, 0); + tcg_gen_negsetcond_i64(TCG_COND_NE, t64, t64, tcg_constant_i64= (0)); tcg_gen_extrl_i64_i32(QREG_CC_V, t64); - tcg_gen_neg_i32(QREG_CC_V, QREG_CC_V); } } else { tcg_gen_shli_i64(t64, t64, 32); @@ -5311,9 +5308,8 @@ DISAS_INSN(fscc) gen_fcc_cond(&c, s, cond); =20 tmp =3D tcg_temp_new(); - tcg_gen_setcond_i32(c.tcond, tmp, c.v1, c.v2); + tcg_gen_negsetcond_i32(c.tcond, tmp, c.v1, c.v2); =20 - tcg_gen_neg_i32(tmp, tmp); DEST_EA(env, insn, OS_BYTE, tmp, NULL); } =20 --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822307; cv=none; d=zohomail.com; s=zohoarc; b=BHcoJZsccUQ0TdVwbdJGi74tmWek9K2Y6ZWhoV3OLBdKlbtyGjEU42UANkkHQ5YqMR93SVtf8A8gHGizTMFAz8f5K1hXlJYzsOCebRdZfowZGOtFFwLKHM02qpma+ZpU5aKi5crcnvzfInO/ttBgjRuqzIktRqmd62d8CN7n1D4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822307; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cOQO7o2a72Z7Kk92GO5oi+sem2mknf2Hztp1emYuv9c=; b=PTMVKq2vxqZ/vqjG4U4TyuQAnd7fmZnXVpN+Gi2bimLI7e7yOkiqdGNTZLVnp3WPazjw8l9ibAv+GI957+EJ9iZteg7oU3oQEEjKHbAHZZ8sCOiBJzXUsV5pAS5D3sj2pONXgQSHLRoGVMI8DEtm+lpeGnW7eubQekrfkno6ArM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822307412210.2033101344134; Wed, 23 Aug 2023 13:25:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOY-0008N4-UP; Wed, 23 Aug 2023 16:24:04 -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 1qYuOU-0008KB-Kx for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:58 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOK-0005Uq-OD for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:23:50 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1bba48b0bd2so40994695ad.3 for ; Wed, 23 Aug 2023 13:23:48 -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.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822227; x=1693427027; 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=cOQO7o2a72Z7Kk92GO5oi+sem2mknf2Hztp1emYuv9c=; b=L3n57ZiSu01+TMzA7T5rPqKZkhxK4IHiwIpkiPF6j82KP6q5grAh4OvRreKmuvseji 7D+3GaDoFWGSaypakokMwOUf/UGh4fnvA5dBLEGplXGEw9WjGzGLrZ8rO3pLdn+scjrz crW/lq2sbwSd32Y+Y3BFEgcs66yMY4H6zHEWzrUKn4IgtUpf9SfV4rxXoXODv4/Uxpgl JWDOyJ24iLk4K1/8AlYX5UkGRuIN6/fTZ+Yto1QE9EVQkMV55Mw6fHWbTW6X/jre4KJW VE3UHTMznPhFQS3ofhspim26rohwioP2tPF40MZaGRfxNomnrR9VS7dNQvGPwBf6PW5u zPVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822227; x=1693427027; 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=cOQO7o2a72Z7Kk92GO5oi+sem2mknf2Hztp1emYuv9c=; b=aC6AOQQBFGL+47iznNzAwmrGqbFDg1X/Q8nfzC3tZAU6XKLRL22JOx2+NDCwd3uo0d qpWcyILt5nRdo+u/8RrIgJtYwk4DOOXrOy2mJltG1tRUruluSpVWmkhOglezV8IBlfQm zpz66IdpxS7Kj4n8iom1o7aCtN9KW7jdMPXHs1V8hhQPoLdJTIH4jeCNwyFoUJNWo1Hy j2gY0RhoWECZkbud7VReyXzAkor/2WKdcwLUX9wlRcQa1qdfKL2W0snk9qsr3D+1SuGr AvFMDQnhlxXVK9C20W1jT2VqGQuVZokwH9jHiHACLqZryBCIQ7/C3rKUvMCiqalocUWB xHkA== X-Gm-Message-State: AOJu0YyM73jS0SuIidzuMEi8VWcS9H/O5ctjSuZwoOBg+govmSoKJPp1 gLQ8fBi0t3e57iry7RhoRFXdAQiJuQdC2Tt79FE= X-Google-Smtp-Source: AGHT+IG3rTgMI/Q+70LR+DFC6c3Uj0yQnP/ctkAjxuCj5BQP8B6C9sQpZYpdDvEHmPEjeQuCRKOK7A== X-Received: by 2002:a17:902:b907:b0:1bd:d566:cd92 with SMTP id bf7-20020a170902b90700b001bdd566cd92mr9535292plb.63.1692822227364; Wed, 23 Aug 2023 13:23:47 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 21/48] target/openrisc: Use tcg_gen_negsetcond_* Date: Wed, 23 Aug 2023 13:22:59 -0700 Message-Id: <20230823202326.1353645-22-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822308787100001 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/openrisc/translate.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index a86360d4f5..7c6f80daf1 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -253,9 +253,8 @@ static void gen_mul(DisasContext *dc, TCGv dest, TCGv s= rca, TCGv srcb) =20 tcg_gen_muls2_tl(dest, cpu_sr_ov, srca, srcb); tcg_gen_sari_tl(t0, dest, TARGET_LONG_BITS - 1); - tcg_gen_setcond_tl(TCG_COND_NE, cpu_sr_ov, cpu_sr_ov, t0); + tcg_gen_negsetcond_tl(TCG_COND_NE, cpu_sr_ov, cpu_sr_ov, t0); =20 - tcg_gen_neg_tl(cpu_sr_ov, cpu_sr_ov); gen_ove_ov(dc); } =20 @@ -309,9 +308,8 @@ static void gen_muld(DisasContext *dc, TCGv srca, TCGv = srcb) =20 tcg_gen_muls2_i64(cpu_mac, high, t1, t2); tcg_gen_sari_i64(t1, cpu_mac, 63); - tcg_gen_setcond_i64(TCG_COND_NE, t1, t1, high); + tcg_gen_negsetcond_i64(TCG_COND_NE, t1, t1, high); tcg_gen_trunc_i64_tl(cpu_sr_ov, t1); - tcg_gen_neg_tl(cpu_sr_ov, cpu_sr_ov); =20 gen_ove_ov(dc); } --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822448; cv=none; d=zohomail.com; s=zohoarc; b=i8kHxLk5JVY2yRrlIGK9ZNf3bv2VaA9cH+ISLDUOjbfR4mvT/tcd8EyqMRd9er5rwbZZphfYjQVjerCXNNVM3X8SIqiOCgE3T2z3BWm7i+JCyYyBiA0HYcBZ8rTDgaQNJGl1LuiKJjyvQ0MlyVlB6CnH25w1PulpKE+V1Qale+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822448; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BXTuJLuVUV/PuBzgJU7K0Vdmip6KJacvGUEEE2MhUro=; b=JNmw7Y8y25JpkRhriIWqyi2mUq1fKVO+J0jWNA+S/Zv3Xodm0WYooudl4LksN73RjDIfpaMccvJzXv+bb+jgvZBgtv9t6emIjjOUSx8AE+9DMXmYCMjiWqBYlr2UgxzyNnGYLvi7dX9kGRdZ3h657dMMKl6o1DQRzHyDSKYQwqk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822448677353.69142377156265; Wed, 23 Aug 2023 13:27:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOm-0000YX-4o; Wed, 23 Aug 2023 16:24:16 -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-0008RZ-F0 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-0005V8-Sj for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:05 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1bbff6b2679so40186855ad.1 for ; Wed, 23 Aug 2023 13:23:50 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822228; x=1693427028; 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=BXTuJLuVUV/PuBzgJU7K0Vdmip6KJacvGUEEE2MhUro=; b=t5DJgLl8yJjggY+2mtQX92tU1/SePkCJmuL5+9XwbDx5Ju52FGIu//KitavaL0jVHo 8nvaTNRqHMh8C2ZQBE0HoD6EAGnfBAdlSJQzwyTW55udFI7/wTuiVwoyLR2gf8BxwHV3 8CMz4IaKq/CBYWMa1RZeRZ17mux03Ukjs+xGnOe6UnrYlzRQSxFRTD/xCMDQhhHs4+xF yrAIcaomxjvBapoVzA74JMEbspJLFXafixUd4a1ayZgbSa5ZL21ypE80GeP4itad+e9k cKl+SQOqx8PyzZ5ZHPPSHnn9RX5vwuETJXrsiKUU2EuBzs9MVEMdWW4XC+odlMfulLyc wunQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822228; x=1693427028; 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=BXTuJLuVUV/PuBzgJU7K0Vdmip6KJacvGUEEE2MhUro=; b=MnoOgU+0S3tS2jlOnzsid8akRtLfgLYTPrgMOfly/7yymfGcD7lmrgA0g35QN4l18x Mc4to/8DtbiXYrJ4oANUvniXsJrStzzDs4eIkjbp2uBpjVChrjf9nE6dyksLz+RoWzYM H2mx/vWJcx1CpSQY+Zk/wghCL6K9oPxb3/MDzoW1Kcjqhfzi6gXQAk3WzaPoIUOVL4hd 9iT9nrqMBWlptHirpbXC8j7qAId2k7pPFDJ/ITj+YDSdRJVGVS1+QRtusI9ArwfKrN2Z SBAQM60FJBUa3StHGLOikxwa6JPymWnT4BBT117Mi2ELupXf6tvmk0dGNFYUmaRIc3qG pf1Q== X-Gm-Message-State: AOJu0Yzirg6xaa/sEeX8wLQj0wN/w7hfug/qc2BHPQvLUHgq7jkKHoMS S/TqlFlu/XbQ+4Nwz/T7yEwzFO5RBd8857JEZrk= X-Google-Smtp-Source: AGHT+IEcM2/LWVfVapPH4mW/xgV7W5slZqzPAIT3ER4nIxqfZI53vo+KYy4N+7RBxTHjQLjhiPaIPw== X-Received: by 2002:a17:902:e752:b0:1bb:32de:95c5 with SMTP id p18-20020a170902e75200b001bb32de95c5mr12792910plf.65.1692822228166; Wed, 23 Aug 2023 13:23:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Daniel Henrique Barboza Subject: [PULL 22/48] target/ppc: Use tcg_gen_negsetcond_* Date: Wed, 23 Aug 2023 13:23:00 -0700 Message-Id: <20230823202326.1353645-23-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822450754100013 Content-Type: text/plain; charset="utf-8" Tested-by: Nicholas Piggin Reviewed-by: Nicholas Piggin Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- target/ppc/translate/fixedpoint-impl.c.inc | 6 ++++-- target/ppc/translate/vmx-impl.c.inc | 8 +++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/target/ppc/translate/fixedpoint-impl.c.inc b/target/ppc/transl= ate/fixedpoint-impl.c.inc index f47f1a50e8..4ce02fd3a4 100644 --- a/target/ppc/translate/fixedpoint-impl.c.inc +++ b/target/ppc/translate/fixedpoint-impl.c.inc @@ -342,12 +342,14 @@ static bool do_set_bool_cond(DisasContext *ctx, arg_X= _bi *a, bool neg, bool rev) uint32_t mask =3D 0x08 >> (a->bi & 0x03); TCGCond cond =3D rev ? TCG_COND_EQ : TCG_COND_NE; TCGv temp =3D tcg_temp_new(); + TCGv zero =3D tcg_constant_tl(0); =20 tcg_gen_extu_i32_tl(temp, cpu_crf[a->bi >> 2]); tcg_gen_andi_tl(temp, temp, mask); - tcg_gen_setcondi_tl(cond, cpu_gpr[a->rt], temp, 0); if (neg) { - tcg_gen_neg_tl(cpu_gpr[a->rt], cpu_gpr[a->rt]); + tcg_gen_negsetcond_tl(cond, cpu_gpr[a->rt], temp, zero); + } else { + tcg_gen_setcond_tl(cond, cpu_gpr[a->rt], temp, zero); } return true; } diff --git a/target/ppc/translate/vmx-impl.c.inc b/target/ppc/translate/vmx= -impl.c.inc index c8712dd7d8..6d7669aabd 100644 --- a/target/ppc/translate/vmx-impl.c.inc +++ b/target/ppc/translate/vmx-impl.c.inc @@ -1341,8 +1341,7 @@ static bool trans_VCMPEQUQ(DisasContext *ctx, arg_VC = *a) tcg_gen_xor_i64(t1, t0, t1); =20 tcg_gen_or_i64(t1, t1, t2); - tcg_gen_setcondi_i64(TCG_COND_EQ, t1, t1, 0); - tcg_gen_neg_i64(t1, t1); + tcg_gen_negsetcond_i64(TCG_COND_EQ, t1, t1, tcg_constant_i64(0)); =20 set_avr64(a->vrt, t1, true); set_avr64(a->vrt, t1, false); @@ -1365,15 +1364,14 @@ static bool do_vcmpgtq(DisasContext *ctx, arg_VC *a= , bool sign) =20 get_avr64(t0, a->vra, false); get_avr64(t1, a->vrb, false); - tcg_gen_setcond_i64(TCG_COND_GTU, t2, t0, t1); + tcg_gen_negsetcond_i64(TCG_COND_GTU, t2, t0, t1); =20 get_avr64(t0, a->vra, true); get_avr64(t1, a->vrb, true); tcg_gen_movcond_i64(TCG_COND_EQ, t2, t0, t1, t2, tcg_constant_i64(0)); - tcg_gen_setcond_i64(sign ? TCG_COND_GT : TCG_COND_GTU, t1, t0, t1); + tcg_gen_negsetcond_i64(sign ? TCG_COND_GT : TCG_COND_GTU, t1, t0, t1); =20 tcg_gen_or_i64(t1, t1, t2); - tcg_gen_neg_i64(t1, t1); =20 set_avr64(a->vrt, t1, true); set_avr64(a->vrt, t1, false); --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822381; cv=none; d=zohomail.com; s=zohoarc; b=GVZFFsqsLvrBZsQz+FudChRIHC3pd3uIwTdJOuwuzuQ23yb2t7YABpTeufNF0crEXozn1DkZE2ZIk+c15E5OE3L6SNnRINnkYNN3tbtnCGbuFAdjVusf6Sp8pon8ChJIojczaALspY7HmmKrG43c04bgle6PSShCjJQARqsL9lc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822381; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7tLG8/XHxQLwSuertWPZX823LWYyhiS+FEGkrYeTEgw=; b=C2AkCXcns9NDcGHZbYIuC4DQF/gTTMzwTAvLPukc1K7Q2O/GUJW3TwRHcBD3sLvJz54IuaGRl61ztTFr9ROgsGk5tw6lGJLY1tWF25h1diXdYP1Y7JW38F/q1FiIgM64Uk0vybXB6EwBGW6jVfOITQg9803D7qoxM3tfQspgzQg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822381975775.0645997880304; Wed, 23 Aug 2023 13:26:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOk-0000NY-22; 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 1qYuOX-0008Mj-3i for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:01 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOQ-0005V3-Sp for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:00 -0400 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1bf55a81eeaso28979295ad.0 for ; Wed, 23 Aug 2023 13:23:49 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822229; x=1693427029; 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=7tLG8/XHxQLwSuertWPZX823LWYyhiS+FEGkrYeTEgw=; b=yerTEFN9rcSa1Aoz890fkjCGPJb0sI7krYVkglL7hUSKNtXvJ+u88YFcC6yJ4aJXbD CGW9tJVcnyFgdHsBV43BY3Dz/HLU36yPIf6sHB1I/MtsuM1BG4BzVY5SLr5OuFgK2M07 bxbnzQpw2eTlLIVA3+zpgjLP8Aifx7gjGDn6ggkw5YiBILbcLL759AyFoYDWkoEVuYcd FyeUn5K5vkTSVHn7100VT75PJDqJJ8QGiRAoznv8RwY5twVkBYdfHH16zVlOa11KZKOo Uck3Jh9Zf0SZ63mj1NsGNKWO7Y7N7vwbF5/PpYjhlhyqcH3nVz7am7UajtZyTooK/Bw6 LrVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822229; x=1693427029; 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=7tLG8/XHxQLwSuertWPZX823LWYyhiS+FEGkrYeTEgw=; b=b45VyhEPhMEpFfCtdNaoX4KZScCDgMvTjRUZMtTx5Qehr4Y5LT76QWx3WOi+lL0ZO2 kAH0CaPeRdI8sS2rOxIq0RiSy6c3jytkATQ8rY9cOBQDe/+G6hY3ToY3bdu867+MAzlM 96j836She37LVqdyvKHTVoJUswqXOJNY4ANQaAzxeStlfSUUN7u18haVrP94f5whb3HR PRyDjfXWbscILpQkXawqi/vH68SQlc5ioPIZeNkYiObA1rAX8gWTQJnBvi4HRRohfHUV tBJVQpPgfW7b2oKW/zFF+Wj86Kffj6slF8ioB+I8H72MeRw1aMMqz829KugCQnJ6rWjn pSPQ== X-Gm-Message-State: AOJu0YyswxQYFUhHKSxDfOSVj+pI5NIq5y5EPVo6cFr2/0T5XmaMro9l 6J2EOVPe4eqDFqMVO7n6QuV2SzOybPl/CDEe3gU= X-Google-Smtp-Source: AGHT+IHLYNfY+B9+W1vIpS4ZBMyVzPzIsQXhyl18HMT/zK1fqjqyATjNgRmzLd/FnjBPdKOl02vcYg== X-Received: by 2002:a17:902:c20c:b0:1b8:6cae:4400 with SMTP id 12-20020a170902c20c00b001b86cae4400mr11897246pll.37.1692822229208; Wed, 23 Aug 2023 13:23:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 23/48] target/sparc: Use tcg_gen_movcond_i64 in gen_edge Date: Wed, 23 Aug 2023 13:23:01 -0700 Message-Id: <20230823202326.1353645-24-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822382225100005 Content-Type: text/plain; charset="utf-8" The setcond + neg + or sequence is a complex method of performing a conditional move. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/sparc/translate.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/target/sparc/translate.c b/target/sparc/translate.c index bd877a5e4a..fa80a91161 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -2916,7 +2916,7 @@ static void gen_edge(DisasContext *dc, TCGv dst, TCGv= s1, TCGv s2, =20 tcg_gen_shr_tl(lo1, tcg_constant_tl(tabl), lo1); tcg_gen_shr_tl(lo2, tcg_constant_tl(tabr), lo2); - tcg_gen_andi_tl(dst, lo1, omask); + tcg_gen_andi_tl(lo1, lo1, omask); tcg_gen_andi_tl(lo2, lo2, omask); =20 amask =3D -8; @@ -2926,18 +2926,9 @@ static void gen_edge(DisasContext *dc, TCGv dst, TCG= v s1, TCGv s2, tcg_gen_andi_tl(s1, s1, amask); tcg_gen_andi_tl(s2, s2, amask); =20 - /* We want to compute - dst =3D (s1 =3D=3D s2 ? lo1 : lo1 & lo2). - We've already done dst =3D lo1, so this reduces to - dst &=3D (s1 =3D=3D s2 ? -1 : lo2) - Which we perform by - lo2 |=3D -(s1 =3D=3D s2) - dst &=3D lo2 - */ - tcg_gen_setcond_tl(TCG_COND_EQ, lo1, s1, s2); - tcg_gen_neg_tl(lo1, lo1); - tcg_gen_or_tl(lo2, lo2, lo1); - tcg_gen_and_tl(dst, dst, lo2); + /* Compute dst =3D (s1 =3D=3D s2 ? lo1 : lo1 & lo2). */ + tcg_gen_and_tl(lo2, lo2, lo1); + tcg_gen_movcond_tl(TCG_COND_EQ, dst, s1, s2, lo1, lo2); } =20 static void gen_alignaddr(TCGv dst, TCGv s1, TCGv s2, bool left) --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822360; cv=none; d=zohomail.com; s=zohoarc; b=CmYQYyYLiDsJX2zlWCD5mZySDQ0npvbS8q6WLgCjWLT4Sc9AsabH4BvqmM0V9wBZTWcdK1N4iFAMmiRttft+ZfpgjYCJthGze+g7euYu9CbNx3dW+QFgaoJyVRS0d1zOUtbhcBky7ABgbfKy1JP45o6mfT0aXSm5p1ip7cSLK1Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822360; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aHbWd+vL9cFJb3YCRtGzznScqvArtoWUo4TuP0it/ow=; b=ki4SvOST+0dR+zbExaey+1it3QPYqtAFXpEzKzByq7wOIwSWToKTNTucnf2JsUfdc9n+4StkWVsiXFg49zdEw/p7cPfMHGQp1lFMsPBDQqKJQIjdSNyca7G4/YpLIow2iI4wy1fNHjtYZt2sKV7OT7iU4pvyJAqIA5e1CQRoYng= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822360515386.8923237279523; Wed, 23 Aug 2023 13:26:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOo-0000h7-Fm; Wed, 23 Aug 2023 16:24:18 -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-0008Sr-QZ for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:05 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOW-0005VH-RS for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:05 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1bf57366ccdso1604335ad.1 for ; Wed, 23 Aug 2023 13:23:51 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822230; x=1693427030; 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=aHbWd+vL9cFJb3YCRtGzznScqvArtoWUo4TuP0it/ow=; b=Uhn6AOAahQATLmAqNKbQz2AmgQdYih9Z0vAqmHr5qBLbu1QO+sEFM34mjnC+5IOEp4 8p6haXTlesS1wzguIW2Oddd+IHQIdyb7Lj7rdJGRR/5t/frpi23Tnep+CxBg+l/GU87H PRMJyRJ/kJR8DLkz+kJvMoAbFYL7wL5tuBCXLVQBm/Rc4n20WrWTQm/ZUv3AOECL0Y7Y H32h2bBUJvfmDFNv0DBIEo7tcUe+A6F7SGOz7rnJPkx5RKSV9LzxOJOCrTRH/orTnLSd 3119agK/P9Y8yar9HUeKehxUaA7jC/t5DpL7OWQCBLTGKn8vSh1XxtoTtudhf3f90SJn 2ueA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822230; x=1693427030; 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=aHbWd+vL9cFJb3YCRtGzznScqvArtoWUo4TuP0it/ow=; b=R0tg4D49kyKxaNJMyzOlmR3G/Rok1nQu0Owve2wycw8WDFRh+6Wg/5Lr5N+UCubfjp 1my1IGudKarqcAun6cLj40mfLdC9NRZBUDpb7zq4yhgbJRApywulVSW7FjvkEhg5r78L IxuZAjIc5RlfsyX4clwyahBqpRbSCRWK+kFIxi4Y6cqUeG39334s6ANQqLaqd3zNhPrN W+z4gEIqmN6oYXe7YYG/Bc/fMZXGhpifCw4YVRMz07YJEJCDIb01mmqR+jKtXpAzYhGC cLerAf03kQR0F4BZUqYRDBtffdbr542L16BSuGOl2Omz8t1+9emd+SUFS6dXrFWW74UK lS4w== X-Gm-Message-State: AOJu0Yx37TbTNbX8xzH7ugULjC/QAotwi8scLP3ZUUrLu6JeOH4Kbyed f+zvnqywf3hJNz+Ev5B97BmfeWFlfj03E6cQ8Gs= X-Google-Smtp-Source: AGHT+IEI1g+OnqkIvsdrwMUji3VdIc/3aQAug5yA9jhB7+qfpnV+6K2fh1gnX8h7cnX7UnCJUeWeeg== X-Received: by 2002:a17:902:e5c9:b0:1b7:ca9c:4f5c with SMTP id u9-20020a170902e5c900b001b7ca9c4f5cmr19800592plf.28.1692822229937; Wed, 23 Aug 2023 13:23:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bastian Koppelmann Subject: [PULL 24/48] target/tricore: Replace gen_cond_w with tcg_gen_negsetcond_tl Date: Wed, 23 Aug 2023 13:23:02 -0700 Message-Id: <20230823202326.1353645-25-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822361479100003 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Bastian Koppelmann Signed-off-by: Richard Henderson --- target/tricore/translate.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 1947733870..6ae5ccbf72 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -2680,13 +2680,6 @@ gen_accumulating_condi(int cond, TCGv ret, TCGv r1, = int32_t con, gen_accumulating_cond(cond, ret, r1, temp, op); } =20 -/* ret =3D (r1 cond r2) ? 0xFFFFFFFF ? 0x00000000;*/ -static inline void gen_cond_w(TCGCond cond, TCGv ret, TCGv r1, TCGv r2) -{ - tcg_gen_setcond_tl(cond, ret, r1, r2); - tcg_gen_neg_tl(ret, ret); -} - static inline void gen_eqany_bi(TCGv ret, TCGv r1, int32_t con) { TCGv b0 =3D tcg_temp_new(); @@ -5692,7 +5685,8 @@ static void decode_rr_accumulator(DisasContext *ctx) gen_helper_eq_h(cpu_gpr_d[r3], cpu_gpr_d[r1], cpu_gpr_d[r2]); break; case OPC2_32_RR_EQ_W: - gen_cond_w(TCG_COND_EQ, cpu_gpr_d[r3], cpu_gpr_d[r1], cpu_gpr_d[r2= ]); + tcg_gen_negsetcond_tl(TCG_COND_EQ, cpu_gpr_d[r3], + cpu_gpr_d[r1], cpu_gpr_d[r2]); break; case OPC2_32_RR_EQANY_B: gen_helper_eqany_b(cpu_gpr_d[r3], cpu_gpr_d[r1], cpu_gpr_d[r2]); @@ -5729,10 +5723,12 @@ static void decode_rr_accumulator(DisasContext *ctx) gen_helper_lt_hu(cpu_gpr_d[r3], cpu_gpr_d[r1], cpu_gpr_d[r2]); break; case OPC2_32_RR_LT_W: - gen_cond_w(TCG_COND_LT, cpu_gpr_d[r3], cpu_gpr_d[r1], cpu_gpr_d[r2= ]); + tcg_gen_negsetcond_tl(TCG_COND_LT, cpu_gpr_d[r3], + cpu_gpr_d[r1], cpu_gpr_d[r2]); break; case OPC2_32_RR_LT_WU: - gen_cond_w(TCG_COND_LTU, cpu_gpr_d[r3], cpu_gpr_d[r1], cpu_gpr_d[r= 2]); + tcg_gen_negsetcond_tl(TCG_COND_LTU, cpu_gpr_d[r3], + cpu_gpr_d[r1], cpu_gpr_d[r2]); break; case OPC2_32_RR_MAX: tcg_gen_movcond_tl(TCG_COND_GT, cpu_gpr_d[r3], cpu_gpr_d[r1], --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822490; cv=none; d=zohomail.com; s=zohoarc; b=Rk4c6Ly6Ytr8QVFIbCV1KIBH3OeUXuZQqn4XbC8oQPSvrxtp1+YZEaRdpBJAWGsqNrxQTzvEMTRLmZJU0XVwsONsS2wBpanlqUpdG7sNQ86Cz0F3mbgEmqeHN0zfzQWy/wT+lrSExe39yeAot+lmpia/3nbb9UK6lKjEmu0t9Mk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822490; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Fd1w/jO7jE9OPHxRjaE95Lz98NjGQkDoBWbfFsoCKxo=; b=QMLNrNZsaeS9mr5DrhFdxEvivhOT6JuKED+psKj7rk481AwhTLAjuryDl2U338XsMwACRWn4xz25RL2cdNEP1A8ntFaYd5JO9b9Z78TO+IheRqdz3JuzyflAv33wNimR9hK0A9po8hSYaD+zmdT/cmZ1i7r59G+ZnSxhulJerjs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822490791551.0637679883412; Wed, 23 Aug 2023 13:28:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOl-0000TD-CM; Wed, 23 Aug 2023 16:24:15 -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 1qYuOX-0008Mk-45 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:01 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOU-0005VQ-De for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:00 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1bf7423ef3eso27380885ad.3 for ; Wed, 23 Aug 2023 13:23:51 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822231; x=1693427031; 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=Fd1w/jO7jE9OPHxRjaE95Lz98NjGQkDoBWbfFsoCKxo=; b=Yvt5m1pa9BLZZptE++yrCl7laoagMklTTpL14J1DJrqtps2VgG+A5ZgrdSTx4HkPaa mASGGP+gEsmIi+jbD2J8n4RfH+iu8qbH1gsKUdyayYxrC/l/2p1s55MBCsw/o+TtXJb9 JcrQYudZZ3S6WeDegPkU1eQFdhU2OFVHRE1g63M/VBirGvxHxI77lQtNAwI1/1jNbmMc 4D8kgooexOVUOUKyb//S4vwAeXj4NmTeUtgGgbw5mVuY4dQF9IJQ7v4HDVY6Z3C50+7j 9mhp72uDWsjuWxbn12FKj31NZQe6jSL3W+j6Amm3OfS5ALt2UsurTU86L/3Qa6FF1qWG JNDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822231; x=1693427031; 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=Fd1w/jO7jE9OPHxRjaE95Lz98NjGQkDoBWbfFsoCKxo=; b=RsSwpnGDhYkMx6/a21IW5I92cXFL64/EBi7rS8uCkGWKLssiChRaIZVs0r5d/1rNFI jua3cnI6M6A6FvD4roV0D0z3Z+LEIcSIIlajrPTrLTeKDh+OC3VZbEPKHlVcNFXXIFjV ifySikN7gkD0Td73fPiwmqCUfSkXrEoDLjiyU5pmwtvk6qUcXwxgLEP6z7CarpESCwoW jNalcP+w+MNm4gwjWTnLfsXpifcm17lbFwTaVkT5kZOGunR+a/V+PsuwFK9luWtZqkfx OHp8QGwTJJ68YKgcXpqYv+Tfk8VXBt5Ezg1ES6dzrV7vXXPoQ4SK2onCvrvEtsizuzfQ rt+A== X-Gm-Message-State: AOJu0Yw5wYtcrebNIqrr3a0dc/kZe7rmkwuWCCFiJVzVGCJ0Smfdn/bR ecMDUh9LPJQwBmnIt7Z5OMjPY4xjKxJ6P4hlbPM= X-Google-Smtp-Source: AGHT+IEXh/Q6aMs8ZCNkAGIMGTST6t2pg5gbko1WaowHnjwNVWgob9LY6MSV6Pmm7WJDJpXYnK6ZKg== X-Received: by 2002:a17:902:9888:b0:1bb:25bd:d091 with SMTP id s8-20020a170902988800b001bb25bdd091mr11399084plp.30.1692822230791; Wed, 23 Aug 2023 13:23:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza Subject: [PULL 25/48] tcg/ppc: Implement negsetcond_* Date: Wed, 23 Aug 2023 13:23:03 -0700 Message-Id: <20230823202326.1353645-26-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822493043100011 Content-Type: text/plain; charset="utf-8" In the general case we simply negate. However with isel we may load -1 instead of 1 with no extra effort. Consolidate EQ0 and NE0 logic. Replace the NE0 zero-extension with inversion+negation of EQ0, which is never worse and may eliminate one insn. Provide a special case for -EQ0. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.h | 4 +- tcg/ppc/tcg-target.c.inc | 127 ++++++++++++++++++++++++--------------- 2 files changed, 82 insertions(+), 49 deletions(-) diff --git a/tcg/ppc/tcg-target.h b/tcg/ppc/tcg-target.h index a2ca0b44ce..8bfb14998e 100644 --- a/tcg/ppc/tcg-target.h +++ b/tcg/ppc/tcg-target.h @@ -97,7 +97,7 @@ typedef enum { #define TCG_TARGET_HAS_sextract_i32 0 #define TCG_TARGET_HAS_extract2_i32 0 #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_mulu2_i32 0 #define TCG_TARGET_HAS_muls2_i32 0 #define TCG_TARGET_HAS_muluh_i32 1 @@ -135,7 +135,7 @@ typedef enum { #define TCG_TARGET_HAS_sextract_i64 0 #define TCG_TARGET_HAS_extract2_i64 0 #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/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 511e14b180..10448aa0e6 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -1548,8 +1548,20 @@ static void tcg_out_cmp(TCGContext *s, int cond, TCG= Arg arg1, TCGArg arg2, } =20 static void tcg_out_setcond_eq0(TCGContext *s, TCGType type, - TCGReg dst, TCGReg src) + TCGReg dst, TCGReg src, bool neg) { + if (neg && (TCG_TARGET_REG_BITS =3D=3D 32 || type =3D=3D TCG_TYPE_I64)= ) { + /* + * X !=3D 0 implies X + -1 generates a carry. + * RT =3D (~X + X) + CA + * =3D -1 + CA + * =3D CA ? 0 : -1 + */ + tcg_out32(s, ADDIC | TAI(TCG_REG_R0, src, -1)); + tcg_out32(s, SUBFE | TAB(dst, src, src)); + return; + } + if (type =3D=3D TCG_TYPE_I32) { tcg_out32(s, CNTLZW | RS(src) | RA(dst)); tcg_out_shri32(s, dst, dst, 5); @@ -1557,18 +1569,28 @@ static void tcg_out_setcond_eq0(TCGContext *s, TCGT= ype type, tcg_out32(s, CNTLZD | RS(src) | RA(dst)); tcg_out_shri64(s, dst, dst, 6); } + if (neg) { + tcg_out32(s, NEG | RT(dst) | RA(dst)); + } } =20 -static void tcg_out_setcond_ne0(TCGContext *s, TCGReg dst, TCGReg src) +static void tcg_out_setcond_ne0(TCGContext *s, TCGType type, + TCGReg dst, TCGReg src, bool neg) { - /* X !=3D 0 implies X + -1 generates a carry. Extra addition - trickery means: R =3D X-1 + ~X + C =3D X-1 + (-X+1) + C =3D C. */ - if (dst !=3D src) { - tcg_out32(s, ADDIC | TAI(dst, src, -1)); - tcg_out32(s, SUBFE | TAB(dst, dst, src)); - } else { + if (!neg && (TCG_TARGET_REG_BITS =3D=3D 32 || type =3D=3D TCG_TYPE_I64= )) { + /* + * X !=3D 0 implies X + -1 generates a carry. Extra addition + * trickery means: R =3D X-1 + ~X + C =3D X-1 + (-X+1) + C =3D C. + */ tcg_out32(s, ADDIC | TAI(TCG_REG_R0, src, -1)); tcg_out32(s, SUBFE | TAB(dst, TCG_REG_R0, src)); + return; + } + tcg_out_setcond_eq0(s, type, dst, src, false); + if (neg) { + tcg_out32(s, ADDI | TAI(dst, dst, -1)); + } else { + tcg_out_xori32(s, dst, dst, 1); } } =20 @@ -1590,9 +1612,10 @@ static TCGReg tcg_gen_setcond_xor(TCGContext *s, TCG= Reg arg1, TCGArg arg2, =20 static void tcg_out_setcond(TCGContext *s, TCGType type, TCGCond cond, TCGArg arg0, TCGArg arg1, TCGArg arg2, - int const_arg2) + int const_arg2, bool neg) { - int crop, sh; + int sh; + bool inv; =20 tcg_debug_assert(TCG_TARGET_REG_BITS =3D=3D 64 || type =3D=3D TCG_TYPE= _I32); =20 @@ -1605,14 +1628,10 @@ static void tcg_out_setcond(TCGContext *s, TCGType = type, TCGCond cond, if (arg2 =3D=3D 0) { switch (cond) { case TCG_COND_EQ: - tcg_out_setcond_eq0(s, type, arg0, arg1); + tcg_out_setcond_eq0(s, type, arg0, arg1, neg); return; case TCG_COND_NE: - if (TCG_TARGET_REG_BITS =3D=3D 64 && type =3D=3D TCG_TYPE_I32)= { - tcg_out_ext32u(s, TCG_REG_R0, arg1); - arg1 =3D TCG_REG_R0; - } - tcg_out_setcond_ne0(s, arg0, arg1); + tcg_out_setcond_ne0(s, type, arg0, arg1, neg); return; case TCG_COND_GE: tcg_out32(s, NOR | SAB(arg1, arg0, arg1)); @@ -1621,9 +1640,17 @@ static void tcg_out_setcond(TCGContext *s, TCGType t= ype, TCGCond cond, case TCG_COND_LT: /* Extract the sign bit. */ if (type =3D=3D TCG_TYPE_I32) { - tcg_out_shri32(s, arg0, arg1, 31); + if (neg) { + tcg_out_sari32(s, arg0, arg1, 31); + } else { + tcg_out_shri32(s, arg0, arg1, 31); + } } else { - tcg_out_shri64(s, arg0, arg1, 63); + if (neg) { + tcg_out_sari64(s, arg0, arg1, 63); + } else { + tcg_out_shri64(s, arg0, arg1, 63); + } } return; default: @@ -1641,7 +1668,7 @@ static void tcg_out_setcond(TCGContext *s, TCGType ty= pe, TCGCond cond, =20 isel =3D tcg_to_isel[cond]; =20 - tcg_out_movi(s, type, arg0, 1); + tcg_out_movi(s, type, arg0, neg ? -1 : 1); if (isel & 1) { /* arg0 =3D (bc ? 0 : 1) */ tab =3D TAB(arg0, 0, arg0); @@ -1655,51 +1682,47 @@ static void tcg_out_setcond(TCGContext *s, TCGType = type, TCGCond cond, return; } =20 + inv =3D false; switch (cond) { case TCG_COND_EQ: arg1 =3D tcg_gen_setcond_xor(s, arg1, arg2, const_arg2); - tcg_out_setcond_eq0(s, type, arg0, arg1); - return; + tcg_out_setcond_eq0(s, type, arg0, arg1, neg); + break; =20 case TCG_COND_NE: arg1 =3D tcg_gen_setcond_xor(s, arg1, arg2, const_arg2); - /* Discard the high bits only once, rather than both inputs. */ - if (TCG_TARGET_REG_BITS =3D=3D 64 && type =3D=3D TCG_TYPE_I32) { - tcg_out_ext32u(s, TCG_REG_R0, arg1); - arg1 =3D TCG_REG_R0; - } - tcg_out_setcond_ne0(s, arg0, arg1); - return; + tcg_out_setcond_ne0(s, type, arg0, arg1, neg); + break; =20 + case TCG_COND_LE: + case TCG_COND_LEU: + inv =3D true; + /* fall through */ case TCG_COND_GT: case TCG_COND_GTU: - sh =3D 30; - crop =3D 0; - goto crtest; - - case TCG_COND_LT: - case TCG_COND_LTU: - sh =3D 29; - crop =3D 0; + sh =3D 30; /* CR7 CR_GT */ goto crtest; =20 case TCG_COND_GE: case TCG_COND_GEU: - sh =3D 31; - crop =3D CRNOR | BT(7, CR_EQ) | BA(7, CR_LT) | BB(7, CR_LT); + inv =3D true; + /* fall through */ + case TCG_COND_LT: + case TCG_COND_LTU: + sh =3D 29; /* CR7 CR_LT */ goto crtest; =20 - case TCG_COND_LE: - case TCG_COND_LEU: - sh =3D 31; - crop =3D CRNOR | BT(7, CR_EQ) | BA(7, CR_GT) | BB(7, CR_GT); crtest: tcg_out_cmp(s, cond, arg1, arg2, const_arg2, 7, type); - if (crop) { - tcg_out32(s, crop); - } tcg_out32(s, MFOCRF | RT(TCG_REG_R0) | FXM(7)); tcg_out_rlw(s, RLWINM, arg0, TCG_REG_R0, sh, 31, 31); + if (neg && inv) { + tcg_out32(s, ADDI | TAI(arg0, arg0, -1)); + } else if (neg) { + tcg_out32(s, NEG | RT(arg0) | RA(arg0)); + } else if (inv) { + tcg_out_xori32(s, arg0, arg0, 1); + } break; =20 default: @@ -2982,11 +3005,19 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, =20 case INDEX_op_setcond_i32: tcg_out_setcond(s, TCG_TYPE_I32, args[3], args[0], args[1], args[2= ], - const_args[2]); + const_args[2], false); break; case INDEX_op_setcond_i64: tcg_out_setcond(s, TCG_TYPE_I64, args[3], args[0], args[1], args[2= ], - const_args[2]); + const_args[2], false); + break; + case INDEX_op_negsetcond_i32: + tcg_out_setcond(s, TCG_TYPE_I32, args[3], args[0], args[1], args[2= ], + const_args[2], true); + break; + case INDEX_op_negsetcond_i64: + tcg_out_setcond(s, TCG_TYPE_I64, args[3], args[0], args[1], args[2= ], + const_args[2], true); break; case INDEX_op_setcond2_i32: tcg_out_setcond2(s, args, const_args); @@ -3724,6 +3755,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpc= ode op) case INDEX_op_rotl_i32: case INDEX_op_rotr_i32: case INDEX_op_setcond_i32: + case INDEX_op_negsetcond_i32: case INDEX_op_and_i64: case INDEX_op_andc_i64: case INDEX_op_shl_i64: @@ -3732,6 +3764,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpc= ode op) case INDEX_op_rotl_i64: case INDEX_op_rotr_i64: case INDEX_op_setcond_i64: + case INDEX_op_negsetcond_i64: return C_O1_I2(r, r, ri); =20 case INDEX_op_mul_i32: --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822452; cv=none; d=zohomail.com; s=zohoarc; b=IhH2ivg8GhH5ycyS7kesrMBluoW1iRhZvlA44efEZdMvegjdeGYE/6xYY7bfFGv1XCnb9nfBnoOjDQioJnIgdvPLcPmCvxQnMTAfi4W8+G6zKTe7DCP+Skx2VNU9EEXy5usDd8Md/Q05LcPfRPj8DRW+xCMAzTUMHjznVWzSFrs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822452; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HAmE7joGqyZttz+k7cOjgHhj0sK9IgQhYb7Z62glHBk=; b=jejMaRPDcjBbZOSn3ZfhEbzygFWzjxC5OGF7tgnDBNCV/fYkILeRWPAKJUfshsElNs6mcJ/3JlgWmveTpfFSXI4FOJ4wjs5a8vSjuLUCYUW6CsMeic0F2ztsHYwcQswim8NQgjK08+EBdCvwDbP1nOdXzJQNHqKKn4T7Eb0960w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822452979955.3380749499779; Wed, 23 Aug 2023 13:27:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOi-0000K1-QJ; Wed, 23 Aug 2023 16:24:12 -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 1qYuOZ-0008PS-3S for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:04 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOU-0005Vb-Q1 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:01 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-689f9576babso4160826b3a.0 for ; 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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822231; x=1693427031; 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=HAmE7joGqyZttz+k7cOjgHhj0sK9IgQhYb7Z62glHBk=; b=LCAOwYVSEVsGCo2LtvV0ekOk91L2vse2eCuoZ697lMoj706DPL90QGWoi66/t31UXL uP8PKAGzuS0R6fPQMd2G3rGeTnmBP8SisqotqD0GmD41dpdz0zounxKyfOF1ayTipXBd 7sqHT9G2WMz3P+CHTfD3vu+cnofv4s6uPilGXb6ljy2T4MPNRjtZgOVZlqLG73G/jQ2A k/c4GEf9dgM+VbUKmopu2PkpIEg9qQjVqTCrerYrct/uNGzuoxfnm4HPQi59dA/Xhkjd JXM0iGBxj240SxYAN5ZAZqZ0GPUZHrErnzUovjE95MNo9jBYJ+KUoyzAMAwY7k1dT4+t TtlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822231; x=1693427031; 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=HAmE7joGqyZttz+k7cOjgHhj0sK9IgQhYb7Z62glHBk=; b=iJZse+bUaHwBhTh01LbSoZuXO3lRPpXLh2gtt5+BClnVLg7p0S8WIuK07veIKINgrO /Ff/04p6UMwtKGt2GDXvy8RaCPnELp0FUFlw+Ir6fwb4Jr7RImOQ6RuBjIbilwsTJ635 NoVaA67V3CT6QenNI1g7CrbtV96OmuFPVeDVtmX2dVhuaEJ6tuh5oy0enVDncX9SG7qF dIWPN0BC6xrDfcVtO8569514ffplWDROUVmEIXkK6acagR0yO1xEEWXkkcTvLUlAjLPl SdZP33XYlHPhKesZS57itLGC422QnUNHGdRvAm3Vmqc0JOjPYEwQIvaV1tkrXnqTnEYp 8RrA== X-Gm-Message-State: AOJu0YychQikLWMuu9MeOdYRIHCb0BmvPPD734FP5TeTJmBuoz3PVeOV 4IPBCm6ZYUXSkCc5DGk2IFFBMbMMCzUnhKWwM3M= X-Google-Smtp-Source: AGHT+IGCQpRFSpLPXiq73BfYuJY/rtgmLvcPq+v17dkvsCziQLb0ADOB2mb9ARofBxwfc+2GLGibyA== X-Received: by 2002:a05:6a20:7da2:b0:141:cc5f:7d28 with SMTP id v34-20020a056a207da200b00141cc5f7d28mr13742096pzj.50.1692822231677; Wed, 23 Aug 2023 13:23:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Nicholas Piggin , Daniel Henrique Barboza Subject: [PULL 26/48] tcg/ppc: Use the Set Boolean Extension Date: Wed, 23 Aug 2023 13:23:04 -0700 Message-Id: <20230823202326.1353645-27-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822454497100025 Content-Type: text/plain; charset="utf-8" The SETBC family of instructions requires exactly two insns for all comparisions, saving 0-3 insns per (neg)setcond. Tested-by: Nicholas Piggin Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- tcg/ppc/tcg-target.c.inc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc index 10448aa0e6..090f11e71c 100644 --- a/tcg/ppc/tcg-target.c.inc +++ b/tcg/ppc/tcg-target.c.inc @@ -447,6 +447,11 @@ static bool tcg_target_const_match(int64_t val, TCGTyp= e type, int ct) #define TW XO31( 4) #define TRAP (TW | TO(31)) =20 +#define SETBC XO31(384) /* v3.10 */ +#define SETBCR XO31(416) /* v3.10 */ +#define SETNBC XO31(448) /* v3.10 */ +#define SETNBCR XO31(480) /* v3.10 */ + #define NOP ORI /* ori 0,0,0 */ =20 #define LVX XO31(103) @@ -1624,6 +1629,23 @@ static void tcg_out_setcond(TCGContext *s, TCGType t= ype, TCGCond cond, arg2 =3D (uint32_t)arg2; } =20 + /* With SETBC/SETBCR, we can always implement with 2 insns. */ + if (have_isa_3_10) { + tcg_insn_unit bi, opc; + + tcg_out_cmp(s, cond, arg1, arg2, const_arg2, 7, type); + + /* Re-use tcg_to_bc for BI and BO_COND_{TRUE,FALSE}. */ + bi =3D tcg_to_bc[cond] & (0x1f << 16); + if (tcg_to_bc[cond] & BO(8)) { + opc =3D neg ? SETNBC : SETBC; + } else { + opc =3D neg ? SETNBCR : SETBCR; + } + tcg_out32(s, opc | RT(arg0) | bi); + return; + } + /* Handle common and trivial cases before handling anything else. */ if (arg2 =3D=3D 0) { switch (cond) { --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822439; cv=none; d=zohomail.com; s=zohoarc; b=YhDpiXpsaxBa3z3XRsmM/y6WQNxjEBBqpdQBVl9KPfUTr8Tdb9K+m3Ztk92F0nAy/QlE8ZuRtMAnm/VJm1tHhaBrO8wsPZ7LWS4D90kJOjWQUM6MZHX6cqLZ445MlR2wA7loo6BlnkptmLEDNLCD8OBOu4rQSYTpnABhMt/72tI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822439; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=D7NIoRhXITmVWSRN6hbMfoA30tKZp5gKe/MKfIU5oaA=; b=LIxb3xZTfayAOiwpEaqo91PdBXeA0z2YOWE2uyKNMAa6fYBvrpT/tsMawHHbbAXE7aceFGLy6jZ+5VYINo1iPwI31kA2PMzlTEjd3W1OjNTfWPu3rfbRcwQPEOereO+EVSeaqw3RfEefcUFJ7Gvt4IvPr6q80tiucV3K3seWtuM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822439618734.20657758561; Wed, 23 Aug 2023 13:27:19 -0700 (PDT) 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) 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) 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-Google-Smtp-Source: AGHT+IGLAXplrlwjDLFu4untaKBl/4TWDm9507lqVkVdo/GbETiJIfj6AIoQPPZtKq2NLtQR38P1UA== 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822441489100007 Content-Type: text/plain; charset="utf-8" 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; =20 + case INDEX_op_negsetcond_i32: + a2 =3D (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 =3D (int32_t)a2; /* FALLTHRU */ @@ -2868,6 +2878,8 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpc= ode 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); =20 case INDEX_op_mul_i32: --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822531; cv=none; d=zohomail.com; s=zohoarc; b=cLIA8Boq0rBIVCnCL8QSoQk7ZmXmUGxuiOjDdIQG2J3ZVRBK4o5Aw1VU/f9H56737tKIrEYdbZ0mcp0DjeVwKs46vbjsmdCbsA/zIb/J/eLtj61ELZIduEAm5sXX51Qb3kzlwt2Cv+khwLier/lPzLF6sNDocQ7CyGIuzTlZrzE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822531; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AZ62r5d6+6rV1DUVw8PqW06PxONRPMe2P0kJIV4zocA=; b=SFbBfWJiUlY1wCmAUqc1JNFmOWPhjRgoPEP+cH0WCmeqCRi5jlCWLEhm9PAXOyjsdnEmj7ODFAmUKYnZY3wYpOIssrBIJeoexgiNrHRCvqixKFWRAcocj3g0ufKGw0vQ7zAQeAxTDbNlwdUvZvTb9bR+W7I2nb6e4qQOAsAZ4O0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822531008762.0101248388563; Wed, 23 Aug 2023 13:28:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOj-0000K8-Hq; Wed, 23 Aug 2023 16:24:13 -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 1qYuOZ-0008PV-4C for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:04 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOU-0005W0-Sz for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:02 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1bdf4752c3cso37627525ad.2 for ; Wed, 23 Aug 2023 13:23:54 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); 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=1692822234; x=1693427034; 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=AZ62r5d6+6rV1DUVw8PqW06PxONRPMe2P0kJIV4zocA=; b=KM3LhU5LCN57R1cOFntLg2/XXnY8JOilBpcEcQLsmxu9gHGwE/A/pSdBFJ4VIpwf0Q 6lAtLcXgkehTtWhAnsEHxbzMRE4B6i9Ms4jz4tpwjAf8fsf2MmRhUonUdVx+dC4NadSb /uJGB7suvMbywvxH3nuUqhPEJAhS44NYHZDgPW4CxhKmC35LbGu1bFPl78x2PkTA7i8d q3VpaDRJK7Hy/tVtrG8VOA5oJTWeqpJz7PNx4Euehpvy/4FSgEDiH5c4pmEv+eeSY6+p Vn3syVRRqKnXIcftOPut5iO61iUB63XZW2BF5y6PHtF00TXO27Vvid1TrIrlpKOLBD13 XXog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822234; x=1693427034; 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=AZ62r5d6+6rV1DUVw8PqW06PxONRPMe2P0kJIV4zocA=; b=bWC5qbtuxhD6jhZ6EW2g4fxKO682spXHrF+DmomQ1jrG+RiIhpvHLjykd5wjsNv1v+ 33oN4BXZtzphNXhEDBalUChUQzGkGrIsdz2HALmeaYSZgcMD/yZSWCgnTjMNdir2G/ro PxK8JRiuE1nZkWB7q+Fjl8DNgEqaUylA/twBpSxt243skpYfMQM0Tm5raEpRP8xI6/dk lVi75EfNhZKPE/tgfTThS0XTfqHFVOQgHJHhGLBKZ8iTGJiSsMvrmQgTdtLOKFvdRkG/ IUuvUtboEshRkve5VToVElBEZdOUVn6wOTotZTcJo6SpzO1PkWmZ8Rk5muEwiZk4Dlss VXdw== X-Gm-Message-State: AOJu0YxemaKfD8RZBHvapTUI8iVhsF2mIRGH4ikCz/71q4v4MckKA02b dQtYeOzaJBVUN2tZGaXy4aLOmfy1c2ybdV/82zs= X-Google-Smtp-Source: AGHT+IFJwqg+dEGvzyyno1ZBajEdQkFvo9gN2sCVYc22VBY/iWQKPP7ZCXfRBxl8njdqssCZYpgROw== X-Received: by 2002:a17:902:d4ce:b0:1bd:f71c:3af3 with SMTP id o14-20020a170902d4ce00b001bdf71c3af3mr12932562plg.32.1692822234207; Wed, 23 Aug 2023 13:23:54 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 28/48] tcg/arm: Implement negsetcond_i32 Date: Wed, 23 Aug 2023 13:23:06 -0700 Message-Id: <20230823202326.1353645-29-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822531977100011 Content-Type: text/plain; charset="utf-8" Trivial, as we simply need to load a different constant in the conditional move. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.h | 2 +- tcg/arm/tcg-target.c.inc | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index ad66f11574..311a985209 100644 --- a/tcg/arm/tcg-target.h +++ b/tcg/arm/tcg-target.h @@ -116,7 +116,7 @@ extern bool use_neon_instructions; #define TCG_TARGET_HAS_sextract_i32 use_armv7_instructions #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_mulu2_i32 1 #define TCG_TARGET_HAS_muls2_i32 1 #define TCG_TARGET_HAS_muluh_i32 0 diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 83e286088f..162df38c73 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -1975,6 +1975,14 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, tcg_out_dat_imm(s, tcg_cond_to_arm_cond[tcg_invert_cond(args[3])], ARITH_MOV, args[0], 0, 0); break; + case INDEX_op_negsetcond_i32: + tcg_out_dat_rIN(s, COND_AL, ARITH_CMP, ARITH_CMN, 0, + args[1], args[2], const_args[2]); + tcg_out_dat_imm(s, tcg_cond_to_arm_cond[args[3]], + ARITH_MVN, args[0], 0, 0); + tcg_out_dat_imm(s, tcg_cond_to_arm_cond[tcg_invert_cond(args[3])], + ARITH_MOV, args[0], 0, 0); + break; =20 case INDEX_op_brcond2_i32: c =3D tcg_out_cmp2(s, args, const_args); @@ -2112,6 +2120,7 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpc= ode op) case INDEX_op_add_i32: case INDEX_op_sub_i32: case INDEX_op_setcond_i32: + case INDEX_op_negsetcond_i32: return C_O1_I2(r, r, rIN); =20 case INDEX_op_and_i32: --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822457; cv=none; d=zohomail.com; s=zohoarc; b=adzuHZi23EZZSYlJDjRNTblFQSpygk/bk+FCwAVJTMMOCEt+PSk6nEmyL3fXXYOUJqSPV8425nAMOlvmrWkE9t2Dk/McuFtHeFn++1JWLLFaOYMio9pdPMi2Ywd2ZVrFtylKYU8f4k2wFKnEy/LyGJqhJzsA/A+no5uXPWpyz0I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822457; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SoXbN2inAVU70xEpEd9jztZdntpK43wt6w8LQmEU68E=; b=J33zkKSESR/qOMeuisWmbS2xwm3vHQcDZmO8Jb+KNFbCxCy3JcSzeiES10VS/sR9XEadmGYmVSrcBZ7d3U+azQNQDVBRtjxj5uKslDGlIPgX5qojdmydKpvdlN7Ew2vo/lNre+ie0TpkDK7oQbhonMfmeN/DR/O94Y9Ek1isO6w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822457837850.151932597146; Wed, 23 Aug 2023 13:27:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOk-0000Oa-Bi; 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 1qYuOZ-0008PR-36 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:04 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOU-0005WB-S6 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:01 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1bdf4752c3cso37627695ad.2 for ; Wed, 23 Aug 2023 13:23:56 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822235; x=1693427035; 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=SoXbN2inAVU70xEpEd9jztZdntpK43wt6w8LQmEU68E=; b=c6Iruv7eCcrUPCcg7KEgQ0dqIOoUn5fRNrEJOQgj/Ss8EsKuOqIG9daxHTJWjoFXMJ cF3OTSBt22Yv/Azs2eqg0MRXi2o9QqUeDk6BH0kQicnfYJK45Ict/+F54OmVHwPnnIym qehvCI6Ko8BWEx+LqiL2i63jRt2Xz7glkVNqjJDYxc1Bw9v+hG9FPSdkOvA+l0bJoExf VGEVJo7LtHGW0y1eDFmNHXRsbwy2HFDytkhp33NSTwWZiM2CNXZAolY9ga87ThFTsC/i hrwQXxjupLGUlqbXqby1HWnAsly1fqNoWVsUuhFN7Taonxx+0W9g2H/cPeoPIcZothWW h/YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822235; x=1693427035; 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=SoXbN2inAVU70xEpEd9jztZdntpK43wt6w8LQmEU68E=; b=g/yyZu8TF8ZneMuWteBOixrsRzDgsxOZf3luOW/29KPzP6RLJSUmDdHj8lby/7j/X0 7VA9WO01H+mqmbcDukHLlNX8bgd5ZU8kmx1c3YqzCUByLCqbUCkAhlpAANatX0pAst4r uMSJzcZzt1aN0Ri6KennwzdASEAHjEO+yTaUkSeRotu5ljPS8ssTTtpg2tI7wG8V7tDG EeFLHRy19z+V0LY1s0RNocISBXVPzhcaE1ju816uNU33sgmVxQ/WYmuNqctbrPtgrO11 qBZUrvYQDuV29NaMtB7GMJeb4L2pZXruV7vQd5PGD05MvrXvHQbaCjs20wo6GP83z1Bu WaYA== X-Gm-Message-State: AOJu0YyrdO1YAVLykPfSRvhuvONEqTcXRULjmsVWUw2vyw2p2r6A4iov 2x6F6Hh2q0rlXP7SDsqP0VxIhzmaoOgPmAqV1GU= X-Google-Smtp-Source: AGHT+IEJXFVHChG9zQ35fJQLrnXmqwCWgW+Ug1JFxWlp49bZvNSHUuxAh1NWdOYCu1CYB6ZWVdzbpQ== X-Received: by 2002:a17:903:2281:b0:1c0:86c6:95ca with SMTP id b1-20020a170903228100b001c086c695camr8777478plh.8.1692822235243; Wed, 23 Aug 2023 13:23:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza Subject: [PULL 29/48] tcg/riscv: Implement negsetcond_* Date: Wed, 23 Aug 2023 13:23:07 -0700 Message-Id: <20230823202326.1353645-30-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822459597100035 Content-Type: text/plain; charset="utf-8" Reviewed-by: Daniel Henrique Barboza Signed-off-by: Richard Henderson --- tcg/riscv/tcg-target.h | 4 ++-- tcg/riscv/tcg-target.c.inc | 45 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/tcg/riscv/tcg-target.h b/tcg/riscv/tcg-target.h index 0efb3fc0b8..c1132d178f 100644 --- a/tcg/riscv/tcg-target.h +++ b/tcg/riscv/tcg-target.h @@ -88,7 +88,7 @@ extern bool have_zbb; =20 /* optional instructions */ #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_div_i32 1 #define TCG_TARGET_HAS_rem_i32 1 #define TCG_TARGET_HAS_div2_i32 0 @@ -124,7 +124,7 @@ extern bool have_zbb; #define TCG_TARGET_HAS_qemu_st8_i32 0 =20 #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_div_i64 1 #define TCG_TARGET_HAS_rem_i64 1 #define TCG_TARGET_HAS_div2_i64 0 diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index eeaeb6b6e3..232b616af3 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -936,6 +936,44 @@ static void tcg_out_setcond(TCGContext *s, TCGCond con= d, TCGReg ret, } } =20 +static void tcg_out_negsetcond(TCGContext *s, TCGCond cond, TCGReg ret, + TCGReg arg1, tcg_target_long arg2, bool c2) +{ + int tmpflags; + TCGReg tmp; + + /* For LT/GE comparison against 0, replicate the sign bit. */ + if (c2 && arg2 =3D=3D 0) { + switch (cond) { + case TCG_COND_GE: + tcg_out_opc_imm(s, OPC_XORI, ret, arg1, -1); + arg1 =3D ret; + /* fall through */ + case TCG_COND_LT: + tcg_out_opc_imm(s, OPC_SRAI, ret, arg1, TCG_TARGET_REG_BITS - = 1); + return; + default: + break; + } + } + + tmpflags =3D tcg_out_setcond_int(s, cond, ret, arg1, arg2, c2); + tmp =3D tmpflags & ~SETCOND_FLAGS; + + /* If intermediate result is zero/non-zero: test !=3D 0. */ + if (tmpflags & SETCOND_NEZ) { + tcg_out_opc_reg(s, OPC_SLTU, ret, TCG_REG_ZERO, tmp); + tmp =3D ret; + } + + /* Produce the 0/-1 result. */ + if (tmpflags & SETCOND_INV) { + tcg_out_opc_imm(s, OPC_ADDI, ret, tmp, -1); + } else { + tcg_out_opc_reg(s, OPC_SUB, ret, TCG_REG_ZERO, tmp); + } +} + static void tcg_out_movcond_zicond(TCGContext *s, TCGReg ret, TCGReg test_= ne, int val1, bool c_val1, int val2, bool c_val2) @@ -1782,6 +1820,11 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, tcg_out_setcond(s, args[3], a0, a1, a2, c2); break; =20 + case INDEX_op_negsetcond_i32: + case INDEX_op_negsetcond_i64: + tcg_out_negsetcond(s, args[3], a0, a1, a2, c2); + break; + case INDEX_op_movcond_i32: case INDEX_op_movcond_i64: tcg_out_movcond(s, args[5], a0, a1, a2, c2, @@ -1910,6 +1953,8 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpc= ode op) case INDEX_op_xor_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, rI); =20 case INDEX_op_andc_i32: --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822489; cv=none; d=zohomail.com; s=zohoarc; b=DcLuLBZ7FpWl7i6cJc7YgmzmraEk8jLKnASwH8jTroqaG/NH+g/rwab36nmJtGlu5sTztCr9lF+rEu/bAWvIvfSH7R3EhHcWfvZuR+IoFMwou6qGNXe7lWsB227nxb5tqpTRfuljn8g4knfNFGLQO/r44umYcVe85ER4i9Dg9ns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822489; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bD2O0lrkRHwVXL3IDULQ9hX9URo+FxxM1i6zeSiE9KI=; b=FX7fi6cG7aLhq1tBw3bXcwGm5m3Egza0NeyrsVWThSDxPNurvmwJ71BKTSRD7LF0d+yEgG06aORYK4fr6KKCsabn6Qi100kT+3wJFYFNPsz6PWeI4/eYTtdblJ4s1eYghVarpuS1ElFPLSKgxzznov9SGckfxoc/7S4FdZbOWmQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822489869274.0636153058981; Wed, 23 Aug 2023 13:28:09 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOg-0000Fg-DF; Wed, 23 Aug 2023 16:24:10 -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 1qYuOZ-0008PT-2i for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:04 -0400 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOU-0005WJ-Rd for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:02 -0400 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1bf078d5fb7so41367365ad.0 for ; Wed, 23 Aug 2023 13:23:56 -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.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822236; x=1693427036; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=bD2O0lrkRHwVXL3IDULQ9hX9URo+FxxM1i6zeSiE9KI=; b=xMoO/x4K8Z1GjNfH6c6BgtdcV9JO/bR7AS1n4bAFGkhCm8uEhf3aJsBmptpDbeklS3 YoopuyuFt5YVmPphx8bnm8KIuHyOQRZe4dZTbl6X6kQ32KKKBbSn+W5soW9TPTO75iL5 iOzJP6PkvSXFtaYPLN5wnZ7oNWFgIO3O5RAgV4lXcR9uk8D5de8TbVFMmFd69ze9deTS Db/IWxnGhWrlYLxkFE5lNQjcuSIurtz9nLGKLnFDN9sR4kJ5wbuVPjlk8rn/+exUrHTX 3jTGlY+I3fBsNmXWrfaA3JuM0tvg0GZpu95L0iVS3a075HvraXF98N4QQjWFI+K0IsoL tJRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822236; x=1693427036; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bD2O0lrkRHwVXL3IDULQ9hX9URo+FxxM1i6zeSiE9KI=; b=Ac02vhPH4KKzvrFoN7FK4A9JoD32yeBRBiEYNrxK0Gvj1eJa23A4l9neG7Bn4nzqe5 c3l/sKgrgVHSPXujL+/PZlIntPLuj6LA2CqNLPK2eiSld1T58mWBsyOM2el+jj3RsFEa XaAFA0Q76PE9t98/mVoLnE0H9HlbLE3sOMj3RkQloO/lxu+kHW7dbYSxvpclaVCP8Aa1 iy9z5FsHoQNwpx97aR/eEE/jinuUKlHh8cO2MDPEnq1Wf+UfFAwwEeOXqh5zE+x0L6j6 Y/yt+d3CCa+NUKFcjnDNz7nEfO35XDuDcIbNB6/kQ/r8YUWplmJ3b8H2ypiUw1u4ShOB gwiQ== X-Gm-Message-State: AOJu0YwI4u7EDCr1YQn6ZdbUnOmCf6rerD/D636wd9H9Q1DRjzj0o6rk w/qtvklV6bFquEGRlJcm1qWvHR1q2Zi4J7HkDGA= X-Google-Smtp-Source: AGHT+IGH1s5ThQMKPYftctY9d4qP9jDRobRfXR9JTNtcg5BCYPQTIWg/3EddKeWtPxz8InrrJ/ypEA== X-Received: by 2002:a17:902:9888:b0:1bb:25bd:d091 with SMTP id s8-20020a170902988800b001bb25bdd091mr11399295plp.30.1692822235960; Wed, 23 Aug 2023 13:23:55 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 30/48] tcg/s390x: Implement negsetcond_* Date: Wed, 23 Aug 2023 13:23:08 -0700 Message-Id: <20230823202326.1353645-31-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822491034100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- tcg/s390x/tcg-target.h | 4 +- tcg/s390x/tcg-target.c.inc | 78 +++++++++++++++++++++++++------------- 2 files changed, 54 insertions(+), 28 deletions(-) diff --git a/tcg/s390x/tcg-target.h b/tcg/s390x/tcg-target.h index 123a4b1645..50e12ef9d6 100644 --- a/tcg/s390x/tcg-target.h +++ b/tcg/s390x/tcg-target.h @@ -96,7 +96,7 @@ extern uint64_t s390_facilities[3]; #define TCG_TARGET_HAS_sextract_i32 0 #define TCG_TARGET_HAS_extract2_i32 0 #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 @@ -132,7 +132,7 @@ extern uint64_t s390_facilities[3]; #define TCG_TARGET_HAS_sextract_i64 0 #define TCG_TARGET_HAS_extract2_i64 0 #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 1 diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index a94f7908d6..ecd8aaf2a1 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -1266,7 +1266,8 @@ static int tgen_cmp(TCGContext *s, TCGType type, TCGC= ond c, TCGReg r1, } =20 static void tgen_setcond(TCGContext *s, TCGType type, TCGCond cond, - TCGReg dest, TCGReg c1, TCGArg c2, int c2const) + TCGReg dest, TCGReg c1, TCGArg c2, + bool c2const, bool neg) { int cc; =20 @@ -1275,11 +1276,27 @@ static void tgen_setcond(TCGContext *s, TCGType typ= e, TCGCond cond, /* Emit: d =3D 0, d =3D (cc ? 1 : d). */ cc =3D tgen_cmp(s, type, cond, c1, c2, c2const, false); tcg_out_movi(s, TCG_TYPE_I64, dest, 0); - tcg_out_insn(s, RIEg, LOCGHI, dest, 1, cc); + tcg_out_insn(s, RIEg, LOCGHI, dest, neg ? -1 : 1, cc); return; } =20 - restart: + switch (cond) { + case TCG_COND_GEU: + case TCG_COND_LTU: + case TCG_COND_LT: + case TCG_COND_GE: + /* Swap operands so that we can use LEU/GTU/GT/LE. */ + if (!c2const) { + TCGReg t =3D c1; + c1 =3D c2; + c2 =3D t; + cond =3D tcg_swap_cond(cond); + } + break; + default: + break; + } + switch (cond) { case TCG_COND_NE: /* X !=3D 0 is X > 0. */ @@ -1292,11 +1309,20 @@ static void tgen_setcond(TCGContext *s, TCGType typ= e, TCGCond cond, =20 case TCG_COND_GTU: case TCG_COND_GT: - /* The result of a compare has CC=3D2 for GT and CC=3D3 unused. - ADD LOGICAL WITH CARRY considers (CC & 2) the carry bit. */ + /* + * The result of a compare has CC=3D2 for GT and CC=3D3 unused. + * ADD LOGICAL WITH CARRY considers (CC & 2) the carry bit. + */ tgen_cmp(s, type, cond, c1, c2, c2const, true); tcg_out_movi(s, type, dest, 0); tcg_out_insn(s, RRE, ALCGR, dest, dest); + if (neg) { + if (type =3D=3D TCG_TYPE_I32) { + tcg_out_insn(s, RR, LCR, dest, dest); + } else { + tcg_out_insn(s, RRE, LCGR, dest, dest); + } + } return; =20 case TCG_COND_EQ: @@ -1310,27 +1336,17 @@ static void tgen_setcond(TCGContext *s, TCGType typ= e, TCGCond cond, =20 case TCG_COND_LEU: case TCG_COND_LE: - /* As above, but we're looking for borrow, or !carry. - The second insn computes d - d - borrow, or -1 for true - and 0 for false. So we must mask to 1 bit afterward. */ + /* + * As above, but we're looking for borrow, or !carry. + * The second insn computes d - d - borrow, or -1 for true + * and 0 for false. So we must mask to 1 bit afterward. + */ tgen_cmp(s, type, cond, c1, c2, c2const, true); tcg_out_insn(s, RRE, SLBGR, dest, dest); - tgen_andi(s, type, dest, 1); - return; - - case TCG_COND_GEU: - case TCG_COND_LTU: - case TCG_COND_LT: - case TCG_COND_GE: - /* Swap operands so that we can use LEU/GTU/GT/LE. */ - if (!c2const) { - TCGReg t =3D c1; - c1 =3D c2; - c2 =3D t; - cond =3D tcg_swap_cond(cond); - goto restart; + if (!neg) { + tgen_andi(s, type, dest, 1); } - break; + return; =20 default: g_assert_not_reached(); @@ -1339,7 +1355,7 @@ static void tgen_setcond(TCGContext *s, TCGType type,= TCGCond cond, cc =3D tgen_cmp(s, type, cond, c1, c2, c2const, false); /* Emit: d =3D 0, t =3D 1, d =3D (cc ? t : d). */ tcg_out_movi(s, TCG_TYPE_I64, dest, 0); - tcg_out_movi(s, TCG_TYPE_I64, TCG_TMP0, 1); + tcg_out_movi(s, TCG_TYPE_I64, TCG_TMP0, neg ? -1 : 1); tcg_out_insn(s, RRFc, LOCGR, dest, TCG_TMP0, cc); } =20 @@ -2288,7 +2304,11 @@ static inline void tcg_out_op(TCGContext *s, TCGOpco= de opc, break; case INDEX_op_setcond_i32: tgen_setcond(s, TCG_TYPE_I32, args[3], args[0], args[1], - args[2], const_args[2]); + args[2], const_args[2], false); + break; + case INDEX_op_negsetcond_i32: + tgen_setcond(s, TCG_TYPE_I32, args[3], args[0], args[1], + args[2], const_args[2], true); break; case INDEX_op_movcond_i32: tgen_movcond(s, TCG_TYPE_I32, args[5], args[0], args[1], @@ -2566,7 +2586,11 @@ static inline void tcg_out_op(TCGContext *s, TCGOpco= de opc, break; case INDEX_op_setcond_i64: tgen_setcond(s, TCG_TYPE_I64, args[3], args[0], args[1], - args[2], const_args[2]); + args[2], const_args[2], false); + break; + case INDEX_op_negsetcond_i64: + tgen_setcond(s, TCG_TYPE_I64, args[3], args[0], args[1], + args[2], const_args[2], true); break; case INDEX_op_movcond_i64: tgen_movcond(s, TCG_TYPE_I64, args[5], args[0], args[1], @@ -3109,8 +3133,10 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOp= code op) case INDEX_op_rotr_i32: case INDEX_op_rotr_i64: case INDEX_op_setcond_i32: + case INDEX_op_negsetcond_i32: return C_O1_I2(r, r, ri); case INDEX_op_setcond_i64: + case INDEX_op_negsetcond_i64: return C_O1_I2(r, r, rA); =20 case INDEX_op_clz_i64: --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822355; cv=none; d=zohomail.com; s=zohoarc; b=WXf2Lx9N4ucKuOKoUwq9xd/s4MZ0eRBl7gv3dhJwX+B4n4Q0yB1jOtYSF0cIwMzSy0nS9zMqkApV2g2fbDI72yi4twg2QFg4cFhZpqWp1QzZfxtJSxTVboWGlIctHNwtXVsesxmweLq+u7ocgdMQOdF/8DUzVPQjR7ihN2ubWEE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822355; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=C8q9Haud9Zky3AnhOVlbezI32RyFzege/QayVrJIGCI=; b=fjYCfCU6MBvxr93Br/8zBRscJNXC4oOctyp72hbhgwEOJxSlGIxphXvJlo9NO0031VQmAwlNo+SgQS5E+4wKSJIx8OV6NeVsDEOon16wR07wE99v5Nws/0f9rCUQFF//7jMSzhJ/BzF1UnSSZMZSKMkhG4xtmJL9JY3y22HGlnU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822355390571.3843047264296; Wed, 23 Aug 2023 13:25:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOd-0008WT-Dg; Wed, 23 Aug 2023 16:24:07 -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-0008R7-7t for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:05 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOU-0005WR-SE for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:02 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1bc3d94d40fso47178615ad.3 for ; Wed, 23 Aug 2023 13:23:57 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822236; x=1693427036; 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=C8q9Haud9Zky3AnhOVlbezI32RyFzege/QayVrJIGCI=; b=aXlyRFwy6yp2lZQ3OHQzvJwqOqUmy4znq3oAr0H46olvNcezfyDU7OMeDhj398dftK kwGN7dJXcEbvuSLrQxtvKj7lKiBS6496isD0poEkfpAj51OyPRPMnfrmxEniOIk4U3Ew OHQsEw7FPq0xgcdTl7haGjeg+5Rr2B6SJPDqG4Rg1zvlbPYKoLwuqIux1V83jEtnShTG tnmE3y6nYCc05y4ZWz56bsmGWg2Ion0nXhglml4NpdlqWU04XpFaB0fBTSwTLhjOiJpt /R/23AL/DAFMXoCh3qF1iTmlLbPvdT0lJfA9ixRvIVetxLbts1shMJxRkznzNIwCIXzY gCjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822236; x=1693427036; 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=C8q9Haud9Zky3AnhOVlbezI32RyFzege/QayVrJIGCI=; b=hMAINlI/hr47htsx6rHRph6HAOo25Wl1FlAHxdEq3ZWvMQZsH0tiqdX6no0A/SbRGh LuXtL7XQBVB+O2+OLZsQo+uGexBQitxwxPlxJWUKYgsGaRpqgBMe87z61N6ZUECCn3IQ leHH3Hskv3D6MjE0hFiFvg43T7awTMUCuZQDP58FbiLhXb83DmCZqVF5qD+7J354XVR5 QVs6zxpu7UO5pfDG//imG3YWMRu6GAVvVvAwSq7TpFue2lF/VkFexPSJBTQbhRJxT2NT jF0gwvvsEgo+2wdtUTN6OKpehrY3FoIf91Z4oNWeX//IdZpFyowpIrdfN3RFC3RT7KKe Z8FQ== X-Gm-Message-State: AOJu0Yymer/qSKJ1Cm1X/iTRfQlC6D5mvU8qkgl7y5JO21oTTWotqCtV l2RqWStaEEpW9qZeDpHKHTfLLLEfNphZgjlt0/8= X-Google-Smtp-Source: AGHT+IFEkTaPLswUWo38fViPCiiQ0G54lGH0Hmod9+LW96nMwyl0I/T6Z3uSQhWiW+dzrOBICGaFwA== X-Received: by 2002:a17:903:4c5:b0:1bd:ec9e:59fe with SMTP id jm5-20020a17090304c500b001bdec9e59femr13062074plb.68.1692822236681; Wed, 23 Aug 2023 13:23:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 31/48] tcg/sparc64: Implement negsetcond_* Date: Wed, 23 Aug 2023 13:23:09 -0700 Message-Id: <20230823202326.1353645-32-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822356933100001 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/sparc64/tcg-target.h | 4 ++-- tcg/sparc64/tcg-target.c.inc | 40 +++++++++++++++++++++++++++--------- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/tcg/sparc64/tcg-target.h b/tcg/sparc64/tcg-target.h index 79889db760..3d41c9659b 100644 --- a/tcg/sparc64/tcg-target.h +++ b/tcg/sparc64/tcg-target.h @@ -106,7 +106,7 @@ extern bool use_vis3_instructions; #define TCG_TARGET_HAS_sextract_i32 0 #define TCG_TARGET_HAS_extract2_i32 0 #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 1 @@ -143,7 +143,7 @@ extern bool use_vis3_instructions; #define TCG_TARGET_HAS_sextract_i64 0 #define TCG_TARGET_HAS_extract2_i64 0 #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/sparc64/tcg-target.c.inc b/tcg/sparc64/tcg-target.c.inc index ffcb879211..f2a346a1bd 100644 --- a/tcg/sparc64/tcg-target.c.inc +++ b/tcg/sparc64/tcg-target.c.inc @@ -720,7 +720,7 @@ static void tcg_out_movcond_i64(TCGContext *s, TCGCond = cond, TCGReg ret, } =20 static void tcg_out_setcond_i32(TCGContext *s, TCGCond cond, TCGReg ret, - TCGReg c1, int32_t c2, int c2const) + TCGReg c1, int32_t c2, int c2const, bool n= eg) { /* For 32-bit comparisons, we can play games with ADDC/SUBC. */ switch (cond) { @@ -760,22 +760,34 @@ static void tcg_out_setcond_i32(TCGContext *s, TCGCon= d cond, TCGReg ret, default: tcg_out_cmp(s, c1, c2, c2const); tcg_out_movi_s13(s, ret, 0); - tcg_out_movcc(s, cond, MOVCC_ICC, ret, 1, 1); + tcg_out_movcc(s, cond, MOVCC_ICC, ret, neg ? -1 : 1, 1); return; } =20 tcg_out_cmp(s, c1, c2, c2const); if (cond =3D=3D TCG_COND_LTU) { - tcg_out_arithi(s, ret, TCG_REG_G0, 0, ARITH_ADDC); + if (neg) { + /* 0 - 0 - C =3D -C =3D (C ? -1 : 0) */ + tcg_out_arithi(s, ret, TCG_REG_G0, 0, ARITH_SUBC); + } else { + /* 0 + 0 + C =3D C =3D (C ? 1 : 0) */ + tcg_out_arithi(s, ret, TCG_REG_G0, 0, ARITH_ADDC); + } } else { - tcg_out_arithi(s, ret, TCG_REG_G0, -1, ARITH_SUBC); + if (neg) { + /* 0 + -1 + C =3D C - 1 =3D (C ? 0 : -1) */ + tcg_out_arithi(s, ret, TCG_REG_G0, -1, ARITH_ADDC); + } else { + /* 0 - -1 - C =3D 1 - C =3D (C ? 0 : 1) */ + tcg_out_arithi(s, ret, TCG_REG_G0, -1, ARITH_SUBC); + } } } =20 static void tcg_out_setcond_i64(TCGContext *s, TCGCond cond, TCGReg ret, - TCGReg c1, int32_t c2, int c2const) + TCGReg c1, int32_t c2, int c2const, bool n= eg) { - if (use_vis3_instructions) { + if (use_vis3_instructions && !neg) { switch (cond) { case TCG_COND_NE: if (c2 !=3D 0) { @@ -796,11 +808,11 @@ static void tcg_out_setcond_i64(TCGContext *s, TCGCon= d cond, TCGReg ret, if the input does not overlap the output. */ if (c2 =3D=3D 0 && !is_unsigned_cond(cond) && c1 !=3D ret) { tcg_out_movi_s13(s, ret, 0); - tcg_out_movr(s, cond, ret, c1, 1, 1); + tcg_out_movr(s, cond, ret, c1, neg ? -1 : 1, 1); } else { tcg_out_cmp(s, c1, c2, c2const); tcg_out_movi_s13(s, ret, 0); - tcg_out_movcc(s, cond, MOVCC_XCC, ret, 1, 1); + tcg_out_movcc(s, cond, MOVCC_XCC, ret, neg ? -1 : 1, 1); } } =20 @@ -1355,7 +1367,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, tcg_out_brcond_i32(s, a2, a0, a1, const_args[1], arg_label(args[3]= )); break; case INDEX_op_setcond_i32: - tcg_out_setcond_i32(s, args[3], a0, a1, a2, c2); + tcg_out_setcond_i32(s, args[3], a0, a1, a2, c2, false); + break; + case INDEX_op_negsetcond_i32: + tcg_out_setcond_i32(s, args[3], a0, a1, a2, c2, true); break; case INDEX_op_movcond_i32: tcg_out_movcond_i32(s, args[5], a0, a1, a2, c2, args[3], const_arg= s[3]); @@ -1437,7 +1452,10 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, tcg_out_brcond_i64(s, a2, a0, a1, const_args[1], arg_label(args[3]= )); break; case INDEX_op_setcond_i64: - tcg_out_setcond_i64(s, args[3], a0, a1, a2, c2); + tcg_out_setcond_i64(s, args[3], a0, a1, a2, c2, false); + break; + case INDEX_op_negsetcond_i64: + tcg_out_setcond_i64(s, args[3], a0, a1, a2, c2, true); break; case INDEX_op_movcond_i64: tcg_out_movcond_i64(s, args[5], a0, a1, a2, c2, args[3], const_arg= s[3]); @@ -1564,6 +1582,8 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpc= ode op) case INDEX_op_sar_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, rZ, rJ); =20 case INDEX_op_brcond_i32: --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822526; cv=none; d=zohomail.com; s=zohoarc; b=ddkcHp0N8l/cSULkyGdI+NCC/KSZ9AcNFFzmLTmbub4rWpFP0OTpYzUfeIE3wUC9KHqdMKWkkMKmwsNQSZHQ7OTDBsGXdOAQW/mOHEfmDeUiiGkbnZQVeIYBZMFAE0RxZ5sEh+DjE0RJEwNFEBseM4HucqPtzsF7ieX8E2qqOQk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822526; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kroIFaZ4+sbfT/0fKHygsaF2AQa5pGIMW/+727fk4mY=; b=ibDoe9PvXFKQ/CvJlObcsIf/UJJfGp4nN2bKewbcpHyqVDaVL+iv/x2heeI4Bfm7TFI7EvH7UR0CEKmjKVBasa/cEtT91ec2+m+nnhpT13SaCOvB0p/ppaXSO1zA9f4lRW0xr3e7PJQj8Hc9qwVLYb/6agMcs49JQYDrGzgJN/8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822526057456.2324267930675; Wed, 23 Aug 2023 13:28:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOn-0000cl-57; Wed, 23 Aug 2023 16:24:17 -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 1qYuOZ-0008PU-3D for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:04 -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 1qYuOU-0005WZ-Uc for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:02 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1bbc87ded50so41176585ad.1 for ; Wed, 23 Aug 2023 13:23:58 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822237; x=1693427037; 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=kroIFaZ4+sbfT/0fKHygsaF2AQa5pGIMW/+727fk4mY=; b=y/Vpa13GYkXqod87/ZXx82j6sRTFUI4tnP2hlrQniNzCubMiJTMnj5dZD9a7vCjy9C vycKGNQ88U2fPiaE9V1kbnsRIfbH5TaDvss3Wt94BuPIcSux/Bau63bLyh3mnXk3oTTF tqG/GN2j7xkAOisGL/PS0NXyhQCniLe+8xQhIW9PDLrhe1KyNhbsOLJ5nkTkhuMQb9Hz dz/SM2X9f29Q3ABRltyZ90Ki59dBLGmmjrnbiAwa/4fdDFSm0HAekRxVYC4okTGAn/L4 xYkgarAd8w085Vx+qfK41LFbS/o+L/Tsst5pWMXdZhoUL9YS0VqFOYCQh5d9adLO+Jut 5YOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822237; x=1693427037; 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=kroIFaZ4+sbfT/0fKHygsaF2AQa5pGIMW/+727fk4mY=; b=NTD7sYzGT9iEuURduiD/vZCNhZ801MXLVQRz6KOpnNPSWTS3utuCKsnK9JP4H3KW74 G6RwDPRzPEa7lqB1U78LHD1G/lw9499t7tOB5nJqvI5HqDCTwdNQSu0f/4HQsHkdOGss sIh7DwEHARdu0R2NkytF8F76fM7ctyu+rvEKJwu296jgW7R70KN6sTIeslzH1D86DjLN cxQerHAXB5ldcqK2mvrFj7uznInhrJpGU60jpO2mRUk838+LU64QsB3OjCOfTEZp8aIw UFMVl9FeW16Hbcq+HsGDPKpTyNCjtH4AhOIBpn3NoQPY2LoC7cd4JoFEPVJc154Hs9fQ EpOA== X-Gm-Message-State: AOJu0Yxg1upvcftxynjC7XqVapM9JJFXo766sDK0UzgZ/j/Jn8gJ1Hr1 QPxqjnsNLRROuOarlM+ULTcjEmI0ZS85HVB/Knk= X-Google-Smtp-Source: AGHT+IGgOfjvxuQ/PqR8vMxuwR7sNe52uxbey24+DiEPSRBTCXdndJ3UdVC8cr/+XE/u21ozgCIZZQ== X-Received: by 2002:a17:902:c411:b0:1bf:69af:b4e4 with SMTP id k17-20020a170902c41100b001bf69afb4e4mr13322009plk.37.1692822237593; Wed, 23 Aug 2023 13:23:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 32/48] tcg/i386: Merge tcg_out_brcond{32,64} Date: Wed, 23 Aug 2023 13:23:10 -0700 Message-Id: <20230823202326.1353645-33-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822526834100001 Pass a rexw parameter instead of duplicating the functions. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 110 +++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 61 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 3045b56002..33f66ba204 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1436,99 +1436,89 @@ static void tcg_out_cmp(TCGContext *s, TCGArg arg1,= TCGArg arg2, } } =20 -static void tcg_out_brcond32(TCGContext *s, TCGCond cond, - TCGArg arg1, TCGArg arg2, int const_arg2, - TCGLabel *label, int small) +static void tcg_out_brcond(TCGContext *s, int rexw, TCGCond cond, + TCGArg arg1, TCGArg arg2, int const_arg2, + TCGLabel *label, bool small) { - tcg_out_cmp(s, arg1, arg2, const_arg2, 0); + tcg_out_cmp(s, arg1, arg2, const_arg2, rexw); tcg_out_jxx(s, tcg_cond_to_jcc[cond], label, small); } =20 -#if TCG_TARGET_REG_BITS =3D=3D 64 -static void tcg_out_brcond64(TCGContext *s, TCGCond cond, - TCGArg arg1, TCGArg arg2, int const_arg2, - TCGLabel *label, int small) -{ - tcg_out_cmp(s, arg1, arg2, const_arg2, P_REXW); - tcg_out_jxx(s, tcg_cond_to_jcc[cond], label, small); -} -#else -/* XXX: we implement it at the target level to avoid having to - handle cross basic blocks temporaries */ +#if TCG_TARGET_REG_BITS =3D=3D 32 static void tcg_out_brcond2(TCGContext *s, const TCGArg *args, - const int *const_args, int small) + const int *const_args, bool small) { TCGLabel *label_next =3D gen_new_label(); TCGLabel *label_this =3D arg_label(args[5]); =20 switch(args[4]) { case TCG_COND_EQ: - tcg_out_brcond32(s, TCG_COND_NE, args[0], args[2], const_args[2], - label_next, 1); - tcg_out_brcond32(s, TCG_COND_EQ, args[1], args[3], const_args[3], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_NE, args[0], args[2], const_args[2], + label_next, 1); + tcg_out_brcond(s, 0, TCG_COND_EQ, args[1], args[3], const_args[3], + label_this, small); break; case TCG_COND_NE: - tcg_out_brcond32(s, TCG_COND_NE, args[0], args[2], const_args[2], - label_this, small); - tcg_out_brcond32(s, TCG_COND_NE, args[1], args[3], const_args[3], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_NE, args[0], args[2], const_args[2], + label_this, small); + tcg_out_brcond(s, 0, TCG_COND_NE, args[1], args[3], const_args[3], + label_this, small); break; case TCG_COND_LT: - tcg_out_brcond32(s, TCG_COND_LT, args[1], args[3], const_args[3], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_LT, args[1], args[3], const_args[3], + label_this, small); tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond32(s, TCG_COND_LTU, args[0], args[2], const_args[2], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_LTU, args[0], args[2], const_args[2], + label_this, small); break; case TCG_COND_LE: - tcg_out_brcond32(s, TCG_COND_LT, args[1], args[3], const_args[3], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_LT, args[1], args[3], const_args[3], + label_this, small); tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond32(s, TCG_COND_LEU, args[0], args[2], const_args[2], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_LEU, args[0], args[2], const_args[2], + label_this, small); break; case TCG_COND_GT: - tcg_out_brcond32(s, TCG_COND_GT, args[1], args[3], const_args[3], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_GT, args[1], args[3], const_args[3], + label_this, small); tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond32(s, TCG_COND_GTU, args[0], args[2], const_args[2], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_GTU, args[0], args[2], const_args[2], + label_this, small); break; case TCG_COND_GE: - tcg_out_brcond32(s, TCG_COND_GT, args[1], args[3], const_args[3], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_GT, args[1], args[3], const_args[3], + label_this, small); tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond32(s, TCG_COND_GEU, args[0], args[2], const_args[2], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_GEU, args[0], args[2], const_args[2], + label_this, small); break; case TCG_COND_LTU: - tcg_out_brcond32(s, TCG_COND_LTU, args[1], args[3], const_args[3], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_LTU, args[1], args[3], const_args[3], + label_this, small); tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond32(s, TCG_COND_LTU, args[0], args[2], const_args[2], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_LTU, args[0], args[2], const_args[2], + label_this, small); break; case TCG_COND_LEU: - tcg_out_brcond32(s, TCG_COND_LTU, args[1], args[3], const_args[3], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_LTU, args[1], args[3], const_args[3], + label_this, small); tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond32(s, TCG_COND_LEU, args[0], args[2], const_args[2], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_LEU, args[0], args[2], const_args[2], + label_this, small); break; case TCG_COND_GTU: - tcg_out_brcond32(s, TCG_COND_GTU, args[1], args[3], const_args[3], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_GTU, args[1], args[3], const_args[3], + label_this, small); tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond32(s, TCG_COND_GTU, args[0], args[2], const_args[2], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_GTU, args[0], args[2], const_args[2], + label_this, small); break; case TCG_COND_GEU: - tcg_out_brcond32(s, TCG_COND_GTU, args[1], args[3], const_args[3], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_GTU, args[1], args[3], const_args[3], + label_this, small); tcg_out_jxx(s, JCC_JNE, label_next, 1); - tcg_out_brcond32(s, TCG_COND_GEU, args[0], args[2], const_args[2], - label_this, small); + tcg_out_brcond(s, 0, TCG_COND_GEU, args[0], args[2], const_args[2], + label_this, small); break; default: g_assert_not_reached(); @@ -2574,8 +2564,9 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcod= e opc, tcg_out_modrm(s, OPC_POPCNT + rexw, a0, a1); break; =20 - case INDEX_op_brcond_i32: - tcg_out_brcond32(s, a2, a0, a1, const_args[1], arg_label(args[3]),= 0); + OP_32_64(brcond): + tcg_out_brcond(s, rexw, a2, a0, a1, const_args[1], + arg_label(args[3]), 0); break; case INDEX_op_setcond_i32: tcg_out_setcond32(s, args[3], a0, a1, a2, const_a2); @@ -2730,9 +2721,6 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcod= e opc, } break; =20 - case INDEX_op_brcond_i64: - tcg_out_brcond64(s, a2, a0, a1, const_args[1], arg_label(args[3]),= 0); - break; case INDEX_op_setcond_i64: tcg_out_setcond64(s, args[3], a0, a1, a2, const_a2); break; --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822391; cv=none; d=zohomail.com; s=zohoarc; b=JFlfHOG+2U0jFlEK1fvXrzfP910+l9t83da2H0XeILfKKsyu3v04COLMU5bF7CsSJ/o/WZltlC5+TF7/VcL0vqzO5p8ho268dWomlof2ZDwB1ta6y8DhQTPimeMNSLuZolapFN/dKV7YiK/T0R8sCgs2rthnVYzPnWO5AXw5KhM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822391; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZrRdZQsCRn1Wwa7rMBULMSKKjtejp0k93c02stP4yQw=; b=MnfrVGXS/ptCzo5nVRz1+h9h6E7AA2MS+YanZDwvoGuLbIpYc4ex9MmGOllVN+n67VrmDymb+oOlawFHDMM3i7E/I9UOAeWjSe9FoS0W4STx7uFEa+eDSuSHNqY0S4E4j/I6sXgfoeFhr9MEIv4Q1yBZIFUvrpAGxuFCkAvWjVk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822391524123.2793671114473; Wed, 23 Aug 2023 13:26:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOe-00008r-7i; Wed, 23 Aug 2023 16:24:08 -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-0008RE-8F for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:05 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOW-0005Wu-Rt for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:04 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1bdb7b0c8afso37596335ad.3 for ; Wed, 23 Aug 2023 13:23:59 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822238; x=1693427038; 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=ZrRdZQsCRn1Wwa7rMBULMSKKjtejp0k93c02stP4yQw=; b=ICBhFU/jmx8oy3yv4d7pZJ95QTqltuUzHO/Vf7VNmzrijl6sLXCTnWqAw0Hvssu0DF H43OweOF47gb7+DyBxx4PmqdQTGQtB8fUXu/t8f6Eq4volxcgktZwOLQq59FR8MULxUo xc8XKoDMZ0KweRDUqCn/8tNZAS5WG1NiSSc3FmUmT33FIl6/F7lXr3fjTKj4HzlG8+oj zefn53n00NlG5JSjgFCiRDzOukJ2HucF57PTP1HHeJyDRk5NH8PVfjvDAqBpDqfLT9CA mfQwMGN+pQNBOQNpvd4i2KdB7FGHsZJlykTtM1B7StMGCwopmB8iLdmV01360AmmTYyu +yzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822238; x=1693427038; 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=ZrRdZQsCRn1Wwa7rMBULMSKKjtejp0k93c02stP4yQw=; b=lGKXdXexJiZ8V+UZo7sOjz1skC3ACmilt6pt2SA7DxBlikqrmmOeqM3K/rkjjHY0LA b+IqI9GvWIPEUXlMPUefEyuL/0NpQN6gE7W2QNw7I4PnAs1bOUsgfFsXBtZZiY9dRAz2 v8cln6mW0Qhhv1/byBMsOBb3Uujfdb7NkBKhXN+ByZKLoU2is/UrOYAZh4exC6HMRQzI MvdiBqLSEx4m1GNxoscF44uqsC11LM0ddTiK+X8xy3x1iuG9bwaaU/wSoJ4BEVieTNz6 vHm16BSZrBNkEKSDDhOLYpjY5XsPRqk28/4WPXCsc3gTBDKX/HOxrHqs41GnIqdm808p U94w== X-Gm-Message-State: AOJu0Yx+fqaIDEuF3tPUi7lx7D79CQj+g7t4aGOXq4xSXi4FrvRq3owa exVHszd/Q9usouww/hfehIB9MIn7myYG97la0Jg= X-Google-Smtp-Source: AGHT+IHB0R7lD7nqniL3E9xzngvcjX4Sinl1Yx554BF5zhwEBDN27056MaLxnnmOYIcTgmLXFiu16A== X-Received: by 2002:a17:902:ee4d:b0:1b8:ae24:c207 with SMTP id 13-20020a170902ee4d00b001b8ae24c207mr10375307plo.68.1692822238387; Wed, 23 Aug 2023 13:23:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 33/48] tcg/i386: Merge tcg_out_setcond{32,64} Date: Wed, 23 Aug 2023 13:23:11 -0700 Message-Id: <20230823202326.1353645-34-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822393116100001 Pass a rexw parameter instead of duplicating the functions. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 33f66ba204..010432d3a9 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1527,23 +1527,16 @@ static void tcg_out_brcond2(TCGContext *s, const TC= GArg *args, } #endif =20 -static void tcg_out_setcond32(TCGContext *s, TCGCond cond, TCGArg dest, - TCGArg arg1, TCGArg arg2, int const_arg2) +static void tcg_out_setcond(TCGContext *s, int rexw, TCGCond cond, + TCGArg dest, TCGArg arg1, TCGArg arg2, + int const_arg2) { - tcg_out_cmp(s, arg1, arg2, const_arg2, 0); + tcg_out_cmp(s, arg1, arg2, const_arg2, rexw); tcg_out_modrm(s, OPC_SETCC | tcg_cond_to_jcc[cond], 0, dest); tcg_out_ext8u(s, dest, dest); } =20 -#if TCG_TARGET_REG_BITS =3D=3D 64 -static void tcg_out_setcond64(TCGContext *s, TCGCond cond, TCGArg dest, - TCGArg arg1, TCGArg arg2, int const_arg2) -{ - tcg_out_cmp(s, arg1, arg2, const_arg2, P_REXW); - tcg_out_modrm(s, OPC_SETCC | tcg_cond_to_jcc[cond], 0, dest); - tcg_out_ext8u(s, dest, dest); -} -#else +#if TCG_TARGET_REG_BITS =3D=3D 32 static void tcg_out_setcond2(TCGContext *s, const TCGArg *args, const int *const_args) { @@ -2568,8 +2561,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcod= e opc, tcg_out_brcond(s, rexw, a2, a0, a1, const_args[1], arg_label(args[3]), 0); break; - case INDEX_op_setcond_i32: - tcg_out_setcond32(s, args[3], a0, a1, a2, const_a2); + OP_32_64(setcond): + tcg_out_setcond(s, rexw, args[3], a0, a1, a2, const_a2); break; case INDEX_op_movcond_i32: tcg_out_movcond32(s, args[5], a0, a1, a2, const_a2, args[3]); @@ -2721,9 +2714,6 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcod= e opc, } break; =20 - case INDEX_op_setcond_i64: - tcg_out_setcond64(s, args[3], a0, a1, a2, const_a2); - break; case INDEX_op_movcond_i64: tcg_out_movcond64(s, args[5], a0, a1, a2, const_a2, args[3]); break; --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822456; cv=none; d=zohomail.com; s=zohoarc; b=EOOfAP6zazypcYdYEVZneq5IFK7MaZUI/exgStnxuQWNsWEsLhl9dgYQHepDuxp8l7mhFuPa09U6HayeFIbWH/RwBEoSRCYTU1kh/fdq+4uH9c49jVFTHiNTRPLFh2MJZKpy69avPvVZ+x9plBf7i2Yn05LLB9ZyBjl38LxQMBQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822456; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=M4APNRLcVqhrba52FGEmqpjKXb1Xd90praU1zvb8ru8=; b=XWLkVBi+mlxr32bK1GGZ/2u8UVOgnBJ5diqJdrIJoyFl9AF0ZAHWM6G0Qwbel/VnJUTM5iyaC8H5iY2bDSQK4xvZCZ+2GUxoBKwA9IMxBXaWHZZ+/hZDYg4OuyAEUnj8uWofN2SqyXfHk50dVfmLBtGc5O65sRAO2rVJ+2r3cjc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822456095582.8683534794384; Wed, 23 Aug 2023 13:27:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOf-0000DC-H9; Wed, 23 Aug 2023 16:24:09 -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-0008So-Qa for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:05 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOW-0005Xz-R9 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:05 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1bf3a2f44ffso44715635ad.1 for ; Wed, 23 Aug 2023 13:23:59 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822239; x=1693427039; 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=M4APNRLcVqhrba52FGEmqpjKXb1Xd90praU1zvb8ru8=; b=YiZDLOh7Lt9pPvVFkBEzQ/S5TqN4cW9tk2109wUVbLfA6PpyfTvyo23+YPwySmWc1p wKTkDndLGFBXCU5bURDRgzl6U3EUn1U7xW7tTyC4rcGk1X4nySdzFDK1bOIyVk57kolL lGdcoceh3YADZqzctdLSjW4TypwWK5HqXpyPyaWL3nf0pirHHDnOxoHz5SGoGm2pmpEL snTlPBUADa+1R3fj9XSocOMaqLZnD4HVXvz0It/Vw64/NJ3APIm+X+iTl5iH6a/K6v5J 6auGv68mil4YFxGpkn6qY8eExyc6VcW9MwRoVwObTDQAuBW5lHKwNuUBStF0TvY0Y7U1 Yg5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822239; x=1693427039; 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=M4APNRLcVqhrba52FGEmqpjKXb1Xd90praU1zvb8ru8=; b=fl3tuBziNLjrUEink3qaEqzqUZ+kHVMUqQoYkqGjQRmwGk8AMQsXGRxhChIZN7QlwE 7pCoyvgNP+Zn/hVTcwSJ7J4B4fCsH3oJ4p6ziSA7oDIbb9jBm8TCIjWYoEH0AyObBF0f X9rOu94yB4l6IDmP7Um/HKPcUpWewZmntEPaIoXBsmmqOHQvu4il2d3eSp+b5KqSYBAp Nic5wZZHlO624I39JHC4kFDCF9j9WuzmS6txXvHWh3inHSYhNBxhLvzY6TuC3UxG0314 d4Olb1rko8HLCfsdPcERSw3mFgxXuc8HV6ljIU9cFXtKjEV1Blxfn6rJFWX4DDRUuDWF +R3g== X-Gm-Message-State: AOJu0Ywu8YNR7kWGdaRwGsle7oxCf1ORtjKqLnj1VxXFWvs912DdzG39 RgdYJOXp0eJB87E2D/vuhWqiHfp/V2mlnr4AQGI= X-Google-Smtp-Source: AGHT+IHCV9N4VMvUtsi/qMEXoUCQncPq6c3xF0WaX2kW15Ko77t6bXYAOkstiUBFHfELLFrWMPEjvw== X-Received: by 2002:a17:902:db05:b0:1c0:c1d7:64ae with SMTP id m5-20020a170902db0500b001c0c1d764aemr530316plx.43.1692822239246; Wed, 23 Aug 2023 13:23:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [PULL 34/48] tcg/i386: Merge tcg_out_movcond{32,64} Date: Wed, 23 Aug 2023 13:23:12 -0700 Message-Id: <20230823202326.1353645-35-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822456822100031 Pass a rexw parameter instead of duplicating the functions. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 010432d3a9..1542afd94d 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1593,24 +1593,14 @@ static void tcg_out_cmov(TCGContext *s, TCGCond con= d, int rexw, } } =20 -static void tcg_out_movcond32(TCGContext *s, TCGCond cond, TCGReg dest, - TCGReg c1, TCGArg c2, int const_c2, - TCGReg v1) +static void tcg_out_movcond(TCGContext *s, int rexw, TCGCond cond, + TCGReg dest, TCGReg c1, TCGArg c2, int const_c= 2, + TCGReg v1) { - tcg_out_cmp(s, c1, c2, const_c2, 0); - tcg_out_cmov(s, cond, 0, dest, v1); + tcg_out_cmp(s, c1, c2, const_c2, rexw); + tcg_out_cmov(s, cond, rexw, dest, v1); } =20 -#if TCG_TARGET_REG_BITS =3D=3D 64 -static void tcg_out_movcond64(TCGContext *s, TCGCond cond, TCGReg dest, - TCGReg c1, TCGArg c2, int const_c2, - TCGReg v1) -{ - tcg_out_cmp(s, c1, c2, const_c2, P_REXW); - tcg_out_cmov(s, cond, P_REXW, dest, v1); -} -#endif - static void tcg_out_ctz(TCGContext *s, int rexw, TCGReg dest, TCGReg arg1, TCGArg arg2, bool const_a2) { @@ -2564,8 +2554,8 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcod= e opc, OP_32_64(setcond): tcg_out_setcond(s, rexw, args[3], a0, a1, a2, const_a2); break; - case INDEX_op_movcond_i32: - tcg_out_movcond32(s, args[5], a0, a1, a2, const_a2, args[3]); + OP_32_64(movcond): + tcg_out_movcond(s, rexw, args[5], a0, a1, a2, const_a2, args[3]); break; =20 OP_32_64(bswap16): @@ -2714,10 +2704,6 @@ static inline void tcg_out_op(TCGContext *s, TCGOpco= de opc, } break; =20 - case INDEX_op_movcond_i64: - tcg_out_movcond64(s, args[5], a0, a1, a2, const_a2, args[3]); - break; - case INDEX_op_bswap64_i64: tcg_out_bswap64(s, a0); break; --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822439; cv=none; d=zohomail.com; s=zohoarc; b=aVGjwd75pgjmzfx+I6ptljCn2772RqlBtDEmtL045OT10m4Z3mQUoOgb5DjkmekycabtjB7J6d3ydVu6oXRo1DM4aoRwpf0nbXmMVT4eDwEXBoJMWw1lA2VKxcJ5QgLy2+iTRwGonmqnslzgxz5MaeG3Ij/dq3H1o+1ufqwUgXA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822439; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9xk1+CqOJWdeIJliIlUjmMI38qlOB1/l73hqKwcbuPU=; b=JgBEroZ9zgcGKtai4kcC+fVzGJxQD1RxQs052fomMSO/pgd64Lk5QysiwFx7VB5XFFI8BOctzAjOow1B0SZ74VPsHeTYNYIxLkCJBEcoUGCTo5NOFzCIRmkjyP3qiHpF4pUOK5WidlKd8+6ot03ylz8rQDPpWZvHbWuQ7QcoUd0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822439360298.61975752910143; Wed, 23 Aug 2023 13:27:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOi-0000JZ-8M; Wed, 23 Aug 2023 16:24:12 -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-0008Sm-Ql for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:05 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOX-0005Y8-Ga for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:05 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-68bed2c786eso170186b3a.0 for ; Wed, 23 Aug 2023 13:24:00 -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.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822240; x=1693427040; 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=9xk1+CqOJWdeIJliIlUjmMI38qlOB1/l73hqKwcbuPU=; b=FGsldhpldi5c+MmYENtFBEeKgglocEIXXd3mfsgrDSlezn99WSuFxwrd+pYype+rhC qsnRwzI8Gc8xKkMm07LWmlHQHml1JMSusnUJOsiiMeAJEq27B3uz1FuDcKZlWiVHbePk f1wME7UehBvyBacLZWXqvLZhCK0Q5AE8dIbG5jrOwS5Q35vjqr6IkY8Z1VOBWxXE29MQ VxyV0ppiBZ0o3IKFjjWE2KIbumZhkeWbryqXNOJTNxB7SuGl4A4RmNtkQg6RVRs5cLR1 7JPAFpdryIB2fmMbw5qyptqRWE8EzlmjAle6a8vPFj7AwT4uvedSriBxq/Y8JDYgcHPv ppBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822240; x=1693427040; 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=9xk1+CqOJWdeIJliIlUjmMI38qlOB1/l73hqKwcbuPU=; b=T88cJh173wiA0dJs0H7YET9RGjIZtuiA0HXu4i+UXMoxkd/iB5VQHDlGO4TwwQ2Uk6 23hqny16D+vSeMjNjnMfOtyNqqDu45ROUWeBVgFwi1AcWvJGOM/M+2nQwV7KPSDp7rak SVQMtKJLJCGmmi/FwjqXg3r5APVvVIX+7VdQDUnc3vSxOepO6Cj9SyYkSUTZ9C2SILEq R9G7BiNR3WNNIthLWtmymiGi7J6iRW66WSHE+AwMOS3gfHl1PpSxfwbI19RpmNWjBO9E ZRuvNpMJimcp+fggxKntL3qidWmyHf3dvTDjtLbvMhIkx12pBQCVthdSOKFcafScHLGI fxcA== X-Gm-Message-State: AOJu0YyXAjch1LSfxt2yXy84fiKZeHo6aOIWeBNnBZI6xfYFLwYpMk+O JoiIhdUgOoRpXaoke0w2kVnWFNWlgac65V7Yph0= X-Google-Smtp-Source: AGHT+IESF6wfuKvMlVqVlXFRT49MUbdXMT91tpr5P4FHUwZcewZmY0tJLkge6aSNer/DPp4DMkUzUQ== X-Received: by 2002:a05:6a20:969a:b0:147:d309:be7b with SMTP id hp26-20020a056a20969a00b00147d309be7bmr9855861pzc.62.1692822240060; Wed, 23 Aug 2023 13:24:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 35/48] tcg/i386: Use CMP+SBB in tcg_out_setcond Date: Wed, 23 Aug 2023 13:23:13 -0700 Message-Id: <20230823202326.1353645-36-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822441319100005 Content-Type: text/plain; charset="utf-8" Use the carry bit to optimize some forms of setcond. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 50 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 1542afd94d..4d7b745a52 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1531,6 +1531,56 @@ static void tcg_out_setcond(TCGContext *s, int rexw,= TCGCond cond, TCGArg dest, TCGArg arg1, TCGArg arg2, int const_arg2) { + bool inv =3D false; + + switch (cond) { + case TCG_COND_NE: + inv =3D true; + /* fall through */ + case TCG_COND_EQ: + /* If arg2 is 0, convert to LTU/GEU vs 1. */ + if (const_arg2 && arg2 =3D=3D 0) { + arg2 =3D 1; + goto do_ltu; + } + break; + + case TCG_COND_LEU: + inv =3D true; + /* fall through */ + case TCG_COND_GTU: + /* If arg2 is a register, swap for LTU/GEU. */ + if (!const_arg2) { + TCGReg t =3D arg1; + arg1 =3D arg2; + arg2 =3D t; + goto do_ltu; + } + break; + + case TCG_COND_GEU: + inv =3D true; + /* fall through */ + case TCG_COND_LTU: + do_ltu: + /* + * Relying on the carry bit, use SBB to produce -1 if LTU, 0 if GE= U. + * We can then use NEG or INC to produce the desired result. + * This is always smaller than the SETCC expansion. + */ + tcg_out_cmp(s, arg1, arg2, const_arg2, rexw); + tgen_arithr(s, ARITH_SBB, dest, dest); /* T:-1 F:0 */ + if (inv) { + tgen_arithi(s, ARITH_ADD, dest, 1, 0); /* T:0 F:1 */ + } else { + tcg_out_modrm(s, OPC_GRP3_Ev, EXT3_NEG, dest); /* T:1 F:0 */ + } + return; + + default: + break; + } + tcg_out_cmp(s, arg1, arg2, const_arg2, rexw); tcg_out_modrm(s, OPC_SETCC | tcg_cond_to_jcc[cond], 0, dest); tcg_out_ext8u(s, dest, dest); --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822277; cv=none; d=zohomail.com; s=zohoarc; b=m8hKEQwOCUs8pC4C5eYMCDfOo1jrTqc2iukrR+svBOzYKBofM4zcJPLZTNQXnIPdgQ8Yjl6UFupU6CqNjzG4GPBx11M7Bq3Io1SQKcqls3tx73lj6PhiXj9Vd3GFRDgeROtxaCg7BEe4Teqpr8fibncmSj4Ue+7p532Bu1huZ8U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822277; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fwTSAJniEJxZbT4fbmyP3S6oSlLWMsUHRkmcSVO+gJc=; b=JuKVNkCfDS1g5nt6ypStMNYwry7qYItx9vNeHWe4NOgXT1+w3lNyxf74LmuiMRimlrZji9G3s3XUdTNwWjTZonezE6XoYNtfTMzeY1uUfNVHbR+BNsdw0/y19CxBpcq9bRcKlvegeb1ZaPKrBr8ELM3+YPm8z9pxftI9u6QrcCA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822276893416.4708998288403; Wed, 23 Aug 2023 13:24:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOp-0000oS-Os; Wed, 23 Aug 2023 16:24:19 -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 1qYuOc-0008TR-KH for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:07 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOY-0005Yb-Na for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:06 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1bf7a6509deso25220755ad.3 for ; Wed, 23 Aug 2023 13:24:01 -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.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822241; x=1693427041; 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=fwTSAJniEJxZbT4fbmyP3S6oSlLWMsUHRkmcSVO+gJc=; b=CTgLdT3LVLYStCyduEeT75Q/bCHmjp80TJzhuG303Z6EaPIV3D7BixXpvp2T+pbpfh yPs7PdrpGiO/xHbwwNzHf+EgZ4GAGKkKq8lru+PnCuFpGJSVUN596lsWvGlYe1t8dzju RjbF3JGHwoU+GiOCjefy3xytgghZa+qvPYOHqLN7SrzjK/svcA0msOavIxW2KjA7V/2q 1YM9ExapQyWf3/0cOaxPypibgWbTbZ+UzsA3BAwduemUffWKG0YBFOu6HSWbap75Rf+Z Tph2OShEM8Y1R5MJxabIOLdcpxgnwojDk87kpF7FrUm0x9KNEC06QEzXTcgm1tslUlkS jL7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822241; x=1693427041; 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=fwTSAJniEJxZbT4fbmyP3S6oSlLWMsUHRkmcSVO+gJc=; b=NFXzL/nBxvqr6iQsW/nMbW03kHeSTOduVKHfz6oVuBDdUm/wqh4PVNbAsfmdFlFn4n 4gJ6seqfQm0fvfo+svefAedOmx60P1pu1mXZ0r/LKzMPPtY5T3wUiNyNxrzjQ06RlllP IBy+AxEccMjAOno09ZceschlFzrSaPQdNgZvUEi5G+p4xXCRLv5jyQhyiolaxxkZhZ8m YLJwcoIjQykl9VVIVTtwVzI8m/5bA89ieq8idgHxV7ozghvJyy2c2fCgy0kkFi3SDhTQ NWAzf+gW2HMH2Q4ldFYppA0PimZsffnfafIvp3QZioemHDM3we1YamOL3hbhdvqnErJi Q5yA== X-Gm-Message-State: AOJu0YytfnJnhMrMPCFu2pR2MWmIAzKFUEYlkO9TFQQrbb8/Gag5zC5Q WsiK3HjAvsRdDb/06Y/Lb+TF0LzglnUGPdXRGgQ= X-Google-Smtp-Source: AGHT+IH5XhktPmypwrgK+iaH/LlNaLd5T+pnmOnl+a3FENvfblNRwDpu/1sTbgW66VRxJyAUe5OzcA== X-Received: by 2002:a17:902:b617:b0:1be:f76e:7664 with SMTP id b23-20020a170902b61700b001bef76e7664mr10151383pls.29.1692822240853; Wed, 23 Aug 2023 13:24:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 36/48] tcg/i386: Clear dest first in tcg_out_setcond if possible Date: Wed, 23 Aug 2023 13:23:14 -0700 Message-Id: <20230823202326.1353645-37-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822278538100003 Content-Type: text/plain; charset="utf-8" Using XOR first is both smaller and more efficient, though cannot be applied if it clobbers an input. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 4d7b745a52..3f3c114efd 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1532,6 +1532,7 @@ static void tcg_out_setcond(TCGContext *s, int rexw, = TCGCond cond, int const_arg2) { bool inv =3D false; + bool cleared; =20 switch (cond) { case TCG_COND_NE: @@ -1581,9 +1582,23 @@ static void tcg_out_setcond(TCGContext *s, int rexw,= TCGCond cond, break; } =20 + /* + * If dest does not overlap the inputs, clearing it first is preferred. + * The XOR breaks any false dependency for the low-byte write to dest, + * and is also one byte smaller than MOVZBL. + */ + cleared =3D false; + if (dest !=3D arg1 && (const_arg2 || dest !=3D arg2)) { + tgen_arithr(s, ARITH_XOR, dest, dest); + cleared =3D true; + } + tcg_out_cmp(s, arg1, arg2, const_arg2, rexw); tcg_out_modrm(s, OPC_SETCC | tcg_cond_to_jcc[cond], 0, dest); - tcg_out_ext8u(s, dest, dest); + + if (!cleared) { + tcg_out_ext8u(s, dest, dest); + } } =20 #if TCG_TARGET_REG_BITS =3D=3D 32 --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822371; cv=none; d=zohomail.com; s=zohoarc; b=WQbCjKwIKOfwu6+oeX1urWBpnDIrTqyCBGYeD4mgo88gsLm3nnF9FtOx4ysEKtlEavK5NiCeXZFTwfRXnhZF6kQ6uscPAw0e8VRUDWP3XNYUB1WMLflUhISNt42skN+aAu4zgH/aiEbUCK5Vpri77JdsC99JmKR0wWXzPlDteR4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822371; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3K5ktodiRtLGFrSNUtNIXw44/pXcMbwHgN1qIEY5z9Y=; b=MeQspM95k7ElPpa+ql9XUokVHV1RmS88D71oPgiIyLr1xdxcE3KjVQMmwnwMkPm6zJYe1pB+YiNPrBS5MGwSN6vk1HyBe5SO5nXE3lILCFipMjm7ImD+rO2k5Lm1jJppwdKjJPrpDYl7Pc5ffOmOgQCqB+EWMPw6/eMPyQBu9eU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822371891963.417468804199; Wed, 23 Aug 2023 13:26:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOp-0000mG-58; Wed, 23 Aug 2023 16:24:19 -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 1qYuOc-0008WO-UR for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:07 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOa-0005Yj-M9 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:06 -0400 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1bf078d5fb7so41368195ad.0 for ; Wed, 23 Aug 2023 13:24:02 -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.24.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822242; x=1693427042; 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=3K5ktodiRtLGFrSNUtNIXw44/pXcMbwHgN1qIEY5z9Y=; b=V/8RcNXfhIyF5Jjq1ofvLGmUWkvBsTo73bw0p0R47PqzEtvAlvagsUggUzHKnVABWc bo5tL7Ake7Fg7mHqCxQxivwaoM9Y6o/MFTYAf4I57pOq8qaPHAfFPXB7NyyCN7UqchrT jRCwIFNXlkvpHf9IUmQs7mDqffJZQygy/iL7Vr/9YIPAMvu7XdbSv6dATYyRZUGf6MvO OZMMNwq6dgAeQc6T9pbUxcCjg4t8iPqziGWT5eOdiEgqsSgNJymvQBTqLnWPABTxxqrC jLV7xvl9iw5938hm3kjnksHsAuYiXkatzGHSVm1N/yrqXPkEwiXbuHVAHyuCvyzyjCTm ZFpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822242; x=1693427042; 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=3K5ktodiRtLGFrSNUtNIXw44/pXcMbwHgN1qIEY5z9Y=; b=jz/7xLReHSpGqD4GDQVEx0a1dJH76a96wuG4estxjOCAxZpZ/wKf75R1N480gcZEse VZCNwW/iY9Uj97k4+C3MeRm8mho/iEazpC+OzxN3Ri7Hj/1ZfS8q3vLDnXwD4Xiv+iKe AOHfuInGrCgUn7Vot4tOb7NOkXwBmRTMaG/O8e7g2PGJFGMcShmN7nA6gCXAKOs0qTEm cbuA62ndDJs71/Vy7m34bSH19xPQFJDgqZ9m0DfTrKHpfDJFq9u1y5TmIby5qhXAE6Oo a1Y86EA3WBLWEPJNskee07ItuDM2jQiaw5H11PEJB5YpsIwU+I0fXfZ1mErCoDvUlg2l P1hg== X-Gm-Message-State: AOJu0Yy3T7ipTDsGwHZuuL3qgfD/VttRepg17QlBYGpbvepfZkVmVHQm Y2M3Qb4jjfpiVS2i5kaMI/BAgQ+R5wz+vHeRvmo= X-Google-Smtp-Source: AGHT+IHqyPU3cghK2GjiqgugvqRQWt6eAEPRxHpzQd86GfZTRoklYY8vLBFeQ0gVQBLNpxHwsS3kXw== X-Received: by 2002:a17:902:da89:b0:1bd:c956:2798 with SMTP id j9-20020a170902da8900b001bdc9562798mr13219091plx.46.1692822241873; Wed, 23 Aug 2023 13:24:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 37/48] tcg/i386: Use shift in tcg_out_setcond Date: Wed, 23 Aug 2023 13:23:15 -0700 Message-Id: <20230823202326.1353645-38-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822372263100002 Content-Type: text/plain; charset="utf-8" For LT/GE vs zero, shift down the sign bit. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.c.inc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 3f3c114efd..16e830051d 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1578,6 +1578,21 @@ static void tcg_out_setcond(TCGContext *s, int rexw,= TCGCond cond, } return; =20 + case TCG_COND_GE: + inv =3D true; + /* fall through */ + case TCG_COND_LT: + /* If arg2 is 0, extract the sign bit. */ + if (const_arg2 && arg2 =3D=3D 0) { + tcg_out_mov(s, rexw ? TCG_TYPE_I64 : TCG_TYPE_I32, dest, arg1); + if (inv) { + tcg_out_modrm(s, OPC_GRP3_Ev + rexw, EXT3_NOT, dest); + } + tcg_out_shifti(s, SHIFT_SHR + rexw, dest, rexw ? 63 : 31); + return; + } + break; + default: break; } --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822453; cv=none; d=zohomail.com; s=zohoarc; b=S2nW+md+8mtGR0luQdu5n1vbVBino9zXlezWN8rhrmMPf8k7YWlqFAbJJbFJxs9JSc9t+DNB5M4mG9BEScISeCulo3D+ehVYlQbp8k3gysZ1T635V+yhYEfKEfEaMeTAAbX3hssHh0ZJtzahE8yR69KLGaMjWCyZhTL7Ffmh0N4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822453; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=wG5QxLCPCygmOeXAqyBKDVStp+bJY2vk6G2jyk8UbZc=; b=hLvtpfl0/BD+RWlr/QXY9pTz3XZtxTmDKjWz8FFfOf0AIvkHIOfIJt4SpXDK3GiUpDmIyZqT7g38sd1WjtZss7bRblsON3R2ix4kAzjztxghYCzosOiaC0ZTTx9527yPAcDO44Sz10So9hbh6DjhjK5U5/SxMyQ2f8dr4sCnzvE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822453054794.2852497822445; Wed, 23 Aug 2023 13:27:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOl-0000W0-JR; Wed, 23 Aug 2023 16:24:15 -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 1qYuOd-00005k-KM for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:07 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuOa-0005ZK-SD for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:06 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1bee82fad0fso40070915ad.2 for ; Wed, 23 Aug 2023 13:24:03 -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.24.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:24:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822243; x=1693427043; 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=wG5QxLCPCygmOeXAqyBKDVStp+bJY2vk6G2jyk8UbZc=; b=L+hu/WKPxmVg5yhileK3dC+nPTEDqBlf+uzVMwmvJdxVn0KUFNqw3qFJrNgREWaegn 4V5ysGeXh4C1bKGaybyRZ6xQHQNsJGF7ErDy/iwlf5RsaMI8SIr0Ozy6D6ZaQnLxSJtm fN+eNDVBuusk86gcAiTtmAiAvPNVpThSygSBCD7nbvgWSGxKgT7QYEZGkhnPMRn+Fzow pVniUczsOc4jLcbzHS+vZeVwiVF6/uw+KSdzy2gU1xu+6nGgkaHhGV7c364bwwWczixe qK7sfnFsOvIsMbNbPPT18wNfcIIE6rZsyMF+OeroqJa+5VOfDbzjv9h/9TAW3eHr4LEI YIsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822243; x=1693427043; 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=wG5QxLCPCygmOeXAqyBKDVStp+bJY2vk6G2jyk8UbZc=; b=Ko4jvWsDJQJ3rJTG9amIzeY7NPwKIN99wmUQFJrtE7qbU1DIGGAHpxmYHDJ3EE4YGE v1S7MUK9R3yZ4tivzmOaepPr0ZdOBQaMLUFeaVtIWAbvZgx/UsDHqgROyoIwZ7/afWmn IRhI41jXr+o8RIbQUEcgwTNqwS3XUElnaH28FPt4Sovb/ZQHhLCS9Jlh0NUqFDbXmr72 49TDBLz1TU8iiEjgQ6jkygaW9aRvNreXgcqp/6nAdpsZuKXRtk/kXEwiY62wQliFL/zB Ax0W9V2n3Qq0lXZSDpgTpk4EnppVzpI7t97c97cJGIEq2iWe+rz1JGWYRQ1ECEm4MZ+Q 1vhw== X-Gm-Message-State: AOJu0Yx5YlCaK5Rjx01FkpmQAKpeP+lz+NZzS8vFzQjwJMdN4nZl//Bj POfZHN5Hr4npSSkZTqavREYoe2rbD6VhJre8zDs= X-Google-Smtp-Source: AGHT+IGIRgcd3Zg1OnDFR8PBqOV8704Vwnjic7aPRWxZeiJsRcPiSsW2P1UE/vSozcOU7TTOJPpGUQ== X-Received: by 2002:a17:902:b582:b0:1b9:e591:db38 with SMTP id a2-20020a170902b58200b001b9e591db38mr10239624pls.8.1692822242814; Wed, 23 Aug 2023 13:24:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Peter Maydell Subject: [PULL 38/48] tcg/i386: Implement negsetcond_* Date: Wed, 23 Aug 2023 13:23:16 -0700 Message-Id: <20230823202326.1353645-39-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822454794100027 Content-Type: text/plain; charset="utf-8" Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- tcg/i386/tcg-target.h | 4 ++-- tcg/i386/tcg-target.c.inc | 32 ++++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/tcg/i386/tcg-target.h b/tcg/i386/tcg-target.h index ebc0b1a6ce..8417ea4899 100644 --- a/tcg/i386/tcg-target.h +++ b/tcg/i386/tcg-target.h @@ -150,7 +150,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 1 @@ -187,7 +187,7 @@ typedef enum { #define TCG_TARGET_HAS_sextract_i64 0 #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 1 diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc index 16e830051d..0c3d1e4cef 100644 --- a/tcg/i386/tcg-target.c.inc +++ b/tcg/i386/tcg-target.c.inc @@ -1529,7 +1529,7 @@ static void tcg_out_brcond2(TCGContext *s, const TCGA= rg *args, =20 static void tcg_out_setcond(TCGContext *s, int rexw, TCGCond cond, TCGArg dest, TCGArg arg1, TCGArg arg2, - int const_arg2) + int const_arg2, bool neg) { bool inv =3D false; bool cleared; @@ -1570,11 +1570,18 @@ static void tcg_out_setcond(TCGContext *s, int rexw= , TCGCond cond, * This is always smaller than the SETCC expansion. */ tcg_out_cmp(s, arg1, arg2, const_arg2, rexw); - tgen_arithr(s, ARITH_SBB, dest, dest); /* T:-1 F:0 */ - if (inv) { - tgen_arithi(s, ARITH_ADD, dest, 1, 0); /* T:0 F:1 */ - } else { - tcg_out_modrm(s, OPC_GRP3_Ev, EXT3_NEG, dest); /* T:1 F:0 */ + + /* X - X - C =3D -C =3D (C ? -1 : 0) */ + tgen_arithr(s, ARITH_SBB + (neg ? rexw : 0), dest, dest); + if (inv && neg) { + /* ~(C ? -1 : 0) =3D (C ? 0 : -1) */ + tcg_out_modrm(s, OPC_GRP3_Ev + rexw, EXT3_NOT, dest); + } else if (inv) { + /* (C ? -1 : 0) + 1 =3D (C ? 0 : 1) */ + tgen_arithi(s, ARITH_ADD, dest, 1, 0); + } else if (!neg) { + /* -(C ? -1 : 0) =3D (C ? 1 : 0) */ + tcg_out_modrm(s, OPC_GRP3_Ev, EXT3_NEG, dest); } return; =20 @@ -1588,7 +1595,8 @@ static void tcg_out_setcond(TCGContext *s, int rexw, = TCGCond cond, if (inv) { tcg_out_modrm(s, OPC_GRP3_Ev + rexw, EXT3_NOT, dest); } - tcg_out_shifti(s, SHIFT_SHR + rexw, dest, rexw ? 63 : 31); + tcg_out_shifti(s, (neg ? SHIFT_SAR : SHIFT_SHR) + rexw, + dest, rexw ? 63 : 31); return; } break; @@ -1614,6 +1622,9 @@ static void tcg_out_setcond(TCGContext *s, int rexw, = TCGCond cond, if (!cleared) { tcg_out_ext8u(s, dest, dest); } + if (neg) { + tcg_out_modrm(s, OPC_GRP3_Ev + rexw, EXT3_NEG, dest); + } } =20 #if TCG_TARGET_REG_BITS =3D=3D 32 @@ -2632,7 +2643,10 @@ static inline void tcg_out_op(TCGContext *s, TCGOpco= de opc, arg_label(args[3]), 0); break; OP_32_64(setcond): - tcg_out_setcond(s, rexw, args[3], a0, a1, a2, const_a2); + tcg_out_setcond(s, rexw, args[3], a0, a1, a2, const_a2, false); + break; + OP_32_64(negsetcond): + tcg_out_setcond(s, rexw, args[3], a0, a1, a2, const_a2, true); break; OP_32_64(movcond): tcg_out_movcond(s, rexw, args[5], a0, a1, a2, const_a2, args[3]); @@ -3377,6 +3391,8 @@ static TCGConstraintSetIndex tcg_target_op_def(TCGOpc= ode op) =20 case INDEX_op_setcond_i32: case INDEX_op_setcond_i64: + case INDEX_op_negsetcond_i32: + case INDEX_op_negsetcond_i64: return C_O1_I2(q, r, re); =20 case INDEX_op_movcond_i32: --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822394; cv=none; d=zohomail.com; s=zohoarc; b=hZQaWZfWWp7Ukeeqz0orsQmgNxfhyanGzR+nE47vuohd/7NZUlyL2gHUbNwxDZcw66IxHumhL9vxTQtfVQ+aE+cOA7AQEVKNL8R0s1Ph2F9o4o62nt0HseUeY6jVFZBuAIcYYQqpFo72zucuvmUU4JVdKRlPsE5bN+A7A52iSbE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822394; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2d7f9xMn3s76GGCrTSbv49LCbGX2TpxUayf0OW1Jmmg=; b=WV3GxYt0jYjWvMpotYqS3vVWxA3XHEQ6JOxwpBcLc/SdQ6kUaC5C88siEJ3TEIzEzDYiKJ+bLj9OynIsKzQW8mEj1QMlUS7SvLBRZ9LJXO9e0JpJqpF/umY9R0heeXdpfx0IMIfjo4KY3ABCRsBwnWIlFgTpxcPw/pbZr8tK08Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822394193786.8119128131465; Wed, 23 Aug 2023 13:26:34 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuOh-0000Ht-Ej; Wed, 23 Aug 2023 16:24:11 -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 1qYuOd-00005V-Hq for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:07 -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 1qYuOa-0005ZU-SG for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:24:06 -0400 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1bf57366ccdso1605605ad.1 for ; Wed, 23 Aug 2023 13:24:04 -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.24.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:24:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822243; x=1693427043; 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=2d7f9xMn3s76GGCrTSbv49LCbGX2TpxUayf0OW1Jmmg=; b=i7LrKwRtWPnBLIGZngc6Xiy7boKCuCaTb2gsuiXUbTHpbGnkarDf0KE6Ke/M9rewHT dYMcdy7RIUVHmky80ZKf94XklAxxpu6Mo/W2Ay2CW4ixje4GZnGurIUmZgw25Lj8qQrb 7T8LCo2YHmG+9eN5xAVV16ZFLfk8t82yHmR5wxDfm+yxVcf1a77OkAcgWEVbqRAB4PNn AkuPZYJlqlPG8WTZln6CFgcyHERsuxwK9PmzQYUo7eY2NbeOl+Dx+svRKDXi1eYyOi+4 5fuEJUC5Ifg25o95P260IAvsTJ7dEtZ4vIFCnsKShoUG4O4PM+ELp9AgOuefkfc0jdNH lSkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822243; x=1693427043; 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=2d7f9xMn3s76GGCrTSbv49LCbGX2TpxUayf0OW1Jmmg=; b=JiI0+gb/DT8jt9wbSIxgw03xSpPN9LXY8l7ns70/1QtcZwUBn/CEI+P+7MELm0hl7g PDtPAnWVAHO6pYJkY4bi9lghoInGvygUs8U8hZMRpQhRCeD1eam3j3tlP/rTZZFm51aq jrXrecD1MMf4WfFa7rQXKXqns/OsGMRnNFP40Z8ndSNU2FYW+2izwAL55Et/RsdWGbDZ +3FOcWgFITO9JiU/8+pEoz8yndlsy4KU/QIBF4JuZWiZ4lvzBH4jtOGd9Lt57gcubmhx StkHqvSC+KYlwJ3vIaMNpZjdwseiPpm9kN1hZX5+Om5mxKHMzs6c6gjSKIVZlpSt6f1h cpmQ== X-Gm-Message-State: AOJu0YyaOBEau1092dYo1OW8P282+q6eSFM7f74JMzuou9nw5gO3HQWl 7KahsKqfYo+i6Xz+zIuWJxkKCaSYzIyi6t7vtHc= X-Google-Smtp-Source: AGHT+IH0UI/i/9XYMzFp3baFwwmWbeX71vUQ6w/8hfP5fOgLI58PHq1cbU7n1MiYFhBfrmDi2adQ2w== X-Received: by 2002:a17:903:1c4:b0:1b5:522a:1578 with SMTP id e4-20020a17090301c400b001b5522a1578mr20049442plh.29.1692822243553; Wed, 23 Aug 2023 13:24:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 39/48] tcg/tcg-op: Document bswap16_i32() byte pattern Date: Wed, 23 Aug 2023 13:23:17 -0700 Message-Id: <20230823202326.1353645-40-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822396360100007 From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230823145542.79633-2-philmd@linaro.org> Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index b59a50a5a9..fc3a0ab7fc 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1035,6 +1035,14 @@ void tcg_gen_ext16u_i32(TCGv_i32 ret, TCGv_i32 arg) } } =20 +/* + * bswap16_i32: 16-bit byte swap on the low bits of a 32-bit value. + * + * Byte pattern: xxab -> yyba + * + * With TCG_BSWAP_IZ, x =3D=3D zero, else undefined. + * With TCG_BSWAP_OZ, y =3D=3D zero, with TCG_BSWAP_OS y =3D=3D sign, else= undefined. + */ void tcg_gen_bswap16_i32(TCGv_i32 ret, TCGv_i32 arg, int flags) { /* Only one extension flag may be present. */ @@ -1046,22 +1054,25 @@ void tcg_gen_bswap16_i32(TCGv_i32 ret, TCGv_i32 arg= , int flags) TCGv_i32 t0 =3D tcg_temp_ebb_new_i32(); TCGv_i32 t1 =3D tcg_temp_ebb_new_i32(); =20 - tcg_gen_shri_i32(t0, arg, 8); + /* arg =3D ..ab (IZ) xxab (!IZ= ) */ + tcg_gen_shri_i32(t0, arg, 8); /* t0 =3D ...a (IZ) .xxa (!IZ= ) */ if (!(flags & TCG_BSWAP_IZ)) { - tcg_gen_ext8u_i32(t0, t0); + tcg_gen_ext8u_i32(t0, t0); /* t0 =3D ...a */ } =20 if (flags & TCG_BSWAP_OS) { - tcg_gen_shli_i32(t1, arg, 24); - tcg_gen_sari_i32(t1, t1, 16); + tcg_gen_shli_i32(t1, arg, 24); /* t1 =3D b... */ + tcg_gen_sari_i32(t1, t1, 16); /* t1 =3D ssb. */ } else if (flags & TCG_BSWAP_OZ) { - tcg_gen_ext8u_i32(t1, arg); - tcg_gen_shli_i32(t1, t1, 8); + tcg_gen_ext8u_i32(t1, arg); /* t1 =3D ...b */ + tcg_gen_shli_i32(t1, t1, 8); /* t1 =3D ..b. */ } else { - tcg_gen_shli_i32(t1, arg, 8); + tcg_gen_shli_i32(t1, arg, 8); /* t1 =3D xab. */ } =20 - tcg_gen_or_i32(ret, t0, t1); + tcg_gen_or_i32(ret, t0, t1); /* ret =3D ..ba (OZ) */ + /* =3D ssba (OS) */ + /* =3D xaba (no flag) */ tcg_temp_free_i32(t0); tcg_temp_free_i32(t1); } --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822470; cv=none; d=zohomail.com; s=zohoarc; b=jwOndzBqxGHWRGIbBVohRcn+Ny6WdHBc2ZP/biebqRWIStnW7+oa2T22Z9MCVH93+DqmwLHCtDRlUxPTUSpdtr5Czuttx36sGDTC02Lh++mdEmyxQj4t9RmUQUQYt6gV9XipCPDVK8escmiyXQuZ0eixzb6dvVBAxeYalTZv+SY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822470; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GM9qcgiCUzexTHGWX5t+ahLOGZIdFkTo6Y1+THQiB14=; b=bciqvK3kXQWOxavAIbOrSa9A1POfSSPeDO2C9JQXWyePI13tX6KHRfRuuW7RVuwxZm+vh0Gy8hI1RgIJ/1sA6fjWgsAqb6mp1I4cjsNu9EqtS+IBqOK5VTu80vobd8QFBwqaTrsCfE6a00Q2srlHHLQ9QtsxvFzXuo7FF2seH5Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822470984582.7418909796506; Wed, 23 Aug 2023 13:27:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuRc-0005KL-J0; Wed, 23 Aug 2023 16:27:12 -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 1qYuRY-00055e-8v for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:08 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuRW-0006CR-G0 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:07 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-68a1af910e0so3238923b3a.2 for ; Wed, 23 Aug 2023 13:27:06 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:72f0:1ea7:85d2:141e]) by smtp.gmail.com with ESMTPSA id j25-20020aa783d9000000b006873aa079aasm10117871pfn.171.2023.08.23.13.27.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:27:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822425; x=1693427225; 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=GM9qcgiCUzexTHGWX5t+ahLOGZIdFkTo6Y1+THQiB14=; b=fhjxzxnWlPTHUNn54KpsaVCc/2JvLM79nZ8K6ZpVMzklcPrjcFx4/Oi16r8WIiLo9O wOyNOQWXTD3ajs9cNqrIvtxHfcXpK+DTOEL+FAU1HnbtLCXjfMxkOaXIX79AzCQtgIS5 pPA8tvUFxbWQbMBOeyFvijE2FyfnSbVDS1pzqvZjgVNxXVfkwD2CsrwQD4vmBJdscaIY qaZyHhgpymOsvcHipqawipP4EI6wb4jUlcf23SiNT2u1tazKJzd9pqmkqCsB6QbuGxnv yThp99c6RbCWKDojhZtP0cSKb/I5xT2Y9J6sP+tBdeG7VllGB/yJUObJHJaeeSfFqbhM Hpgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822425; x=1693427225; 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=GM9qcgiCUzexTHGWX5t+ahLOGZIdFkTo6Y1+THQiB14=; b=g9MZ3RDxGv/YJApLn2jjOgBEhDR5L4k7jf7tqA4Qa3jyAPgT4Iq5Bn27J78B9jChvK gnmQhNs+cRLwWBEaXW1AU+QPSrqcZc04bBeZCJA3pDTHpP4pNpIhM9mKU6VoKBfB+2Xa VmfjafzJG9zwHKzBf6/a5LXSU7KMQ6fckanzsqf+LAmUZ4ECm80xUmv+oFuyZl5QRx1q tYbVIGHRmntKY7uoreaNLZCb7WiehWU2XSvKecFBOl+oAeKOqKSME+ynk2whdGdjLt3X snkO9wU2KtcuQThFbf/dlX4E9y+y6UBMLhytgI8mbEXH/1oa4zvolXMeoottWSU9rwgX OcOw== X-Gm-Message-State: AOJu0YyNvyNdWcaatu5OJ9KoENB6PWpCjAnxLzOFdgMKv4xAu/afa1nU Rxs2jTYO5zS5Fr2LQTtQ6l+VlwB5XhNwmf5Yk04= X-Google-Smtp-Source: AGHT+IGmLKRzhHwraLigkBLFUl83bo8ntjCFZGJiz3STL3i06sbvtpsMb/7cgwJFHzlzn5rB7P3+LQ== X-Received: by 2002:a05:6a00:896:b0:68a:582b:6b6d with SMTP id q22-20020a056a00089600b0068a582b6b6dmr9084609pfj.1.1692822424760; Wed, 23 Aug 2023 13:27:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 40/48] tcg/tcg-op: Document bswap16_i64() byte pattern Date: Wed, 23 Aug 2023 13:23:18 -0700 Message-Id: <20230823202326.1353645-41-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822471621100001 From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230823145542.79633-3-philmd@linaro.org> Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index fc3a0ab7fc..88c7c60ffe 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1767,6 +1767,14 @@ void tcg_gen_ext32u_i64(TCGv_i64 ret, TCGv_i64 arg) } } =20 +/* + * bswap16_i64: 16-bit byte swap on the low bits of a 64-bit value. + * + * Byte pattern: xxxxxxxxab -> yyyyyyyyba + * + * With TCG_BSWAP_IZ, x =3D=3D zero, else undefined. + * With TCG_BSWAP_OZ, y =3D=3D zero, with TCG_BSWAP_OS y =3D=3D sign, else= undefined. + */ void tcg_gen_bswap16_i64(TCGv_i64 ret, TCGv_i64 arg, int flags) { /* Only one extension flag may be present. */ @@ -1785,22 +1793,25 @@ void tcg_gen_bswap16_i64(TCGv_i64 ret, TCGv_i64 arg= , int flags) TCGv_i64 t0 =3D tcg_temp_ebb_new_i64(); TCGv_i64 t1 =3D tcg_temp_ebb_new_i64(); =20 - tcg_gen_shri_i64(t0, arg, 8); + /* arg =3D ......ab or xxxxxxa= b */ + tcg_gen_shri_i64(t0, arg, 8); /* t0 =3D .......a or .xxxxxx= a */ if (!(flags & TCG_BSWAP_IZ)) { - tcg_gen_ext8u_i64(t0, t0); + tcg_gen_ext8u_i64(t0, t0); /* t0 =3D .......a */ } =20 if (flags & TCG_BSWAP_OS) { - tcg_gen_shli_i64(t1, arg, 56); - tcg_gen_sari_i64(t1, t1, 48); + tcg_gen_shli_i64(t1, arg, 56); /* t1 =3D b....... */ + tcg_gen_sari_i64(t1, t1, 48); /* t1 =3D ssssssb. */ } else if (flags & TCG_BSWAP_OZ) { - tcg_gen_ext8u_i64(t1, arg); - tcg_gen_shli_i64(t1, t1, 8); + tcg_gen_ext8u_i64(t1, arg); /* t1 =3D .......b */ + tcg_gen_shli_i64(t1, t1, 8); /* t1 =3D ......b. */ } else { - tcg_gen_shli_i64(t1, arg, 8); + tcg_gen_shli_i64(t1, arg, 8); /* t1 =3D xxxxxab. */ } =20 - tcg_gen_or_i64(ret, t0, t1); + tcg_gen_or_i64(ret, t0, t1); /* ret =3D ......ba (OZ) */ + /* ssssssba (OS) */ + /* xxxxxaba (no flag) */ tcg_temp_free_i64(t0); tcg_temp_free_i64(t1); } --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822471; cv=none; d=zohomail.com; s=zohoarc; b=YE739QLpiHZIO1cQhaPnKjrGIEZviYWMGMxhdgn/cHVFb/toWKlEJ08+Kib4VRg7ncxm4625Bgch7BtTDvZb0F+bgbgH1JxUtbNNhw9SFjA5Vivdl3p7PSjdWHbjk0ovdGbtbBHof6rs9JTB//qMrb22Dzf2jvyKwWQsBJpDlqw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822471; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ahCrP7F2MvJ32qfYW6+qoIFl/wcJc9b7HEfMWV5oPEg=; b=Z5E/I1Ne2svpkLFrYEAmQ84giulzjXVDDrnjIcWGavimJ/UQ8zxOCJkfkR2sWcgAJc+15fsLW/0Oj7W3QWfSayezeR0CgdXWsc/bg4pd42SMTJT89fD18Z8rcEkm8ZYlOvABfiKXhYoFdmZM4MS8gUOGU7wg9tiqwctlCiQNPss= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822471757292.00152287411765; Wed, 23 Aug 2023 13:27:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuRc-0005Kd-Nw; Wed, 23 Aug 2023 16:27:12 -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 1qYuRY-000585-KC for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:08 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuRX-0006CV-1Y for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:08 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-68bec3a81c4so171784b3a.1 for ; Wed, 23 Aug 2023 13:27:06 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:72f0:1ea7:85d2:141e]) by smtp.gmail.com with ESMTPSA id j25-20020aa783d9000000b006873aa079aasm10117871pfn.171.2023.08.23.13.27.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822425; x=1693427225; 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=ahCrP7F2MvJ32qfYW6+qoIFl/wcJc9b7HEfMWV5oPEg=; b=qj5IpEH1pErP5EWF+BI1fooJDeVbxRhhGtQ3TwMe1w8tfYwSHZ46aTTA9JhmCZTQ5y XqVBtmeeJIbvy2TuUmsWSu9zsTUk9tNQf2fbbsFiVHNAx1uVwjqX/sPycmz9MKLBmkgN +NxLkKlt2hZi7gw/+gBhgyC4vSOSX7KK2xjsx0uJN5iuvQUIapIbbqfqQU8gUPv+AAiZ yxv1/o0QV4zWPF2bpdrN1xLe7VUS4a/eVl4mCDeCsXIuqalXdJZfK9FhpqSjhE431xsk I13S+HzllAgQI5RGyk+XoPb+8uMyUcb0arSg0T5SVmmz/QI8RK6KKju1L34HZshFeHLN F7AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822425; x=1693427225; 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=ahCrP7F2MvJ32qfYW6+qoIFl/wcJc9b7HEfMWV5oPEg=; b=M1W/8YfouO7k/R+hKNEiesx7/+G2qTz2A9taV+Mcr0aGr9sc37YJoisLKtrcvu8GZ+ OMgwSd5Ze86tlCAq5XTmhjPCXe9+Ib5/d7ZV/rxY5ppdecpOfMqx8ZsYLL5bR4Cm7PKH alEMTZVbhyJLgIwGBwGCzxuIJE4kAn5oGGTTEGqZL8UYegIMbcoBr/LVybvjFmPKYcTv W70l5RejKoDZzzF6PvUmR98kjFGWP33Rmq7tdazspXH0nxpGn1kY4NKSPwBAyp55BsSR QlLSOYrgL/ezw+Yss13tM47qaxPercqjbZosJ3s/Zji8Ry7MmfhHuMXTp1y7kngPBbsZ +6IA== X-Gm-Message-State: AOJu0YwzI3utzthr7zNspyhLqbJJM4XveVKcYNA5toj8kuxQon7Y6GhG Bqaa9AES9LjdaTzCZ/CO7tSTR/JHDwC7flKD9Qw= X-Google-Smtp-Source: AGHT+IHCgHmF8y2lUPlRAjg3xR7GF1nehGND7SkAvL80DhKTL14FbiTOCXmRPG3LBH0nZzbnQhnb3A== X-Received: by 2002:a05:6a00:17aa:b0:68b:a137:373d with SMTP id s42-20020a056a0017aa00b0068ba137373dmr7197957pfg.17.1692822425614; Wed, 23 Aug 2023 13:27:05 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 41/48] tcg/tcg-op: Document bswap32_i32() byte pattern Date: Wed, 23 Aug 2023 13:23:19 -0700 Message-Id: <20230823202326.1353645-42-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822472562100005 From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230823145542.79633-4-philmd@linaro.org> Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 88c7c60ffe..ed0ab218a1 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1078,6 +1078,11 @@ void tcg_gen_bswap16_i32(TCGv_i32 ret, TCGv_i32 arg,= int flags) } } =20 +/* + * bswap32_i32: 32-bit byte swap on a 32-bit value. + * + * Byte pattern: abcd -> dcba + */ void tcg_gen_bswap32_i32(TCGv_i32 ret, TCGv_i32 arg) { if (TCG_TARGET_HAS_bswap32_i32) { --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822506; cv=none; d=zohomail.com; s=zohoarc; b=CeoU5KOZcXkvxHk2OuplLcSqD12/QTZUrFHfXk+XdL7WbYyV7nHjhadeQ4DcMyZR3SVOTlNc/ewaoFv/DC5ubiPtfvXtTXWBS98xCdmPcuTJ8AEDXZHaM5eDW5/b3ZXDTyoY8PVvy2zPAIrI1rNDy/HbCAfmm1x5zE0OT3fKV5k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822506; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mSK1FwATZQ2r2xwm25ea0QEMJ0jlampktK+qTGiEiAc=; b=aYFtu/ldotMKRhwyGasneTkKnX0KDqfFpha3mwfbIMNjtfZ8qpMh04csOb8bimIoK2xnsDKLYgGviriy5oTM1cPBIf88NBZMZrvFHNutAaq2xj0gHRNGcMHqE95y/cwK63xTZUrJJxdgzHFVnPWr/AdgelOTsF9sNBkl2MDE6MA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822506517727.6056849890753; Wed, 23 Aug 2023 13:28:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuRe-0005UI-50; Wed, 23 Aug 2023 16:27: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 1qYuRZ-0005AO-PH for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:10 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuRY-0006Ch-1G for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:09 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-68becf931d0so188803b3a.3 for ; Wed, 23 Aug 2023 13:27:07 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:72f0:1ea7:85d2:141e]) by smtp.gmail.com with ESMTPSA id j25-20020aa783d9000000b006873aa079aasm10117871pfn.171.2023.08.23.13.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822426; x=1693427226; 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=mSK1FwATZQ2r2xwm25ea0QEMJ0jlampktK+qTGiEiAc=; b=eXbRWb0JNqbCvHsuyQy5sZUHiSnqmKdTq0OuFkEi8oaLXbcMK0BWKEqW/Q8ypk+IHM Umi/llkZiMdszFLNHRJbTWgmPX/dew9pCE5m4PWG+OnYQQN+NadNEBp3gOnAVb1pL0Bd qX1VfpfnWwgRbWhfqtn0PEVFe6ivJ18NSV5av4qRV+/1ZYCnQSGeKC+vGL6WVzQziBnK yS2RoqXILT35DUMVOf2RU5yGaIUf0yq2cWSLAwXRVmxdiTJVorJDULf6lhrihaTiQ4Yq rgTJdK5A86F7589V6ZEEY0p1ViEIoZ8umpMDrqpzJ0o+SaUY4QIFvaYQzNo0QU6tG1NO YD+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822426; x=1693427226; 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=mSK1FwATZQ2r2xwm25ea0QEMJ0jlampktK+qTGiEiAc=; b=YRZyrYULZzZqQh5z6w9I4SV7rifEiFj/8b1ArcZNmxAn4ywye0To9tQdgWKBYMgapO QMJE1cV/gqiFry7gNdjdlyc+cwjNefnmbHsqEKfKmSmMAS5ruFu/lTuW4Wi7YVvcsIZz AlbQ07m+328OcbOBGeFagvBoGq1IuEkcEZvkwkcW6ekcQmbDbruB+VdG0NEEle+HmuT3 /wL29/7c8VHBaCj5/MlusiQYXAi8t6d2kmDOtrwauQPXpDSGMqHoAs2USQwkaz1B1FlA 1jn/R8jXCFmrr5UDLuYyWjJAEFvxTfnZobgSBK72cwME55GY2ICl2x6pBOJIox9RZNbr Gt0w== X-Gm-Message-State: AOJu0Yz4tS1mViqY5sOlhpjjaol4sbDGNT0KztGSGeqeE1DjjFqyZnMi xvvOXGUZMApmeW21yhy5XSkzFC7Oq7CN+A9vRG4= X-Google-Smtp-Source: AGHT+IE/eldWKw++bRBguuq+KFYRZjlWYxfJTEyiIfGnfEnyg+UUjMB9YowE4SnM2AyO09C5dBYTPg== X-Received: by 2002:a05:6a20:12d1:b0:148:2f62:c47f with SMTP id v17-20020a056a2012d100b001482f62c47fmr13427996pzg.41.1692822426651; Wed, 23 Aug 2023 13:27:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 42/48] tcg/tcg-op: Document bswap32_i64() byte pattern Date: Wed, 23 Aug 2023 13:23:20 -0700 Message-Id: <20230823202326.1353645-43-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822507684100017 From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230823145542.79633-5-philmd@linaro.org> Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index ed0ab218a1..b56ae748b8 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1822,6 +1822,14 @@ void tcg_gen_bswap16_i64(TCGv_i64 ret, TCGv_i64 arg,= int flags) } } =20 +/* + * bswap32_i64: 32-bit byte swap on the low bits of a 64-bit value. + * + * Byte pattern: xxxxabcd -> yyyydcba + * + * With TCG_BSWAP_IZ, x =3D=3D zero, else undefined. + * With TCG_BSWAP_OZ, y =3D=3D zero, with TCG_BSWAP_OS y =3D=3D sign, else= undefined. + */ void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg, int flags) { /* Only one extension flag may be present. */ @@ -1855,7 +1863,8 @@ void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg, = int flags) } else { tcg_gen_shri_i64(t1, t1, 32); /* t1 =3D ....dc.. */ } - tcg_gen_or_i64(ret, t0, t1); /* ret =3D ssssdcba */ + tcg_gen_or_i64(ret, t0, t1); /* ret =3D ssssdcba (OS) */ + /* ....dcba (else) */ =20 tcg_temp_free_i64(t0); tcg_temp_free_i64(t1); --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822448; cv=none; d=zohomail.com; s=zohoarc; b=mcK/pVdP6TI9EVh0AdNad+CEQ4TqIpzybzH8OwfO0SRghiI85G636keOPMJY5SjN3CLtEI73N3SFyhyHa7Cff0oLeYPEILPYAK8Jpkq339Sk4MLo3fwPUhou6BE2LzI9KwOeecThxxAysJ4RJbpZ+fIdSPaSF33qgcyr0PwUXxI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822448; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gIrreZ5G8/kGRX0I9xt2390vEuxRjWw6n/lcuZL2BuM=; b=IHNtNpRPyJ4YJ2B23u+PwuPUaJV5Yb3VT03guVHamrzKwbLAwGAO0g/M75M39BNXV5oB/NmA/AOZw2ugN/FVCaFrelm6l6HfdDE7Aj3z/FiDSfZp2qmRcaMI7u1ndZW04GBMUHIj3MNDV2CR0whV+Ku+7lcdVd+JlqTWk1n7ui4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822448802654.7521598414348; Wed, 23 Aug 2023 13:27:28 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuRd-0005S3-Sh; Wed, 23 Aug 2023 16:27:13 -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 1qYuRa-0005Fb-Nf for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:10 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuRY-0006Cn-Uk for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:10 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-68a440a8a20so3312459b3a.3 for ; Wed, 23 Aug 2023 13:27:08 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:72f0:1ea7:85d2:141e]) by smtp.gmail.com with ESMTPSA id j25-20020aa783d9000000b006873aa079aasm10117871pfn.171.2023.08.23.13.27.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:27:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822427; x=1693427227; 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=gIrreZ5G8/kGRX0I9xt2390vEuxRjWw6n/lcuZL2BuM=; b=NFzvhsQ5NGLhyR4T/PoXauTno4VzvgKLRLgNQ6l355ZnCAXhJ4m1yA0KtQ+xx2AOb1 mTJlIyIxDtCAOlxIJ6n0f65SOZRSiO3TqLnieLfX1LQmKz3rdTKEIEr2BZtv09j9BAgG Rhb1pJLICioux2BpbDBVWHCA8GeUsqekRZsC1xVTgr+0Olzph9RToJ8AtH/2HieY+XQI rZ01bzYaW/t9iwQsYqaxLtrTP6RE84lFM7d/2V7IGBKN9+TuOblTtgH+vkjK/mk1wihF dfuMe4cEFKFyPdLjuVPQBZ4GHIwVJtmZ4mjRWVKAiFD85s2/PRkudWGoezXss7uT+CoQ gNaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822427; x=1693427227; 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=gIrreZ5G8/kGRX0I9xt2390vEuxRjWw6n/lcuZL2BuM=; b=iaE+tm+WhUksKz0uO1hq00fwtXwYaY+A+/ZOxRn1mD9Vsxs5WMd2hAfvKWTmpq/uhb 9q6IlpfTF1x3kBEnngAxtcck7qhRu/dwvSNlPtfw8nsJ/UEhPXl2TYiVIiAkka+4UjHC u2g6vIridHycfFBUNuaQQOLSyo1F3mzPUgXeLuX0zA7eyDxRZlu2moffyt21vXKuQ31H TMr1gh8tJ1whweou6qbDJ+FHAxTHxOw499SZLkFtaDCXR/wyx3N2bje3NHYEgpJZIpj4 2llhAGPT3tuwqLIlT34WzkYQiwj2y3kE9TUXDR0dT4Ur/XnnWEm5bKkIegdutncrx/HS OTjw== X-Gm-Message-State: AOJu0YwgDsR0bTHdT/SubT8Y+lgxZXgas7ZJEBfLXfXkEjlLNrbe781z UIg2Q1bgZVjoePQKVBZnP/BStcCddPxfOU7wUqc= X-Google-Smtp-Source: AGHT+IEHoxwMsFm31NAXFFg5HDOcmm/W9JiAeSkrcayJ7Y3oZn0hVz13gvbazTK5gUB79kPAmS0GbA== X-Received: by 2002:a05:6a00:24d2:b0:687:5c3f:d834 with SMTP id d18-20020a056a0024d200b006875c3fd834mr18022486pfv.11.1692822427666; Wed, 23 Aug 2023 13:27:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 43/48] tcg/tcg-op: Document bswap64_i64() byte pattern Date: Wed, 23 Aug 2023 13:23:21 -0700 Message-Id: <20230823202326.1353645-44-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822450744100011 From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20230823145542.79633-6-philmd@linaro.org> Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index b56ae748b8..22c682c28e 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1871,6 +1871,11 @@ void tcg_gen_bswap32_i64(TCGv_i64 ret, TCGv_i64 arg,= int flags) } } =20 +/* + * bswap64_i64: 64-bit byte swap on a 64-bit value. + * + * Byte pattern: abcdefgh -> hgfedcba + */ void tcg_gen_bswap64_i64(TCGv_i64 ret, TCGv_i64 arg) { if (TCG_TARGET_REG_BITS =3D=3D 32) { --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822504; cv=none; d=zohomail.com; s=zohoarc; b=ma5ZlnON6OZA/vp20qy8hmWWtk6yPtkwU6ys8oY4ZAmtxJClDo+HYUrVSo26rwV6k+0HAy+71jb+65bmOTPEZrCVHbFQ7WVcx3gi7cBSsnocWaVgORWWQ0iNioD1PPKFs0QcK91STXMx5GuWs2hUYSSlbzpwdH6BYnLB2TwpTro= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822504; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+HBG3IHysiQqVx1ZdBpPpSQGBsf741KNQQ+W/h6ROz4=; b=aO6CU9/86eCQFvAcIj44QHr8sTaZNt6i7o/suZrgnkLo/2+IG/HMfiIZI38ZSUESta30XyXAiItx1Ro+Ydc1VdutDR70k2yoeLY56GRiw7iNoWga/UDKuOZn45BkelqX7z/gELF+krrEv6E0WNUD9+qRa54xluoLWGcPBYUMLos= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822504648786.7119367367222; Wed, 23 Aug 2023 13:28:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuRf-0005d7-43; Wed, 23 Aug 2023 16:27:15 -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 1qYuRb-0005Iq-GS for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:11 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuRZ-0006D0-SA for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:11 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-68a41035828so2957687b3a.1 for ; Wed, 23 Aug 2023 13:27:09 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:72f0:1ea7:85d2:141e]) by smtp.gmail.com with ESMTPSA id j25-20020aa783d9000000b006873aa079aasm10117871pfn.171.2023.08.23.13.27.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822428; x=1693427228; 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=+HBG3IHysiQqVx1ZdBpPpSQGBsf741KNQQ+W/h6ROz4=; b=YMhCEAgWxT/JDtaZydB0+N6BMFszdh+cieQIY8rned3dSUrCquj/+G3aXdK0hGuvVj tHN58j7Oz7lJQdzbwAQwZvm3dAd8MLuRHdoHzJQKPJv7KF406JR3EHGleg9Iet4dpWX7 yiyODdj7AtSuGvTGiPwOwar6ANkzduEpg4flXb6eKDYHepYj8hb0kqUUR1Y50PKzH7ln sdrxG0G3Ax0v/x6ZmC9g+QNQHY2n5FyteQvQC1klt2BncEIlg3tG26B0XIlCUsbPX3dC HJ9+XLF5e5XI++NENlkaVrBmZRc//DLNiR9OYqqRUKOzW2KdXAo5bzUY4uHs+Y4WfaUm 10VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822428; x=1693427228; 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=+HBG3IHysiQqVx1ZdBpPpSQGBsf741KNQQ+W/h6ROz4=; b=cjHB1257V2PJfTqQ6wv4k8fUb+cJZ41uEMDS9lk2+IMKkIOkBwOVZ/7o3IISBpJTxe Q6x73VhhnXIywPePUqtCHx+uqMNILqf/rlNT53JNQ4slZ9AXrzYUBJMVaQVTpA4gSIEW mK+uge1Zpqx253Z9wcK888Ma8UstLnN4BK5fB7Wvnp60UrNnnPZV76LLGJ1grD6dIogc bc8IrcK611L/QaIOpg7DxwBfFogqR0yYEmSsooUkVm3Yls/gFIU9Tsjl2MwJut9DA7Es xVUkT98YUm4239hMFpZLdnTA00Vvdk4gmOeOINnI7IVfEEyjmufjwTZ/pNuJxq4hEm9s W0bA== X-Gm-Message-State: AOJu0YzR8PTVRytA9s/KRY2E+xCRE8HSZwJUjTwqRWg9T3ok7g9Euf+4 3fLWwYnTTqhUbWH2JbaK3JiQ5VrTNq5wikehWaU= X-Google-Smtp-Source: AGHT+IFb/9aEfwKXo03sCi8+X3ew/ZyrKBDf4Fr7Jj9WbxK+PeVi2EH9r+NPj1E1H5kPJJ0qPayTHA== X-Received: by 2002:a05:6a00:2303:b0:687:472f:5150 with SMTP id h3-20020a056a00230300b00687472f5150mr12409453pfh.8.1692822428408; Wed, 23 Aug 2023 13:27:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 44/48] tcg/tcg-op: Document hswap_i32/64() byte pattern Date: Wed, 23 Aug 2023 13:23:22 -0700 Message-Id: <20230823202326.1353645-45-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822505731100009 From: Philippe Mathieu-Daud=C3=A9 Document hswap_i32() and hswap_i64(), added in commit 46be8425ff ("tcg: Implement tcg_gen_{h,w}swap_{i32,i64}"). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230823145542.79633-7-philmd@linaro.org> Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 22c682c28e..58572526b7 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1108,6 +1108,11 @@ void tcg_gen_bswap32_i32(TCGv_i32 ret, TCGv_i32 arg) } } =20 +/* + * hswap_i32: Swap 16-bit halfwords within a 32-bit value. + * + * Byte pattern: abcd -> cdab + */ void tcg_gen_hswap_i32(TCGv_i32 ret, TCGv_i32 arg) { /* Swapping 2 16-bit elements is a rotate. */ @@ -1921,19 +1926,25 @@ void tcg_gen_bswap64_i64(TCGv_i64 ret, TCGv_i64 arg) } } =20 +/* + * hswap_i64: Swap 16-bit halfwords within a 64-bit value. + * See also include/qemu/bitops.h, hswap64. + * + * Byte pattern: abcdefgh -> ghefcdab + */ void tcg_gen_hswap_i64(TCGv_i64 ret, TCGv_i64 arg) { uint64_t m =3D 0x0000ffff0000ffffull; TCGv_i64 t0 =3D tcg_temp_ebb_new_i64(); TCGv_i64 t1 =3D tcg_temp_ebb_new_i64(); =20 - /* See include/qemu/bitops.h, hswap64. */ - tcg_gen_rotli_i64(t1, arg, 32); - tcg_gen_andi_i64(t0, t1, m); - tcg_gen_shli_i64(t0, t0, 16); - tcg_gen_shri_i64(t1, t1, 16); - tcg_gen_andi_i64(t1, t1, m); - tcg_gen_or_i64(ret, t0, t1); + /* arg =3D abcdefgh */ + tcg_gen_rotli_i64(t1, arg, 32); /* t1 =3D efghabcd */ + tcg_gen_andi_i64(t0, t1, m); /* t0 =3D ..gh..cd */ + tcg_gen_shli_i64(t0, t0, 16); /* t0 =3D gh..cd.. */ + tcg_gen_shri_i64(t1, t1, 16); /* t1 =3D ..efghab */ + tcg_gen_andi_i64(t1, t1, m); /* t1 =3D ..ef..ab */ + tcg_gen_or_i64(ret, t0, t1); /* ret =3D ghefcdab */ =20 tcg_temp_free_i64(t0); tcg_temp_free_i64(t1); --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822503; cv=none; d=zohomail.com; s=zohoarc; b=UUFaHze37ECdcK/Lk39leBSJUz8TtGCZr2xhlfTgal4kXDgYUGC14AblLlMg2rVDFt86cii8iNV3agml+983guXAiCvIqhmjuOQOgkPUz7J2IsKrFCSaSV19ae7OJa+WCJ9y4B2II1sHrDuu9y9gw04s7MqmKZTB6A+R8FlfaTg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822503; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7BLjPy391bKC/2XwowKZEESNB74b0AUWTN8kpr/E3og=; b=dbBjOO+w2i2obWrVEEi9jSO2b+ni3xUfof4LzM9iI9Ho/e7dvgNlIBp+1LuB+vcFoNl91g3qPeUhRiV37z2xtxuR/JHM+T9MDFPfFYto9SwV+EDyJBEK3a/Qg7u6qwg6F7CANg7/ZCnGMUvE6UDutduzJ38+56OIwAj/+2fCPes= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822503022729.328800165372; Wed, 23 Aug 2023 13:28:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuRe-0005bm-Pb; Wed, 23 Aug 2023 16:27: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 1qYuRc-0005KK-9h for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:12 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuRa-0006D8-MI for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:12 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-68a3b66f350so3715206b3a.3 for ; Wed, 23 Aug 2023 13:27:10 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:72f0:1ea7:85d2:141e]) by smtp.gmail.com with ESMTPSA id j25-20020aa783d9000000b006873aa079aasm10117871pfn.171.2023.08.23.13.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822429; x=1693427229; 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=7BLjPy391bKC/2XwowKZEESNB74b0AUWTN8kpr/E3og=; b=GEqNdYIPov4obhdtBjuj7TIHZ2xgnPU/PqDwh9o2qYgN31mVp2naC2hQH+LSIkxAOA FHxgrhd7t6CFBKd6NslSzC2K7m1LRJuEzkGyZo9xahnUyoTZ56cGKmj5ialJriSfosoI jkHGZ0kPQsN1f8i3MCDavPVTZp9XlPYaeTwxFhZb8Kq6xDQxUnfcO3t9I+YE1ffh0Xhp V+6YnQGO0U7gaYIu9mUx8kNql5E/ZbauOdjwY8BIeXW9Eaw71E8Toad6RYdlRfbV3pkH V4bco4TWgiaXEplZLYXua+1FyJwOWcgzUJ9+3V5bXWdefejDt6VBpzEea3/kCXTeoJ77 Dr1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822429; x=1693427229; 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=7BLjPy391bKC/2XwowKZEESNB74b0AUWTN8kpr/E3og=; b=X5xOhM0zVO8YZ9+DNSHIio76Sny4QH9P3eydsT7sazDOqsj4upG1ln7B297suKrAj2 JPirADhlAJvd2ewBBO6e7DJUfzigEUGc5BHJF/I7TyAhJp15nnHexOS/2WQjP8Gghc2X bTH+fOxDdDKG5O8iMfQ0EnqKt2XsKcRLpcxy+lB4OaiS03+M8uo4as5noVbuighnEtVm hIpQ8ulSlLP7o1TUMl/Tw/lWT1WW4wVf5OQFTypGYnrI7z9ULNlcRa7wy5pXGtVtd+/4 TEIYMj1uilriHGmHFu0rJTGA2QJFgDHUZ8SxfAmlsfwQZt9gBvhfddLCHw7z44BRp2+Z bnbQ== X-Gm-Message-State: AOJu0Yy1WlJ3XEDQ4b82iJBIcToA0HQBUutXVnBiPI8IGK6TzRRgdrAY JSnHDBMaYdAJb6ld5iv4Og+gyY1jufoSt/+U3eE= X-Google-Smtp-Source: AGHT+IHFY+1CdFj94Nxxky9o3l5NpLZzZKxTp6RJuDcSWpJ03Bi0upDXxfM3Mrksc2pecvZn6dUTvg== X-Received: by 2002:a05:6a00:124f:b0:68b:e3fc:b833 with SMTP id u15-20020a056a00124f00b0068be3fcb833mr2304674pfi.5.1692822429223; Wed, 23 Aug 2023 13:27:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 45/48] tcg/tcg-op: Document wswap_i64() byte pattern Date: Wed, 23 Aug 2023 13:23:23 -0700 Message-Id: <20230823202326.1353645-46-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822505108100005 From: Philippe Mathieu-Daud=C3=A9 Document wswap_i64(), added in commit 46be8425ff ("tcg: Implement tcg_gen_{h,w}swap_{i32,i64}"). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230823145542.79633-8-philmd@linaro.org> Signed-off-by: Richard Henderson --- tcg/tcg-op.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 58572526b7..02a8cadcc0 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -1950,6 +1950,11 @@ void tcg_gen_hswap_i64(TCGv_i64 ret, TCGv_i64 arg) tcg_temp_free_i64(t1); } =20 +/* + * wswap_i64: Swap 32-bit words within a 64-bit value. + * + * Byte pattern: abcdefgh -> efghabcd + */ void tcg_gen_wswap_i64(TCGv_i64 ret, TCGv_i64 arg) { /* Swapping 2 32-bit elements is a rotate. */ --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822528; cv=none; d=zohomail.com; s=zohoarc; b=J9NEEN+NwbFGPkRdHaaVR2jQfOEAu4fmUaLRH/jUVi7BPxcW+oRL//83kxRLMeAExzawKoZ1hpiZdAnkH94WfVPXzSIGd678ZP2jNQymxD5zz+3w7Vxzu08JiDPfzWnjn8gFQ0AqcFxpvWB9XFj1heP7xTo/nUExgAuMxIf+AoM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822528; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=j8qLblRcFRCdHPr4hVq4biqvsFQ7fEHYa5+9HoyfNXw=; b=d8fIbPzPIMSRK086Qs7u75OMxyGYBK8+SQU0pc96B42cF2XGe1bBFkWs/vmdjhRC2MMSzEVvGqzQ5y5Ptn4GooWa+wqJR143Q1fP9P6kaaAuqoDH5573Aa/9tCQmvXJO28WMuymiOL/CSdQQp4YH27P8q53zclW0UF94rPNQWlc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822528155495.55197074403577; Wed, 23 Aug 2023 13:28:48 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuRj-0006Pg-Cz; Wed, 23 Aug 2023 16:27:19 -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 1qYuRd-0005Og-8x for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:13 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuRb-0006DI-J7 for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:12 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-68a529e1974so2769469b3a.3 for ; Wed, 23 Aug 2023 13:27:11 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:72f0:1ea7:85d2:141e]) by smtp.gmail.com with ESMTPSA id j25-20020aa783d9000000b006873aa079aasm10117871pfn.171.2023.08.23.13.27.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:27:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822430; x=1693427230; 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=j8qLblRcFRCdHPr4hVq4biqvsFQ7fEHYa5+9HoyfNXw=; b=zdolvyQ4niPv/WR0CODfQgBCMu1Ps0PykOOyqAgz5tEtfRHZLQh9pM2MyQTtIveYUB MLMjuoOIbqSWe2KCEdnV3gZgMnK8R2UVDH673f0VxsGOZGI7pUt1QCyk4lN9dqtYA3Pq qhzDQ7wxUcJVleR/I4CyujEbteFnOP5/1mZHws0hpwAaghbZfZ4y1EeZF4z8cQVCbE9b mfD6pZuFrZzvVPrcb5ad3oI7nshpJ/Vvj0M9JH1thLpkXYTPRNw9yUH1afZnRh+qoezv g3/uqvaEwTPcEs4aOqHM7c4s62iK/K60M8dT6D8Uu4PyMnhF8Te9NzKZHeIkS/gGOCzH Wy4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822430; x=1693427230; 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=j8qLblRcFRCdHPr4hVq4biqvsFQ7fEHYa5+9HoyfNXw=; b=ez1CLfy8zQo5xbk5IEms8p8eeQ8Vddxv5y6UrRb4HRFJST0Em0s/SuLvL4kOlYmvTw Q0LwsWmwQpFBZo749BXTShMVfUO7BvG6TqzvO2/3omw8nAdgSPO56djfr7+02v/0nqpp MiO3d+5J8YcT5UO6Zq2r7xJrwrxIV1TsGUlijClEKaV3PGH0GaOKWPqbIXIlX0LcP6gI /Gc5b8KFChoEn1FPUaZY1/Tt+C0lpAGpo/cYvd2vA+v+vIZNftkjWviKKfrTCrJM4Lps 2jS53cWVK5sPfvpR/vOovX/3UhN6o6F/kWII4Q/BEmehWOXwHo+xlkD32HzqRH0nFBT7 CYCA== X-Gm-Message-State: AOJu0YxcLpuzVqto690oWJi81fl11RpoNS+uJUtQ/YJeLCU1vwhW03Nz HIcQutIREY6xA7ABsA5xaTGv4+dbMSIp3c7hJWs= X-Google-Smtp-Source: AGHT+IFQXidTj/9noRDOhDxrGT4Pzo9ThuiKIn2rlK30+ez+8OLf9R/HLv4LDufTk94u1mQF/e58gw== X-Received: by 2002:a05:6a21:3291:b0:140:56b6:4137 with SMTP id yt17-20020a056a21329100b0014056b64137mr14440042pzb.52.1692822430154; Wed, 23 Aug 2023 13:27:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 46/48] target/cris: Fix a typo in gen_swapr() Date: Wed, 23 Aug 2023 13:23:24 -0700 Message-Id: <20230823202326.1353645-47-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822528824100005 From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230823145542.79633-9-philmd@linaro.org> Signed-off-by: Richard Henderson --- target/cris/translate.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index 0b3d724281..42103b5558 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -411,15 +411,17 @@ static inline void t_gen_swapw(TCGv d, TCGv s) tcg_gen_or_tl(d, d, t); } =20 -/* Reverse the within each byte. - T0 =3D (((T0 << 7) & 0x80808080) | - ((T0 << 5) & 0x40404040) | - ((T0 << 3) & 0x20202020) | - ((T0 << 1) & 0x10101010) | - ((T0 >> 1) & 0x08080808) | - ((T0 >> 3) & 0x04040404) | - ((T0 >> 5) & 0x02020202) | - ((T0 >> 7) & 0x01010101)); +/* + * Reverse the bits within each byte. + * + * T0 =3D ((T0 << 7) & 0x80808080) + * | ((T0 << 5) & 0x40404040) + * | ((T0 << 3) & 0x20202020) + * | ((T0 << 1) & 0x10101010) + * | ((T0 >> 1) & 0x08080808) + * | ((T0 >> 3) & 0x04040404) + * | ((T0 >> 5) & 0x02020202) + * | ((T0 >> 7) & 0x01010101); */ static void t_gen_swapr(TCGv d, TCGv s) { --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822516; cv=none; d=zohomail.com; s=zohoarc; b=mQecUeSsbl1ZrgHH5hHFuSLOBBYu+SIW9oOlKLxWQszTmb06375aSD4wb/h/+Esd02ffhKfac6WyjEzn6L5RRlSJv6JcH9yBpTZ3Xnd/jxHvKjmS8k60jsNVkjwLkRrqbhut9w9N4OF6159ZtzlCOZOgrbwTnLhK/AMuykO8jPE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822516; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WwQYaeS2yjo0iydPx+8m5saMzA4puxq3QLJOAgwD58U=; b=Btdg/zZfYKFvYoWmBhUdt4DxCBa+YfVpHC8JBGoPwhuY6EM7YZJX836UPJ+HnbLSzvvUx6YfSAn7puND6v7aRb/eykwNkma7eDp+vihWIYIeusK+Q1KHeqMEeao5A+AXL/KW+sjvndGynsRcFOWvISYt/NzaX0yeCMhh2DpAQaQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 169282251624448.663570663796804; Wed, 23 Aug 2023 13:28:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuRh-00068N-C2; Wed, 23 Aug 2023 16:27:17 -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 1qYuRe-0005XK-Dk for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:14 -0400 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuRc-0006DY-Mr for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:14 -0400 Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-53482b44007so3484120a12.2 for ; Wed, 23 Aug 2023 13:27:12 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:72f0:1ea7:85d2:141e]) by smtp.gmail.com with ESMTPSA id j25-20020aa783d9000000b006873aa079aasm10117871pfn.171.2023.08.23.13.27.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822431; x=1693427231; 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=WwQYaeS2yjo0iydPx+8m5saMzA4puxq3QLJOAgwD58U=; b=RqQvFVNNLJHsJ0Oodc17xEgfcO9fwaeYoQO3ND2oq9JsHO0LGGOthh400tofDo7bOZ UBMfBeigeUr4j6G5hy6BvPnvsai61qcrN2AaAMCFS39mE1QrK3XJb8MWUsQ4dSKvUrTO VJou+EgN0lfXeIDEK3zElGYJGz+e6sQtlqOyjALZtIoGF00muvY8hwv/lyOIFpfcPGez 4APhIM3QaWqp+8DIZUUbVO1q7OWbda045XNK3AVmCtY1LRIP08j6KFVlW87CDP0cnJja JGcEqpAGqVwK1mGPKwB7QCczI20ewIt1lwJq1v0jJbeUfSFy6vWQXRVn+BjoUtSn2nJi miaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822431; x=1693427231; 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=WwQYaeS2yjo0iydPx+8m5saMzA4puxq3QLJOAgwD58U=; b=bW/DGjfJZT4pTx/8uuUql420mn6OxszUbfPbKSiB9g7BFA3xiB8Hm9n4GmTB7RFebF 9Vyoqw7QTYyivD0rHW4CiVHN/+tt5XMPZtQDMGq7/YUEE100qFWD2pX1vhpjqDgntSIH sGuQ2tpzn5t4vcd/L5ZZXnYUn8+OnJ7TGLNfqB1sYEB0uxzl1lLr6PP9cTKXj/9Ic4rP 08y3O/Xq7mJFWqQ9TtJGBAXbVO224a93nAhV9Xyz1ahhVVYytuDmytOG3xRBK/vRIGTL waW+fmLJWXfNZSrI/lX1wZfgpanzYYpoGTEbfDQb75DTNzMlcRF4LysP7VNNq0mHxQ3d ScCg== X-Gm-Message-State: AOJu0YxnUvGmX4aMwvn8x5fafqRAwDOZ04UUyhYBQUFj8LlJqEH02CBy KToFnK2i7DpyxQLa7EUrrciXWmUQjo1Hu5MhIDI= X-Google-Smtp-Source: AGHT+IG81nzfv3p17+MTs+50oV6JKZvq55torcVYJ+L1K5LEFOzjcYCDPIrATiPnyHwuMPlCulfjZw== X-Received: by 2002:a05:6a21:3d94:b0:13c:8e50:34b8 with SMTP id bj20-20020a056a213d9400b0013c8e5034b8mr11304616pzc.35.1692822431138; Wed, 23 Aug 2023 13:27:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 47/48] docs/devel/tcg-ops: fix missing newlines in "Host vector operations" Date: Wed, 23 Aug 2023 13:23:25 -0700 Message-Id: <20230823202326.1353645-48-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822517866100009 From: Mark Cave-Ayland This unintentionally causes the mov_vec, ld_vec and st_vec operations to appear on the same line. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20230823141740.35974-1-mark.cave-ayland@ilande.co.uk> Signed-off-by: Richard Henderson --- docs/devel/tcg-ops.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/devel/tcg-ops.rst b/docs/devel/tcg-ops.rst index 9e2a931d85..8ae59ea02b 100644 --- a/docs/devel/tcg-ops.rst +++ b/docs/devel/tcg-ops.rst @@ -718,7 +718,9 @@ E.g. VECL =3D 1 -> 64 << 1 -> v128, and VECE =3D 2 -> 1= << 2 -> i32. .. list-table:: =20 * - mov_vec *v0*, *v1* + ld_vec *v0*, *t1* + st_vec *v0*, *t1* =20 - | Move, load and store. --=20 2.34.1 From nobody Thu Nov 28 08:39:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1692822531; cv=none; d=zohomail.com; s=zohoarc; b=JDdi1Lggzd5zfn1JnCAlGtqdp/nju1crS/QhNuQNCzrto5UE50Z/BHRoOjh4kFS8gaMQy2frY15KYr0aUyXASdHP2HwQGX8Mg5QHlNSfTJMfHSIjLOITcHyvc4n+fDA36gBFTLVPhC+A8FtMkC8bSYg+qqUKf4lnAljeS1MrPCQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692822531; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=W9KTg90/J+MXTBGCv63OArZAe3FJvWpOB1HMILYylco=; b=Isu7ijWKP8pO0jFWdRtA8xlJUXQc/90xyP2EdxYRzkAbOlALSTfiuo6670neSjHvjFLJKPCnxnFXEPI9tlMe/3phdqUQdpkB+IeUjE515YUlJp9D1M4YglAy1HUuigAMa7g9bBmKkBvPymYsbxurtwn+QZK4cdMqSbndfVJnw1M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692822531980149.325161500317; Wed, 23 Aug 2023 13:28:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYuRj-0006Nm-35; Wed, 23 Aug 2023 16:27:19 -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 1qYuRf-0005oU-Hd for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:15 -0400 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qYuRd-0006Dk-JS for qemu-devel@nongnu.org; Wed, 23 Aug 2023 16:27:15 -0400 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-565439b6b3fso3124825a12.2 for ; Wed, 23 Aug 2023 13:27:13 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:72f0:1ea7:85d2:141e]) by smtp.gmail.com with ESMTPSA id j25-20020aa783d9000000b006873aa079aasm10117871pfn.171.2023.08.23.13.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 13:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692822432; x=1693427232; 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=W9KTg90/J+MXTBGCv63OArZAe3FJvWpOB1HMILYylco=; b=bXJUqUm84qRqSKwWhLkuuicfdPlvMU+T1hTFhN8GNJXQ8qHpHtTxUnuFMx3v+5Txei zq0OGBcMxv0Hw14aAev7uFJd6ZOsyVLPHbCdsf6q+oDCjBCZGKOhnEhjAZwv52F4Vmgt ung7yeKdFIe8j/s6gvypjUx0Bn1A6PjAxj5X8Op1Z82Az6nfzsDw4iV/yocaOSEgEsNp BeayPNRY7cLcTJYvf9ETz1CAcQ3Jm/Jq3wy8Xuds98NdenduxqnSkZ/zUUZtTX9+1MAi /ZBTkorek5dToAO5Mla9HC/z/U26J2dRUZ3ws76X0fF6anonxdKdPRMe2S2iLI05VZqB Gr2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692822432; x=1693427232; 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=W9KTg90/J+MXTBGCv63OArZAe3FJvWpOB1HMILYylco=; b=I8w9wfufOaULFqvYoMnLUk3qNxSifriWsmKumkUA4KwhiLm/eCvSyPOERPIfHl4lp5 +/FdU26ufut+YnZiQRWImbCFRhNSvfSPXRVVvyh1Rhb8qxSwFL0VSRmdBnV6NlubtrJG R02LnArNzKqHea+xaLtobweixtL5m/mNA9pXtssqEPY1ymz0kaPlb4WlUZczuGTEp56a 7Q3aK6GbyJ0g3W59ZqWXY8kQBinTa+tCTZKO3rptEiLgoWpkgvDK4hgBy9DDGcCbGTZF 747Bco1wXXSFut6xYTjXvZ0wtzgeXEwT+ls4VIX30DjI5XcFb7QhkF41wUpoFK2rVqOj rWtg== X-Gm-Message-State: AOJu0YxOit7lnJsJrOA8AwRjNrbtOwaAjR5Oizuso4QugXos9aLyRRsr 18y/hz4yMgKrXVOJ/U1qjprtIkGg2r+LJO10ubo= X-Google-Smtp-Source: AGHT+IHm6T+FhvO8BfTPMiD8USa3fakCvwfjVPUKs5++O9OnfEQWj1Zq2oV0c/JlyIoDg9Q+unaKDg== X-Received: by 2002:a05:6a21:3b4a:b0:12f:1f1f:b506 with SMTP id zy10-20020a056a213b4a00b0012f1f1fb506mr1494192pzb.21.1692822432088; Wed, 23 Aug 2023 13:27:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Michael Tokarev , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL 48/48] tcg: spelling fixes Date: Wed, 23 Aug 2023 13:23:26 -0700 Message-Id: <20230823202326.1353645-49-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1692822533329100013 From: Michael Tokarev Acked-by: Alex Benn=C3=A9e Signed-off-by: Michael Tokarev Message-Id: <20230823065335.1919380-4-mjt@tls.msk.ru> Signed-off-by: Richard Henderson --- tcg/aarch64/tcg-target.c.inc | 2 +- tcg/arm/tcg-target.c.inc | 10 ++++++---- tcg/riscv/tcg-target.c.inc | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 7d8d114c9e..0931a69448 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -3098,7 +3098,7 @@ static void tcg_target_qemu_prologue(TCGContext *s) #if !defined(CONFIG_SOFTMMU) /* * Note that XZR cannot be encoded in the address base register slot, - * as that actaully encodes SP. Depending on the guest, we may need + * as that actually encodes SP. Depending on the guest, we may need * to zero-extend the guest address via the address index register slo= t, * therefore we need to load even a zero guest base into a register. */ diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc index 162df38c73..acb5f23b54 100644 --- a/tcg/arm/tcg-target.c.inc +++ b/tcg/arm/tcg-target.c.inc @@ -1216,9 +1216,11 @@ static TCGCond tcg_out_cmp2(TCGContext *s, const TCG= Arg *args, case TCG_COND_LEU: case TCG_COND_GTU: case TCG_COND_GEU: - /* We perform a conditional comparision. If the high half is - equal, then overwrite the flags with the comparison of the - low half. The resulting flags cover the whole. */ + /* + * We perform a conditional comparison. If the high half is + * equal, then overwrite the flags with the comparison of the + * low half. The resulting flags cover the whole. + */ tcg_out_dat_rI(s, COND_AL, ARITH_CMP, 0, ah, bh, const_bh); tcg_out_dat_rI(s, COND_EQ, ARITH_CMP, 0, al, bl, const_bl); return cond; @@ -1250,7 +1252,7 @@ static TCGCond tcg_out_cmp2(TCGContext *s, const TCGA= rg *args, =20 /* * Note that TCGReg references Q-registers. - * Q-regno =3D 2 * D-regno, so shift left by 1 whlie inserting. + * Q-regno =3D 2 * D-regno, so shift left by 1 while inserting. */ static uint32_t encode_vd(TCGReg rd) { diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc index 232b616af3..9be81c1b7b 100644 --- a/tcg/riscv/tcg-target.c.inc +++ b/tcg/riscv/tcg-target.c.inc @@ -69,7 +69,7 @@ static const char * const tcg_target_reg_names[TCG_TARGET= _NB_REGS] =3D { =20 static const int tcg_target_reg_alloc_order[] =3D { /* Call saved registers */ - /* TCG_REG_S0 reservered for TCG_AREG0 */ + /* TCG_REG_S0 reserved for TCG_AREG0 */ TCG_REG_S1, TCG_REG_S2, TCG_REG_S3, @@ -260,7 +260,7 @@ typedef enum { /* Zba: Bit manipulation extension, address generation */ OPC_ADD_UW =3D 0x0800003b, =20 - /* Zbb: Bit manipulation extension, basic bit manipulaton */ + /* Zbb: Bit manipulation extension, basic bit manipulation */ OPC_ANDN =3D 0x40007033, OPC_CLZ =3D 0x60001013, OPC_CLZW =3D 0x6000101b, --=20 2.34.1