summaryrefslogtreecommitdiff
path: root/testsuite.c
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2013-02-20 18:40:14 -0500
committerSøren Sandmann Pedersen <ssp@redhat.com>2013-02-20 18:40:14 -0500
commit44b5b101aebcf33b23aaf7e61c44d2e569f122ec (patch)
treebb11238d6a8a2aa8c19a5e807925441168f01cae /testsuite.c
parentb4d70ba2f6e36a61428e1156e0c463ffae835f02 (diff)
bsf, bsr, crc32
Diffstat (limited to 'testsuite.c')
-rw-r--r--testsuite.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/testsuite.c b/testsuite.c
index cfaf126..5090514 100644
--- a/testsuite.c
+++ b/testsuite.c
@@ -131,6 +131,25 @@ test_convert (assembler_t *as)
I_movbe, PTR (eax), ax,
I_movbe, PTR (eax), eax,
I_movbe, PTR (rax), rax,
+ I_bsf, ax, PTR (eax),
+ I_bsr, eax, eax,
+ I_bsf, r9d, BASE (r9d, 17),
+ I_bsr, rcx, rcx,
+ END_ASM ();
+
+ return assembler_link (as, frag, NULL);
+}
+
+static uint8_t *
+test_crc32 (assembler_t *as)
+{
+ fragment_t *frag = fragment_new (as);
+
+ BEGIN_ASM (frag)
+ I_crc32_8, eax, PTR (ebx),
+ I_crc32_16, eax, PTR (eax),
+ I_crc32_32, eax, eax,
+ I_crc32_64, r9, PTR (r9),
END_ASM ();
return assembler_link (as, frag, NULL);
@@ -357,14 +376,21 @@ main ()
as = assembler_new ("pixman");
+#if 0
+ assembler_set_verbose (as, 1);
+#endif
+
/* FIXME: We may produce different binaries on on machines that don't
* support multibyte nop. We need a way to force the assembler to
* pretend that the machine has or hasn't some specific features.
+ *
+ * Also we will produce different output on 32 vs 64 bit.
*/
+ success &= run_test (as, "test_crc32", test_crc32, 0x3ce8ed36 );
success &= run_test (as, "avx_supported", avx_supported, 0xeeaec30c);
success &= run_test (as, "test_shifts", test_shifts, 0x8aa3c8ae);
success &= run_test (as, "test_float", test_float, 0xc193030 );
- success &= run_test (as, "test_convert", test_convert, 0x9676d300);
+ success &= run_test (as, "test_convert", test_convert, 0x9d52c83b);
success &= run_test (as, "test_misc", test_misc, 0xc6b9051f);
if (success)