From nobody Mon Nov 25 09:45:24 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1715268404; cv=none; d=zohomail.com; s=zohoarc; b=L1RLdrpN+O1bmCwt++zdLue5t2eibTOGuNMtRINO/V/Bbv1Qigesd7YuKwGx24LeqkIPRCbnRtaGJnFZ9iATAdOmlak8hrrdyupeax7RsMU6A39he8vdt19YNKM/3THSrJpJPQuiITpvzsMWPHxVv64PivVwFVqDOVjMB5nPd5o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715268404; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=zpotsg25Hj/ueq1pSaXUMSU1LC0Q+INR1K1IUm2B9pk=; b=Pt8rW81DL6TxGk7GF/1A55Wq5RbPGQFiJJh1tqd5Okx5J4WtIzD0K2Z79gxdtTCE+Q8crwNeZsHm76SQ/RtFZ8znZQo1c6ogdPu+Yfsg5HUVwSUw0GonVnzPIgV5abU3rhcFPJlkZ9eXB52Bv2zlTp24OEyUCzKSKbJFkufhE0s= 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 1715268404491698.6711126485807; Thu, 9 May 2024 08:26:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s55eS-0000OA-3n; Thu, 09 May 2024 11:25:44 -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 1s55eO-0000Me-Gf for qemu-devel@nongnu.org; Thu, 09 May 2024 11:25:41 -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 1s55eN-0006NK-2c for qemu-devel@nongnu.org; Thu, 09 May 2024 11:25:40 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-398-eH_3xK2VOBq4YCAtuDr1TQ-1; Thu, 09 May 2024 11:25:36 -0400 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a5a1b50d45cso46326066b.2 for ; Thu, 09 May 2024 08:25:35 -0700 (PDT) Received: from avogadro.local ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a1781cdb5sm84692466b.29.2024.05.09.08.25.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 08:25:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715268338; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zpotsg25Hj/ueq1pSaXUMSU1LC0Q+INR1K1IUm2B9pk=; b=QLUNBWLuwCIlbRp5GG4djqHVlZJjnUvGJyc9hnl+HoHC2eIDMsRweH46WjEFQCQecjjvNn +93vFJOIpeRon0PgbZ7XiwOWj7xvWwu3uSQZLHJSqOCPnFlDxwnI78fjMyAev6IUmzyflI qa12ryo3I9VShhTicSI7C7qWXWaGJ6o= X-MC-Unique: eH_3xK2VOBq4YCAtuDr1TQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715268334; x=1715873134; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zpotsg25Hj/ueq1pSaXUMSU1LC0Q+INR1K1IUm2B9pk=; b=vggLYRzr6gHn+nGk/U7fhvIxt0i895kEDWRLpHapP6KBl2thh4fEw4pEG1rMO4WnHy ZEkTTG7Ch101Cs+o78Akm+PGjZYW2nL2VooGFyFFrvI/hG8hGwQrP1AXR2kkrVRj/ccd mu/01qtlUS28QViIP5M0R/6JgE9qs8JnNkplp0Ykyp1d1HPlKs2keMbfqnlZC3VUYC1w nseGh1/J2dKciskI0NQxB01wAP9OkoFEb+/SLjQ+vxYtAiaYZDdrb7y4w3eyfsRKAEWb W2M78jYekAugdUeIckB7ibdGBJBI1z+OYU1iQjBvixW2FMtZXsjB19X6QbTcdjF+8fsC Mvvg== X-Gm-Message-State: AOJu0YykWy7DIDS9uqiHW7Fzy3Ff8p71IdSjsGKRZbhNt8ORE9/NN2oq bpx3W7S0P4QtZ/D0k2GTUPcEgnAqsfnDkdVMt7N+nnLI1+iuW0P31cMx9bwqCuZEHhifmOcFAda KiOKbz5Hj3qzionvuo3yZC6ZurkZuwlFK5ne742nxMp9vxiDHK2LP/DjTZKlLEN3FL+t2CyStZM 9ZQzU6g1vFHf9d/4fSKkvla7weZ88yGbhriMlx X-Received: by 2002:a17:906:6d51:b0:a59:c2c3:bb45 with SMTP id a640c23a62f3a-a59fb9cd4femr398258566b.56.1715268334683; Thu, 09 May 2024 08:25:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdzmb1orLYiWLwhcGC2MDbexTcAHjB8ZkOP97QPAUgTPGU9iwvOVBgG/7D2vx8nOdL+hy/eA== X-Received: by 2002:a17:906:6d51:b0:a59:c2c3:bb45 with SMTP id a640c23a62f3a-a59fb9cd4femr398256166b.56.1715268334139; Thu, 09 May 2024 08:25:34 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH] tests/tcg: cover lzcnt/tzcnt/popcnt Date: Thu, 9 May 2024 17:25:32 +0200 Message-ID: <20240509152532.141935-1-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.0 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.581, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1715268406100100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Paolo Bonzini Reviewed-by: Zhao Liu --- tests/tcg/i386/test-i386.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c index 864c4e620d5..ce3bf74b5a8 100644 --- a/tests/tcg/i386/test-i386.c +++ b/tests/tcg/i386/test-i386.c @@ -715,6 +715,30 @@ void test_mul(void) printf("%-10s A=3D" FMTLX " R=3D" FMTLX " %ld\n", #op, val, res, resz)= ;\ } =20 +void test_xcnt(void) +{ + TEST_BSX(tzcntw, "w", 0); + TEST_BSX(tzcntw, "w", 0x12340128); + TEST_BSX(lzcntw, "w", 0); + TEST_BSX(lzcntw, "w", 0x12340128); + TEST_BSX(popcntw, "w", 0); + TEST_BSX(popcntw, "w", 0x12340128); + TEST_BSX(tzcntl, "k", 0); + TEST_BSX(tzcntl, "k", 0x00340128); + TEST_BSX(lzcntl, "k", 0); + TEST_BSX(lzcntl, "k", 0x00340128); + TEST_BSX(popcntl, "k", 0); + TEST_BSX(popcntl, "k", 0x00340128); +#if defined(__x86_64__) + TEST_BSX(tzcntq, "", 0); + TEST_BSX(tzcntq, "", 0x003401281234); + TEST_BSX(lzcntq, "", 0); + TEST_BSX(lzcntq, "", 0x003401281234); + TEST_BSX(popcntq, "", 0); + TEST_BSX(popcntq, "", 0x003401281234); +#endif +} + void test_bsx(void) { TEST_BSX(bsrw, "w", 0); @@ -2162,6 +2186,7 @@ int main(int argc, char **argv) func(); } test_bsx(); + test_xcnt(); test_mul(); test_jcc(); test_loop(); --=20 2.45.0