* [PATCH] tests/tcg: cover lzcnt/tzcnt/popcnt
@ 2024-05-09 15:25 Paolo Bonzini
2024-05-10 9:27 ` Zhao Liu
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2024-05-09 15:25 UTC (permalink / raw)
To: qemu-devel
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
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=" FMTLX " R=" FMTLX " %ld\n", #op, val, res, resz);\
}
+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();
--
2.45.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tests/tcg: cover lzcnt/tzcnt/popcnt
2024-05-09 15:25 [PATCH] tests/tcg: cover lzcnt/tzcnt/popcnt Paolo Bonzini
@ 2024-05-10 9:27 ` Zhao Liu
0 siblings, 0 replies; 2+ messages in thread
From: Zhao Liu @ 2024-05-10 9:27 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel
On Thu, May 09, 2024 at 05:25:32PM +0200, Paolo Bonzini wrote:
> Date: Thu, 9 May 2024 17:25:32 +0200
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH] tests/tcg: cover lzcnt/tzcnt/popcnt
> X-Mailer: git-send-email 2.45.0
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> tests/tcg/i386/test-i386.c | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-10 9:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-09 15:25 [PATCH] tests/tcg: cover lzcnt/tzcnt/popcnt Paolo Bonzini
2024-05-10 9:27 ` Zhao Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).