From patchwork Thu Oct 31 17:51:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 839876 Delivered-To: patch@linaro.org Received: by 2002:adf:a38c:0:b0:37d:45d0:187 with SMTP id l12csp420538wrb; Thu, 31 Oct 2024 10:52:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWcZ2arfs+GeCQosI0igOjTUUq/2MlFKvgqA7G/++x8UuUyvkVp/RMTYAh1riyt4t1HprpS7Q==@linaro.org X-Google-Smtp-Source: AGHT+IHtUCWrY5IaATcTotM9HSW8XOkSFSvcvwwrrxdsTkaG0YEx1UKgWGSZ+mTrMQonO60T911a X-Received: by 2002:a05:6214:5b02:b0:6cb:5605:ffb2 with SMTP id 6a1803df08f44-6d35c14e001mr6441786d6.24.1730397164249; Thu, 31 Oct 2024 10:52:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1730397164; cv=none; d=google.com; s=arc-20240605; b=hxuk0N5c4J5rLGXUKkwohTMbFmBTxNBdlGc8ufr4CtjCyyPb71qX3w0h5v0XcNo3xt YRtj+9bGP2UKpXh6odrOrdICUYUc/VRfxuHU4lhckrEtfzD0hF1X5KMNCpz0kjzSl31Q npl+2LdM0UeHCC7T/ck3NaTIXiHzICalxddWztmMTt2vRt4VblZoQQLr2uAlK4I+9Ulh OWp7BrHmKq0oWOkiaVLb7dnVlvSf9Ish9nQoA8AYPQy79UhVM/hMIrv70JFA3+17FVnt qGYZ/MgIHP6jokY8IDAFOQXwXwEQvbCTbFdz4V8TUeu/BUqGF5iNMydtskFhZGJEnyXn Vypw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=j+Vr9TnjLU2a58qM6D2/5EPfpLYLf3sVQLHOXY3Mmj8=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=P/MtR7t3I1rd3pCkTgA+Fi2eDhNgZ+DW9ST2XIWgm047RbrCkRahrP48TAwVhJrGhP ALc19TxDoHtlgTiOhTYkzHAcOnREc6bqzPmCiL9s0dJ+bayfNC/jfiqshTCYMZ3oa4hx NoXfo+pYjYClus8SxGlgeBwdqaewvqQwyucH+P8LoTr/XWpN4vIQ6x/EY4bwAv3PHkzK 1TV6JiBi2T0pse4RhJ2HfVu9KvcdYj5UaFkyhmOXea5fBBi8qBpY6aqwhKXWlkhMmRTG lw7eFC5v2l0ZeSqdWEDMdRf7LUN2ws8NjHh1wqEuIwTsOpEZzxTwbZP4pzF3kTOc7rVE WtpA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QELfDi14; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6d354192b15si24053636d6.424.2024.10.31.10.52.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Oct 2024 10:52:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QELfDi14; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6ZLW-0007Aj-9o; Thu, 31 Oct 2024 13:52:34 -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 1t6ZLS-00074o-N7 for qemu-devel@nongnu.org; Thu, 31 Oct 2024 13:52:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6ZLR-0007CE-7P for qemu-devel@nongnu.org; Thu, 31 Oct 2024 13:52:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730397148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j+Vr9TnjLU2a58qM6D2/5EPfpLYLf3sVQLHOXY3Mmj8=; b=QELfDi14BiZMPCGQRjTISjhLCsYgxf1XhZ99FcLrbcAz1Bs0JLX/smGEe5OsmRZTCF74Hs FfBgEWqtGg091b0dnG4vDEa1UJVMgomX+XD0aevgZn2JQsHGTM6ZUzh/z3up9+vShGOLgC Vfe+J2TfbK6xd83h6hC5fisr3EITpBc= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-417-YBiiid1IOjixn7on15Uvzg-1; Thu, 31 Oct 2024 13:52:27 -0400 X-MC-Unique: YBiiid1IOjixn7on15Uvzg-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-37d5ca5bfc8so583224f8f.0 for ; Thu, 31 Oct 2024 10:52:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730397145; x=1731001945; 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=j+Vr9TnjLU2a58qM6D2/5EPfpLYLf3sVQLHOXY3Mmj8=; b=LWnGxZmhaEmOZIiwqm5SpjfyvSeFmeTwYSQHkj5a5G8yrY9QrNg+gMIQrx+QAvZpq8 lVJcqvwrhS9/rq4rrbkLHGXASBBbfDrc0jhdMTm6WyyNcZNMM1h1WJ4nNtSWwNXeZ+Sf fs3gn+NwqDHt4rOVKrDjFxpYb0AIJwkg2CWm+h9KaoNbZ6gAbQnpC7q9hxigTe6eQ2QM FZX7TB+EnbLd9T3KdMT3VqaHlLMi53zAojN0XRxDfFBj5lbDBENeeUjald2kX8z17BYg XnOPvdG4D6jTHEZukeBxP71g08KpBuK80vo6Z8rSsLBvIKYDkv7lRCBgC/kpC2tPUdZW Rxeg== X-Gm-Message-State: AOJu0YwNagA5Cciw8o4p8nP5Ank2hQ6xEafQT19+dWu9Jmk1fOhzMh0U jVvNHj1pOeEAL6FUZuyYdJCJ+4pTd2D7vyHJGRSbc+ARJnXuxMRrx/sNYaYzH6FMQ75k8UsuN2D auwg8YO+LgugdcrnTNZQkmklIAnX5yN9wC859sXR6P3CG1tFX/yD3yCIKC048M1DNrNIoWkqhZo shJrTVyd10O4bZEBh168+Jk9CMWY9/43d3A8/pswA= X-Received: by 2002:a05:6000:4618:b0:37d:4706:f728 with SMTP id ffacd0b85a97d-381bea1012emr3526467f8f.50.1730397145007; Thu, 31 Oct 2024 10:52:25 -0700 (PDT) X-Received: by 2002:a05:6000:4618:b0:37d:4706:f728 with SMTP id ffacd0b85a97d-381bea1012emr3526446f8f.50.1730397144576; Thu, 31 Oct 2024 10:52:24 -0700 (PDT) Received: from [192.168.10.3] ([151.49.226.83]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c10b7f80sm2839249f8f.20.2024.10.31.10.52.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 10:52:24 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 05/49] scripts: remove erroneous file that breaks git clone on Windows Date: Thu, 31 Oct 2024 18:51:29 +0100 Message-ID: <20241031175214.214455-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241031175214.214455-1-pbonzini@redhat.com> References: <20241031175214.214455-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.366, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Pierrick Bouvier This file was created by mistake in recent ed7667188 (9p: remove 'proxy' filesystem backend driver). When cloning the repository using native git for windows, we see this: Error: error: invalid path 'scripts/meson-buildoptions.' Error: The process 'C:\Program Files\Git\bin\git.exe' failed with exit code 128 Link: https://lore.kernel.org/r/20241023073914.895438-1-pierrick.bouvier@linaro.org Signed-off-by: Paolo Bonzini --- scripts/meson-buildoptions. | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 scripts/meson-buildoptions. diff --git a/scripts/meson-buildoptions. b/scripts/meson-buildoptions. deleted file mode 100644 index e69de29bb2d..00000000000 From patchwork Thu Oct 31 17:51:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 839879 Delivered-To: patch@linaro.org Received: by 2002:adf:a38c:0:b0:37d:45d0:187 with SMTP id l12csp423624wrb; Thu, 31 Oct 2024 10:59:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVLmblBmZYH/fi+cEuPGXcCGQai8BMl6u2xOr1GaucIYnumELi4v0kVjqh/Kvq9O14siVI91g==@linaro.org X-Google-Smtp-Source: AGHT+IHn9/9Isz70BAxhAu+HRvk4VW02fi381S/d4vARCX8VTkaXL92NLfPJBa2/SAIrSJm0pPhn X-Received: by 2002:a05:622a:198c:b0:461:5c52:6ecb with SMTP id d75a77b69052e-462b86a5e06mr5667141cf.34.1730397594765; Thu, 31 Oct 2024 10:59:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1730397594; cv=none; d=google.com; s=arc-20240605; b=FyVRw4eP6D0s0qYZMs38pEpx/2BkyiiDkIkSpPGqk652GwBft47eCfPJB1trEoEGR7 TdAzFJarAhpzh3bfIRXhHDplzM4Lirz+kGKZ/IrGMOCpnLJiPQnYryikVhzfpn237fpJ zo3Tqsa43eW0Xf7r2esw1+N86gaWkk6x2vi8oLHPwWX7CZTrXV4IeuyxDYHNO59HObhl IJAf7cCT7od9Egf5ar5OpybhJ+MrlSIp7Xqer7RT/39iEeQisUzMJCeLIy29EG+WzZOK 1O6NvVJ+VeXceOgyuALbKFH+9NJ7nHW6Z7Q/sL49VVpuZjb8pUh3olt3/j8ckYs1ODqi U8qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BWcfg2aupe5UaZvSXBPNOsSy5nqMqX/xbZPHsRPq/yw=; fh=mN+7zamMqtxpbv5qGNGIO/QHsXnjUAqHW/yN5gisKlY=; b=CO820VcWqWZB65HmXSsqB68WdZWLAe/bswub3owaZirbAEXzrlqHBtuzj9zv93tWC1 aOjScFEkfV02Fxp3uxeFDRQBn+Sylduh12bcLrDvFIeS3wZ37G6LfI+3D/923zT9zQNr zmRhK4sfSC+TgpCutZ6zL2C0tcJpSfqCEcKRcKMBM+FqWCB+iYjLV8YVYUYJEW5uRPWy kePnOISBxVN0Ql4ImoK8O9xc5ZrGGVVKsr748yKGfWDzYRJYHiIYTm1OYH6QuZPkiKeJ z3tHHCJfvf8BMhy49iVBGajwbNdRj7b9sA8uCNy3DAw5diw48WlLBZakjBwBWQ7cO84b 8dkg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KiN9VwHL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-462ad1fdfc1si22328901cf.540.2024.10.31.10.59.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Oct 2024 10:59:54 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KiN9VwHL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6ZNz-00068B-IJ; Thu, 31 Oct 2024 13:55: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 1t6ZMQ-000242-B3 for qemu-devel@nongnu.org; Thu, 31 Oct 2024 13:53:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6ZMN-0007PP-UC for qemu-devel@nongnu.org; Thu, 31 Oct 2024 13:53:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730397207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BWcfg2aupe5UaZvSXBPNOsSy5nqMqX/xbZPHsRPq/yw=; b=KiN9VwHLThPRLjI7QPUSzE6Xc5R8MTPjJcVwsBifps9KMV8aXn9KpNzFKjVeN8rb4QNyAS 6ko/DR0GT30D2O00P1HbumkDBsOicw4U9bjAuk2+9ZfmFHr3zC6kMa0ykJwzCZ7NZJpAVt uw+sCsTYeGo2047a5wdcPd/rh6Q2EI8= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-612-NyoYN4LYNRizImM_yWz3Gg-1; Thu, 31 Oct 2024 13:53:24 -0400 X-MC-Unique: NyoYN4LYNRizImM_yWz3Gg-1 Received: by mail-lf1-f70.google.com with SMTP id 2adb3069b0e04-539ebb67c28so866900e87.3 for ; Thu, 31 Oct 2024 10:53:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730397202; x=1731002002; 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=BWcfg2aupe5UaZvSXBPNOsSy5nqMqX/xbZPHsRPq/yw=; b=DDfsE4FzB7k9HJDOo6PiJz2grYIJcpaPdtuRevzWDgdmtUaEwF0ut4akuuh2e+Rpt4 X+ilJRz9ekMVL9k1ww+S6dCsAbLRaob+xPJGF+tYK5syB5XgyrchTdLLTc9ZLbRUk97m bfYik62g4AI/Il6uZU+OgQTB1HICk8ZosLm48EcYBmyJVPPaFBLW7s85hDLn1vfhkTHN cL9SsfzDrTldAAWm4mOH9KucuxLWsrHEz1cIPyPjcTnxjlzJUrmBrSccH69eE9UoqOg5 cOcVoOuRgGgiWI/cifTBs1gtrBB030bDsOzL9VZS1PXBEZP7rJQx2g5O1lvwcrBVDU3Q gnXw== X-Gm-Message-State: AOJu0YxPhomCVEwdXpPVt/2co50xb59sS2FtZTLF5sWDyh+Vdl9odwX3 VvSaK7/mJk54PNdqM24wRTP8ClTLOa2bZi4+nD3fiJXjlkGT8h5swmF7T4EN9djhK2uK7fstM2I ds8kbosFsdhabGsMmuCKWub5y5JPutAE6J9rE5nddN2gfVSJ1taY0hZrUsG7y/cWch8YaiWj6lC 1OxX7Tnevz6iP3+MIh9c1PdemJixDnrBLZmGNq/ko= X-Received: by 2002:a05:6512:32c8:b0:535:82eb:21d1 with SMTP id 2adb3069b0e04-53d65e1781fmr587613e87.57.1730397201476; Thu, 31 Oct 2024 10:53:21 -0700 (PDT) X-Received: by 2002:a05:6512:32c8:b0:535:82eb:21d1 with SMTP id 2adb3069b0e04-53d65e1781fmr587591e87.57.1730397200955; Thu, 31 Oct 2024 10:53:20 -0700 (PDT) Received: from [192.168.10.3] ([151.49.226.83]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4327d698144sm35957565e9.39.2024.10.31.10.53.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 10:53:18 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 29/49] target/i386: Tidy cc_op_str usage Date: Thu, 31 Oct 2024 18:51:53 +0100 Message-ID: <20241031175214.214455-30-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241031175214.214455-1-pbonzini@redhat.com> References: <20241031175214.214455-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.366, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Make const. Use the read-only strings directly; do not copy them into an on-stack buffer with snprintf. Allow for holes in the cc_op_str array, now present with CC_OP_POPCNT. Fixes: 460231ad369 ("target/i386: give CC_OP_POPCNT low bits corresponding to MO_TL") Signed-off-by: Richard Henderson Link: https://lore.kernel.org/r/20240701025115.1265117-2-richard.henderson@linaro.org Signed-off-by: Paolo Bonzini --- target/i386/cpu-dump.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/target/i386/cpu-dump.c b/target/i386/cpu-dump.c index 3bb8e440916..dc6723aedee 100644 --- a/target/i386/cpu-dump.c +++ b/target/i386/cpu-dump.c @@ -27,7 +27,7 @@ /***********************************************************/ /* x86 debug */ -static const char *cc_op_str[CC_OP_NB] = { +static const char * const cc_op_str[] = { [CC_OP_DYNAMIC] = "DYNAMIC", [CC_OP_EFLAGS] = "EFLAGS", @@ -347,7 +347,6 @@ void x86_cpu_dump_state(CPUState *cs, FILE *f, int flags) X86CPU *cpu = X86_CPU(cs); CPUX86State *env = &cpu->env; int eflags, i, nb; - char cc_op_name[32]; static const char *seg_name[6] = { "ES", "CS", "SS", "DS", "FS", "GS" }; eflags = cpu_compute_eflags(env); @@ -456,10 +455,16 @@ void x86_cpu_dump_state(CPUState *cs, FILE *f, int flags) env->dr[6], env->dr[7]); } if (flags & CPU_DUMP_CCOP) { - if ((unsigned)env->cc_op < CC_OP_NB) - snprintf(cc_op_name, sizeof(cc_op_name), "%s", cc_op_str[env->cc_op]); - else - snprintf(cc_op_name, sizeof(cc_op_name), "[%d]", env->cc_op); + const char *cc_op_name = NULL; + char cc_op_buf[32]; + + if ((unsigned)env->cc_op < ARRAY_SIZE(cc_op_str)) { + cc_op_name = cc_op_str[env->cc_op]; + } + if (cc_op_name == NULL) { + snprintf(cc_op_buf, sizeof(cc_op_buf), "[%d]", env->cc_op); + cc_op_name = cc_op_buf; + } #ifdef TARGET_X86_64 if (env->hflags & HF_CS64_MASK) { qemu_fprintf(f, "CCS=%016" PRIx64 " CCD=%016" PRIx64 " CCO=%s\n", From patchwork Thu Oct 31 17:51:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 839878 Delivered-To: patch@linaro.org Received: by 2002:adf:a38c:0:b0:37d:45d0:187 with SMTP id l12csp423042wrb; Thu, 31 Oct 2024 10:58:36 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWfkA3qIVtnf+9jp4WqGZrHjASMO4EZY7KAmKmyOD0+2yCxaSyIbN4f906HQRMUiPmdM/Rrnw==@linaro.org X-Google-Smtp-Source: AGHT+IGufFjhbbycn8OjYaieTdX+oYPTB5LJhJiUM8tZohwYO4kbE436ulGMAlBrMiQuXbbDSBrN X-Received: by 2002:a05:6214:5d05:b0:6cb:8364:b0d3 with SMTP id 6a1803df08f44-6d351a8f406mr54830666d6.1.1730397516431; Thu, 31 Oct 2024 10:58:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1730397516; cv=none; d=google.com; s=arc-20240605; b=RaOCBrd+hAH7vHMxpe3XkHIgvjBSiCTF7LdDd4c9ZssBKtoLZ+D+pkcMHzS7BMMU2u WzMXsO2rh2l15ysNu0wqX+8WIO74AitqiS+Bf8U2F5tLd1JXQRko1XVM82GEJwPqyaD2 osxXHuFTK23b2KVc1vfKyw3HuqJPc9aAEFZqULx69oB6PF3HDBNqljWbGxS7SYwu2vzx HXlImoAbD26usBowh1r6m4qfhqdgloQo8QnPL1z+oH+jFCjC3QCrXlOE8ulk2qQkwqUZ uHXakn5XAN/lNSTgZvBVFO/EDxjR7hZXRRA/o2uuq8MxZL2XIVDmNPcOmNYRw6hthE8q FPUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7ybL7+9wAgz/1BKinmhWAD7p+qC2nAGKD3FTOM60MIM=; fh=mN+7zamMqtxpbv5qGNGIO/QHsXnjUAqHW/yN5gisKlY=; b=RPe6mOMfao7lT+WV0HSTtCgtJOKmAk6jgvoPOFmFTpuuuhkOgm//icmIib0pRiELIg cMB4BZEMWro3/U0L7Vn1QADx4u1ZgVtyBDA0FdCZ90fDcBifoL75wLZmAdudrp20IyER u0G9nUwd/r63VfMTlpHZ/9vtFLNJGs2NRr3oEYZShvU0uyFg7+efaJ13sBW8SJGxBYuW b5IkkEW4G0xQp78dT4OPLDxmLZ6KiK9/jf8+pxIvCiLKI2gTWxpxuoq1k2gVRZD3I0LL +CP3ZNHRb+Qz4xg1p3ZAMrnzpUbPg9E57QqBUAru+ztj9otOYNbH309cUxis1Tx84/pp 3y/Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dKuIHWdq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6d35418368esi24525366d6.419.2024.10.31.10.58.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Oct 2024 10:58:36 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dKuIHWdq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6ZMw-0002gj-7h; Thu, 31 Oct 2024 13:54:03 -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 1t6ZMR-000276-IG for qemu-devel@nongnu.org; Thu, 31 Oct 2024 13:53:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6ZMQ-0007Pf-42 for qemu-devel@nongnu.org; Thu, 31 Oct 2024 13:53:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730397208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7ybL7+9wAgz/1BKinmhWAD7p+qC2nAGKD3FTOM60MIM=; b=dKuIHWdq9i7oPUNRalZtpFFGvaKDVilvi6+IhwZSRgf6XAoCQbQGiUwLrVCt7dk4KUZFIo Oh4wNCjsurXRCOchsGQZfjiNoxXrrvrJIECS8Clh/xJqh4yyNWhwr9RbS3r8k2rlaguQxn /w3/IqUkjIzZZqvDqXq5vVoGDXX5gec= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-214-VAvPovYeOkqTu7PGTQXpqw-1; Thu, 31 Oct 2024 13:53:27 -0400 X-MC-Unique: VAvPovYeOkqTu7PGTQXpqw-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-37d531a19a9so613765f8f.1 for ; Thu, 31 Oct 2024 10:53:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730397205; x=1731002005; 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=7ybL7+9wAgz/1BKinmhWAD7p+qC2nAGKD3FTOM60MIM=; b=HWE+Q1MqCtI8mlDCQ32VltAVEJc9tFYeh5M8zcvpjgMP4PQzQFo7USogw54+qmhahk xPPMpJ6OhznITBxLkNHE8XbhaOPd4QxkAFv3d19kRX3M+YG6cV+aKLoVzzkqedjOJl1T a0aKsxOrxmV/Ue1xRrLTyVUEgCDrIm2CbsSc5akm6S8t3UzLhf19KVCrX36I2s8ebaD3 Ph8/jZfy0R3EJp7vFoUSbpPscEb3LMt/5I17CSCLjM0D3xGCamqE/Cf+Znt98xfb6YOG RNK/FJgRJhz8wbZoMF4E+j9Tc6pfEUcvb8OSLDvtrg45/zDBwevuWfbkPtEbZnbQY10j NXyA== X-Gm-Message-State: AOJu0Ywn8SMp+hlkF6IONus48hlzHqYZAajqrJdaDjQ4madGhMrukFPK cwlrFtxNZT6ewojpFk5gZX8yWsY0+KRsNNYmGiOslMS+sC+/bGtf8Tiun1UCviNLSQs8D+nwcFu tIqLrzEbzhAAEWn6m7iIUCqobSO94cUxw7Fn2PhUiYNP+MNmjX4LdqMbv0lDj/Zyoh6MX81ousa 1aIDcgyiGeXv9hsmJil8bgzj6VgSun9o27SMbDUqU= X-Received: by 2002:a5d:59a2:0:b0:37d:5129:f454 with SMTP id ffacd0b85a97d-381be776c81mr3191064f8f.15.1730397205635; Thu, 31 Oct 2024 10:53:25 -0700 (PDT) X-Received: by 2002:a5d:59a2:0:b0:37d:5129:f454 with SMTP id ffacd0b85a97d-381be776c81mr3191047f8f.15.1730397205151; Thu, 31 Oct 2024 10:53:25 -0700 (PDT) Received: from [192.168.10.3] ([151.49.226.83]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c10ea7a1sm2761271f8f.62.2024.10.31.10.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 10:53:22 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 31/49] target/i386: Rearrange CCOp Date: Thu, 31 Oct 2024 18:51:55 +0100 Message-ID: <20241031175214.214455-32-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241031175214.214455-1-pbonzini@redhat.com> References: <20241031175214.214455-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.366, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Give the first few enumerators explicit integer constants, align the BWLQ enumerators. This will be used to simplify ((op - CC_OP_*B) & 3). Signed-off-by: Richard Henderson Link: https://lore.kernel.org/r/20240701025115.1265117-4-richard.henderson@linaro.org Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 50172d7a6f9..6ec63380473 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1299,11 +1299,10 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *cpu, FeatureWord w); * are only needed for conditional branches. */ typedef enum { - CC_OP_DYNAMIC, /* must use dynamic code to get cc_op */ - CC_OP_EFLAGS, /* all cc are explicitly computed, CC_SRC = flags */ - CC_OP_ADCX, /* CC_DST = C, CC_SRC = rest. */ - CC_OP_ADOX, /* CC_SRC2 = O, CC_SRC = rest. */ - CC_OP_ADCOX, /* CC_DST = C, CC_SRC2 = O, CC_SRC = rest. */ + CC_OP_EFLAGS = 0, /* all cc are explicitly computed, CC_SRC = flags */ + CC_OP_ADCX = 1, /* CC_DST = C, CC_SRC = rest. */ + CC_OP_ADOX = 2, /* CC_SRC2 = O, CC_SRC = rest. */ + CC_OP_ADCOX = 3, /* CC_DST = C, CC_SRC2 = O, CC_SRC = rest. */ CC_OP_MULB, /* modify all flags, C, O = (CC_SRC != 0) */ CC_OP_MULW, @@ -1376,9 +1375,12 @@ typedef enum { CC_OP_POPCNTQ__, CC_OP_POPCNT = sizeof(target_ulong) == 8 ? CC_OP_POPCNTQ__ : CC_OP_POPCNTL__, + CC_OP_DYNAMIC, /* must use dynamic code to get cc_op */ CC_OP_NB, } CCOp; -QEMU_BUILD_BUG_ON(CC_OP_NB >= 128); + +/* See X86DecodedInsn.cc_op, using int8_t. */ +QEMU_BUILD_BUG_ON(CC_OP_DYNAMIC > INT8_MAX); typedef struct SegmentCache { uint32_t selector; From patchwork Thu Oct 31 17:51:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 839877 Delivered-To: patch@linaro.org Received: by 2002:adf:a38c:0:b0:37d:45d0:187 with SMTP id l12csp422025wrb; Thu, 31 Oct 2024 10:56:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV9jMG8LEeZLO1CaFglLvRvQNDfZzkBegGlnLbrCPNuF5Icx5PpZsh2/2nQcwgF0tEZ+DxQRw==@linaro.org X-Google-Smtp-Source: AGHT+IEB5K+qkqs8j1oHais/A+0kgLFjL4ysdFE0+FeewbaOSdvoAJY/D9+91tPNTG/YgTNdxCdH X-Received: by 2002:a05:620a:4548:b0:7b1:51df:115a with SMTP id af79cd13be357-7b193f3df63mr2680471785a.49.1730397374399; Thu, 31 Oct 2024 10:56:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1730397374; cv=none; d=google.com; s=arc-20240605; b=fRKzTv+noJcuM2SMauVS6xXUxnh3D9h9xsfrlRUBKMAC0rYsq2teagh/NZvj584rd6 PS5zqwgt/O7PTlKrUraNuUsgJWynDu4X3ggpbPR0G21nF9EYD5g0u2JMUraukxE6cNK5 5mTYGgXZDuakWrqGQPPMbuhrLWL/226qagMCN+mbGoKtuXNCICZMks+l37VEIUR/7Fjw pfpdea/yy1PlNuOp78TuC5izCAhZBHrC2qbkoXMjVKgDcK2uJQ8Enj0hvWekw7jyFYBr 6qt+I8OU70T4qpInnW7C0M64M3eVYs3pq+4yBSHt+A51wrY8Wf0GojzHkl9r7hDpjXEC wdgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hXWKUxEScRO0x2Vpd3yUytpTHeCcdbqyX30ALU4opb4=; fh=mN+7zamMqtxpbv5qGNGIO/QHsXnjUAqHW/yN5gisKlY=; b=OUv/Pkeb2raPpS6N3OIc7OyXp/mHZD8218XOL4U5hJIqDp6DbZjnG5ryQUyyOLitX1 FOeBwuqW82fwvC7jMEoeRMPvAd/+HtztqA2SRlx8jOIU5V+QkzRT4FTctp/tfTVh1vxk +iIvhxPXt/PQpJmzMDZDRZjWqqxrC/5lOePrMWhnTt4j8im7HfuXOZV1LuxHAT29EWIm WYEQF5JB0NDX5qdV86IIXPtCl+4DA9Cdu6r+BBlaFDCFf78GKxwlHgUO9LKuwEufh1rM 3mDUJpULw5V838MOs5o2bvHubDrdgAvcHlomS0ebz722XUYz4iO7Wg7c76CA8NuN2mdP PgTg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dWIo2p4+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b2f3ab6f1fsi232519685a.608.2024.10.31.10.56.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Oct 2024 10:56:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dWIo2p4+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6ZNt-0005aV-Fz; Thu, 31 Oct 2024 13:55: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 1t6ZMW-00027q-Ti for qemu-devel@nongnu.org; Thu, 31 Oct 2024 13:53:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6ZMV-0007Q7-3V for qemu-devel@nongnu.org; Thu, 31 Oct 2024 13:53:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730397214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hXWKUxEScRO0x2Vpd3yUytpTHeCcdbqyX30ALU4opb4=; b=dWIo2p4+1aX2eQDLdHXxpC+lxxpTmY/fw+NKndi3CGOmm/rpYHo9tppdZCEpDmHetShFMa ccq1zm7GqhnLlFmvaowRVsl58kqV8vOTy63QiXraSVPNfhYtSKV9/XZWZZzTzTtC4Q4nV5 IMJGTCmdZnmhQBOMv1CTRuHligotuR0= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-195-LHR7PSVXNX-FG5SxNURLEw-1; Thu, 31 Oct 2024 13:53:30 -0400 X-MC-Unique: LHR7PSVXNX-FG5SxNURLEw-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-37d531a19a9so613776f8f.1 for ; Thu, 31 Oct 2024 10:53:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730397208; x=1731002008; 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=hXWKUxEScRO0x2Vpd3yUytpTHeCcdbqyX30ALU4opb4=; b=SUyG9ZNMx8tqiJRmGnltQ/wGyZWMikfu8rL/LueXou8tRKTpLh2Hkz1vgTKPePAEp7 RAeKHotNucHrDTISaJVhZFo0jA08JT+Q7ggoKd0ZJVyRo6FMojrpEJDyt4bc9O4MnbHh YMH/hUMO0ttnZtJhyAVPxK3Ju6Uy/IfxYip5pxRIsKJhytK+AD1QkQWBrxB0n125cRM6 ZRRzZd3UVHc8d1VIGB5XEa/SYV5O/cDyeTqyLOQ8KaYkX/Q8hF2+jNeu3vXEd3xw4piI xEWx6C+SQN0H1Fus4XyM7RGPDAkhgjCy/4mex6lfpPZXiymsUoujduJY+w1S4thzx4hS z7kg== X-Gm-Message-State: AOJu0YxGn4CBE/m/9dnRF2Cwh+H5XyTzUegPW1FeSG1xDHiNQOA8bom8 Auvwg3uamsAxfaxopZbUsqVn1FKD25DC0j5/PiMrv+tj/czG3Pad2lOpzF5rqWJsob+/xfACxCY gyU/f5urvqndl4lbFgIKFGqlG/2+7XhCMT7DqtiwAgLnxa0ntgAlDhcfioEC+d/ZnPnqo0ZZZXQ nesezRZ+wx1+HEiuVYwmirb/RwYrhHdkwIBtVcKD0= X-Received: by 2002:a05:6000:410a:b0:37d:2d45:b3d4 with SMTP id ffacd0b85a97d-381bea1093fmr4193548f8f.52.1730397208538; Thu, 31 Oct 2024 10:53:28 -0700 (PDT) X-Received: by 2002:a05:6000:410a:b0:37d:2d45:b3d4 with SMTP id ffacd0b85a97d-381bea1093fmr4193517f8f.52.1730397207844; Thu, 31 Oct 2024 10:53:27 -0700 (PDT) Received: from [192.168.10.3] ([151.49.226.83]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c10ea91bsm2777007f8f.61.2024.10.31.10.53.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 10:53:26 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 32/49] target/i386: Introduce cc_op_size Date: Thu, 31 Oct 2024 18:51:56 +0100 Message-ID: <20241031175214.214455-33-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241031175214.214455-1-pbonzini@redhat.com> References: <20241031175214.214455-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.366, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Replace arithmetic on cc_op with a helper function. Assert that the op has a size and that it is valid for the configuration. Signed-off-by: Richard Henderson Link: https://lore.kernel.org/r/20240701025115.1265117-6-richard.henderson@linaro.org Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 17 ++++++++++++++++- target/i386/tcg/translate.c | 17 +++++++---------- target/i386/tcg/emit.c.inc | 5 +++-- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 6ec63380473..1bf4dfdc5bb 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -24,6 +24,7 @@ #include "cpu-qom.h" #include "kvm/hyperv-proto.h" #include "exec/cpu-defs.h" +#include "exec/memop.h" #include "hw/i386/topology.h" #include "qapi/qapi-types-common.h" #include "qemu/cpu-float.h" @@ -1304,7 +1305,9 @@ typedef enum { CC_OP_ADOX = 2, /* CC_SRC2 = O, CC_SRC = rest. */ CC_OP_ADCOX = 3, /* CC_DST = C, CC_SRC2 = O, CC_SRC = rest. */ - CC_OP_MULB, /* modify all flags, C, O = (CC_SRC != 0) */ + /* Low 2 bits = MemOp constant for the size */ +#define CC_OP_FIRST_BWLQ CC_OP_MULB + CC_OP_MULB = 4, /* modify all flags, C, O = (CC_SRC != 0) */ CC_OP_MULW, CC_OP_MULL, CC_OP_MULQ, @@ -1374,6 +1377,7 @@ typedef enum { CC_OP_POPCNTL__, CC_OP_POPCNTQ__, CC_OP_POPCNT = sizeof(target_ulong) == 8 ? CC_OP_POPCNTQ__ : CC_OP_POPCNTL__, +#define CC_OP_LAST_BWLQ CC_OP_POPCNTQ__ CC_OP_DYNAMIC, /* must use dynamic code to get cc_op */ CC_OP_NB, @@ -1382,6 +1386,17 @@ typedef enum { /* See X86DecodedInsn.cc_op, using int8_t. */ QEMU_BUILD_BUG_ON(CC_OP_DYNAMIC > INT8_MAX); +static inline MemOp cc_op_size(CCOp op) +{ + MemOp size = op & 3; + + QEMU_BUILD_BUG_ON(CC_OP_FIRST_BWLQ & 3); + assert(op >= CC_OP_FIRST_BWLQ && op <= CC_OP_LAST_BWLQ); + assert(size <= MO_TL); + + return size; +} + typedef struct SegmentCache { uint32_t selector; target_ulong base; diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index a20fbb019c8..46062002c02 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -885,7 +885,7 @@ static CCPrepare gen_prepare_eflags_c(DisasContext *s, TCGv reg) case CC_OP_ADDB ... CC_OP_ADDQ: /* (DATA_TYPE)CC_DST < (DATA_TYPE)CC_SRC */ - size = s->cc_op - CC_OP_ADDB; + size = cc_op_size(s->cc_op); tcg_gen_ext_tl(cpu_cc_dst, cpu_cc_dst, size); tcg_gen_ext_tl(cpu_cc_src, cpu_cc_src, size); return (CCPrepare) { .cond = TCG_COND_LTU, .reg = cpu_cc_dst, @@ -902,7 +902,7 @@ static CCPrepare gen_prepare_eflags_c(DisasContext *s, TCGv reg) case CC_OP_SHLB ... CC_OP_SHLQ: /* (CC_SRC >> (DATA_BITS - 1)) & 1 */ - size = s->cc_op - CC_OP_SHLB; + size = cc_op_size(s->cc_op); return gen_prepare_sign_nz(cpu_cc_src, size); case CC_OP_MULB ... CC_OP_MULQ: @@ -910,11 +910,11 @@ static CCPrepare gen_prepare_eflags_c(DisasContext *s, TCGv reg) .reg = cpu_cc_src }; case CC_OP_BMILGB ... CC_OP_BMILGQ: - size = s->cc_op - CC_OP_BMILGB; + size = cc_op_size(s->cc_op); return gen_prepare_val_nz(cpu_cc_src, size, true); case CC_OP_BLSIB ... CC_OP_BLSIQ: - size = s->cc_op - CC_OP_BLSIB; + size = cc_op_size(s->cc_op); return gen_prepare_val_nz(cpu_cc_src, size, false); case CC_OP_ADCX: @@ -966,10 +966,7 @@ static CCPrepare gen_prepare_eflags_s(DisasContext *s, TCGv reg) case CC_OP_POPCNT: return (CCPrepare) { .cond = TCG_COND_NEVER }; default: - { - MemOp size = (s->cc_op - CC_OP_ADDB) & 3; - return gen_prepare_sign_nz(cpu_cc_dst, size); - } + return gen_prepare_sign_nz(cpu_cc_dst, cc_op_size(s->cc_op)); } } @@ -1007,7 +1004,7 @@ static CCPrepare gen_prepare_eflags_z(DisasContext *s, TCGv reg) .imm = CC_Z }; default: { - MemOp size = (s->cc_op - CC_OP_ADDB) & 3; + MemOp size = cc_op_size(s->cc_op); return gen_prepare_val_nz(cpu_cc_dst, size, true); } } @@ -1028,7 +1025,7 @@ static CCPrepare gen_prepare_cc(DisasContext *s, int b, TCGv reg) switch (s->cc_op) { case CC_OP_SUBB ... CC_OP_SUBQ: /* We optimize relational operators for the cmp/jcc case. */ - size = s->cc_op - CC_OP_SUBB; + size = cc_op_size(s->cc_op); switch (jcc_op) { case JCC_BE: tcg_gen_ext_tl(s->cc_srcT, s->cc_srcT, size); diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index 790307dbba8..45ac5edb1ae 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -1466,7 +1466,7 @@ static void gen_bt_flags(DisasContext *s, X86DecodedInsn *decode, TCGv src, TCGv */ decode->cc_src = tcg_temp_new(); decode->cc_dst = cpu_cc_dst; - decode->cc_op = ((s->cc_op - CC_OP_MULB) & 3) + CC_OP_SARB; + decode->cc_op = CC_OP_SARB + cc_op_size(s->cc_op); tcg_gen_shr_tl(decode->cc_src, src, s->T1); } } @@ -3346,7 +3346,8 @@ static bool gen_eflags_adcox(DisasContext *s, X86DecodedInsn *decode, bool want_ * bit, we might as well fish CF out of EFLAGS and save a shift. */ if (want_carry && (!need_flags || s->cc_op == CC_OP_SHLB + MO_TL)) { - tcg_gen_shri_tl(decode->cc_dst, cpu_cc_src, (8 << (s->cc_op - CC_OP_SHLB)) - 1); + MemOp size = cc_op_size(s->cc_op); + tcg_gen_shri_tl(decode->cc_dst, cpu_cc_src, (8 << size) - 1); got_cf = true; } gen_mov_eflags(s, decode->cc_src); From patchwork Thu Oct 31 17:51:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 839880 Delivered-To: patch@linaro.org Received: by 2002:adf:a38c:0:b0:37d:45d0:187 with SMTP id l12csp423922wrb; Thu, 31 Oct 2024 11:00:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXrID7VQOMkO+kX45mQTykJ37u2y4qz6MfVgmuazZd2yJt/BcjQLbq5trii2AYLfUexJBm6fg==@linaro.org X-Google-Smtp-Source: AGHT+IEbceav7xlLIeCZc+OqL1ubZwBFEW1k5eWytn/96RVR+MU5soygn4wY5WR9uoPcn/W8T3Lz X-Received: by 2002:a05:620a:24d0:b0:7b1:4480:5d77 with SMTP id af79cd13be357-7b2f253d4b9mr548647285a.49.1730397624781; Thu, 31 Oct 2024 11:00:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1730397624; cv=none; d=google.com; s=arc-20240605; b=h/FfNBaboDjvyRaTItMelYLrV7FBFK89JdjDqMGCRCVeb3L8qNAbsKNuj04x5Aq7BH ft0Scxyby8UognTa5ge8IaFX9ydl6N3g/V81bC6za6k+d0FihBztaSBi10o1rOeO6jy6 51fae+zjOMjQORWgTyfyhQVYNfDrFwp9rJX2aFjnBuyTFukICx/ZbAxJHk0TN74Oi7vi /R+DcgAsJJb95SQ8CpaN4Ga2pxXjN4LSWp8f2aegoFxMF+yZqx/+oW8KaGSnDwKSaK1N iHCWgclFhGAH/xD9sxPCzEJ9qY9AV8hiTTTjBsZ4Bfe9xhcHQMyiy0i5JZeUTDYB+aq2 yRxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Zrwani3gonZTzKYpMi2oDrb/LZf4DCY0YAe5CLjmoRA=; fh=mN+7zamMqtxpbv5qGNGIO/QHsXnjUAqHW/yN5gisKlY=; b=WR5/94JqejfIYkCR4Cyg0TjozZUNk+dX1v5vNQY5yAs6Mw8gXR1yX44ESqr5QIikow kgK+EBM+WJrCIIsJBVUN+OMMIJQs7DfARujiBLsueiO5RiPNGQE94hNd4WCyV7CvYPHS 5WHiLW1sFWGCl/IWhKxnaiP4sGK9nHwGI2PLUXY2raDR3YHRJAUAotJwpGZM3LD35nBn Xpouwo/KKk0b+WnL6uI/uP5cv8vj5+fYKzvXlsie0wir/Q/+WYYFDVEeo8qGXYv5zDPu a5Eg+ExXuiMWaWOIBTlvfACVM6HmekP3oMrTgAnObp0/frbc2xIXsdVru5M/rN1g25jx e2AQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IvIMJp6e; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b2f3a033b9si237587585a.177.2024.10.31.11.00.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 31 Oct 2024 11:00:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IvIMJp6e; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t6ZNt-0005Wi-Dd; Thu, 31 Oct 2024 13:55: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 1t6ZMW-00027o-Im for qemu-devel@nongnu.org; Thu, 31 Oct 2024 13:53:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t6ZMV-0007Q4-3O for qemu-devel@nongnu.org; Thu, 31 Oct 2024 13:53:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1730397214; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Zrwani3gonZTzKYpMi2oDrb/LZf4DCY0YAe5CLjmoRA=; b=IvIMJp6e5EBrIVEkKyzn16h9mqdcp2GxkHM67OHKAEG/cgUQEa8OSrwqamQojnqdYGuTvM jHtoYtM1m4gzvq2zhilpwENvIjhkxW10IvsKEDSysnB7LBys+Ey/d0AzpJ7pylCKiMBlbJ S9eb8SiJnNOXjvu41TX9/jiDbMVKwNI= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-456-vYY9Vg2WPF-6q0FCiKaLrA-1; Thu, 31 Oct 2024 13:53:33 -0400 X-MC-Unique: vYY9Vg2WPF-6q0FCiKaLrA-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-37d4cf04bcfso530798f8f.2 for ; Thu, 31 Oct 2024 10:53:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730397211; x=1731002011; 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=Zrwani3gonZTzKYpMi2oDrb/LZf4DCY0YAe5CLjmoRA=; b=WolpHb+Ua0BgEt5Ss1tefVGU9Uwz8L34hZLGNDIhEAq3Cl3Dwz8V15pUFe4h6GEx9I I+GItF+OUSD1it+wo9LbFdGNYiGU3RZSmeLy/fJUVTIxGKXQMMFfsdSs+bnK7W+hM4FO XPdMVGsAxCqgQCi4Iqn0OGLYrjwZRFMm+Iql9oDr9/XxEWhQYZDTA4JLuFgb9/BXr2Y5 0bptOhi7nGOsMNm9JlxqbQ4/ZaeAMza5zg180iVwfVVMLoMqertCjglLylrI3FoJ3yhD 9vyQUXhURuXA0VZVYGxMgzojbvRuh03YkoZyiX8yhm9kpfAV/1n/isA5GF6ow2vpDlj3 Sy7Q== X-Gm-Message-State: AOJu0Yz7IxSDmTw28c8ymcZaHebhRfJamtbByH1VYo40Pbdh84dDsss7 YfHMUasQxhrX9f3Q7bvKed9soWRTLh3Z8uxSYFc3x817BZ06jiR1vtWNQangNzokwpOFCgy6Emf NvMYRj3KRB+p49T7LB3dyZd5Um5VGp2pTUXXfLvmAA+QDOT7ptn0AMtr3MydqnT54UU4cVkif3t A6uD9gVqTODKUe/EXjy+MZsowR8HdsAAae09W3OLQ= X-Received: by 2002:a5d:59ae:0:b0:37d:4436:4505 with SMTP id ffacd0b85a97d-381c7a6da29mr739290f8f.32.1730397210665; Thu, 31 Oct 2024 10:53:30 -0700 (PDT) X-Received: by 2002:a5d:59ae:0:b0:37d:4436:4505 with SMTP id ffacd0b85a97d-381c7a6da29mr739267f8f.32.1730397210104; Thu, 31 Oct 2024 10:53:30 -0700 (PDT) Received: from [192.168.10.3] ([151.49.226.83]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c10b7b97sm2819130f8f.2.2024.10.31.10.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Oct 2024 10:53:28 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Richard Henderson Subject: [PULL 33/49] target/i386: Wrap cc_op_live with a validity check Date: Thu, 31 Oct 2024 18:51:57 +0100 Message-ID: <20241031175214.214455-34-pbonzini@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241031175214.214455-1-pbonzini@redhat.com> References: <20241031175214.214455-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.366, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Assert that op is known and that cc_op_live_ is populated. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- target/i386/cpu.h | 1 - target/i386/tcg/translate.c | 21 ++++++++++++++++++--- target/i386/tcg/decode-new.c.inc | 2 +- target/i386/tcg/emit.c.inc | 4 ++-- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 1bf4dfdc5bb..a0a122cb5bf 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1380,7 +1380,6 @@ typedef enum { #define CC_OP_LAST_BWLQ CC_OP_POPCNTQ__ CC_OP_DYNAMIC, /* must use dynamic code to get cc_op */ - CC_OP_NB, } CCOp; /* See X86DecodedInsn.cc_op, using int8_t. */ diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 46062002c02..1a9a2fe709e 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -291,7 +291,7 @@ enum { }; /* Bit set if the global variable is live after setting CC_OP to X. */ -static const uint8_t cc_op_live[CC_OP_NB] = { +static const uint8_t cc_op_live_[] = { [CC_OP_DYNAMIC] = USES_CC_DST | USES_CC_SRC | USES_CC_SRC2, [CC_OP_EFLAGS] = USES_CC_SRC, [CC_OP_MULB ... CC_OP_MULQ] = USES_CC_DST | USES_CC_SRC, @@ -312,6 +312,21 @@ static const uint8_t cc_op_live[CC_OP_NB] = { [CC_OP_POPCNT] = USES_CC_DST, }; +static uint8_t cc_op_live(CCOp op) +{ + uint8_t result; + assert(op >= 0 && op < ARRAY_SIZE(cc_op_live_)); + + /* + * Check that the array is fully populated. A zero entry would correspond + * to a fixed value of EFLAGS, which can be obtained with CC_OP_EFLAGS + * as well. + */ + result = cc_op_live_[op]; + assert(result); + return result; +} + static void set_cc_op_1(DisasContext *s, CCOp op, bool dirty) { int dead; @@ -321,7 +336,7 @@ static void set_cc_op_1(DisasContext *s, CCOp op, bool dirty) } /* Discard CC computation that will no longer be used. */ - dead = cc_op_live[s->cc_op] & ~cc_op_live[op]; + dead = cc_op_live(s->cc_op) & ~cc_op_live(op); if (dead & USES_CC_DST) { tcg_gen_discard_tl(cpu_cc_dst); } @@ -808,7 +823,7 @@ static void gen_mov_eflags(DisasContext *s, TCGv reg) src2 = cpu_cc_src2; /* Take care to not read values that are not live. */ - live = cc_op_live[s->cc_op] & ~USES_CC_SRCT; + live = cc_op_live(s->cc_op) & ~USES_CC_SRCT; dead = live ^ (USES_CC_DST | USES_CC_SRC | USES_CC_SRC2); if (dead) { TCGv zero = tcg_constant_tl(0); diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc index 48bf730cd3e..cda32ee6784 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -2865,7 +2865,7 @@ static void disas_insn(DisasContext *s, CPUState *cpu) tcg_gen_mov_i32(cpu_cc_op, decode.cc_op_dynamic); } set_cc_op(s, decode.cc_op); - cc_live = cc_op_live[decode.cc_op]; + cc_live = cc_op_live(decode.cc_op); } else { cc_live = 0; } diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc index 45ac5edb1ae..785ff63f2ac 100644 --- a/target/i386/tcg/emit.c.inc +++ b/target/i386/tcg/emit.c.inc @@ -3777,13 +3777,13 @@ static void gen_shift_dynamic_flags(DisasContext *s, X86DecodedInsn *decode, TCG decode->cc_op_dynamic = tcg_temp_new_i32(); assert(decode->cc_dst == s->T0); - if (cc_op_live[s->cc_op] & USES_CC_DST) { + if (cc_op_live(s->cc_op) & USES_CC_DST) { decode->cc_dst = tcg_temp_new(); tcg_gen_movcond_tl(TCG_COND_EQ, decode->cc_dst, count, tcg_constant_tl(0), cpu_cc_dst, s->T0); } - if (cc_op_live[s->cc_op] & USES_CC_SRC) { + if (cc_op_live(s->cc_op) & USES_CC_SRC) { tcg_gen_movcond_tl(TCG_COND_EQ, decode->cc_src, count, tcg_constant_tl(0), cpu_cc_src, decode->cc_src); }