]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix none/tests/x86/crc32 u8 register testcase
authorMark Wielaard <mark@klomp.org>
Sat, 20 Jun 2026 17:02:05 +0000 (19:02 +0200)
committerMark Wielaard <mark@klomp.org>
Sat, 20 Jun 2026 17:02:05 +0000 (19:02 +0200)
For the CRC32 U8 (crc32b) we were loading the input word into %edi but
then used %dl as input byte (register) for te crc32 instruction. %dl
however is the 8 byte variant of %edx. This made the testcase output
depend on the specific compiler (version) used, since what was in %edx
isn't strictly defined.

The %edi register doesn't have a 8 byte variant. So use %edx instead
to load the input word. For the CRC32 u16 (crc32w) we still use %edi
because we can then use the 16 byte %di.

https://bugs.kde.org/show_bug.cgi?id=438640

none/tests/x86/crc32.c
none/tests/x86/crc32.stdout.exp

index ed9137988d51f5ea9bf0bd894572656b163d3eb9..f5e2a561e591d4f1f2e4a05c24dcf7a4eb5d6812 100644 (file)
@@ -198,7 +198,7 @@ void test_CRC32_U8_x86 ( void )
       block[3] = (UInt)randUInt();
       __asm__ __volatile__(
          "movl %0,       %%eax"  "\n\t"
-         "movl 0(%%eax), %%edi"  "\n\t"
+         "movl 0(%%eax), %%edx"  "\n\t"
          "movl 4(%%eax), %%ecx"  "\n\t"
          "crc32 %%dl,  %%ecx"  "\n\t"
          "movl %%ecx, 8(%%eax)"  "\n\t"
@@ -207,7 +207,7 @@ void test_CRC32_U8_x86 ( void )
          "movl %%edx, 12(%%eax)"  "\n"
          : /*out*/
          : /*in*/"r"(&block[0])
-         : /*trash*/ "cc", "memory", "edi", "ecx", "edx"
+         : /*trash*/ "cc", "memory", "ecx", "edx"
       );
       printf("r crc32_u8  %08x %08x  %08x %08x\n",
              block[0], block[1], block[2], block[3] & oszacp_mask);
index 515d6b93e47380c24fd6877a6708a444f9597994..d34040774d96c8b26e5c20a119f5650ce003be89 100644 (file)
@@ -11,23 +11,23 @@ mem l misalign 3 = 00d2a6af
 try_misc 32bit-dst 0xa50765b3
 r crc32_u8  00000000 00571784  456cfb70 00000000
 m crc32_u8  00000000 9de37551  a3d3baa5 00000000
-r crc32_u8  0d6a95fa c528657d  ce7530bb 00000000
+r crc32_u8  0d6a95fa c528657d  56f977f6 00000000
 m crc32_u8  84c4457d 8560b160  aff3eb0d 00000000
-r crc32_u8  2751bca7 5afbd2b6  94ee6ef3 00000000
+r crc32_u8  2751bca7 5afbd2b6  e26fbfbe 00000000
 m crc32_u8  fd673a5c 2148a319  74ab4103 00000000
-r crc32_u8  6b3e625d 19775d06  26b890b5 00000000
+r crc32_u8  6b3e625d 19775d06  c8b506b5 00000000
 m crc32_u8  36ed3550 df9899d8  08f0fb2e 00000000
-r crc32_u8  856c13b8 709950cb  5a7414af 00000000
+r crc32_u8  856c13b8 709950cb  62b83ea9 00000000
 m crc32_u8  db93c0f8 294addf9  f242c9de 00000000
-r crc32_u8  1f195c53 c95bf85f  0fffbd0f 00000000
+r crc32_u8  1f195c53 c95bf85f  4d8a9428 00000000
 m crc32_u8  979569ee 6d5cbcd8  162ff2e5 00000000
-r crc32_u8  e87fc9cb 92bba120  202f357f 00000000
+r crc32_u8  e87fc9cb 92bba120  7a2bb880 00000000
 m crc32_u8  172ebcce 16c982d1  4e5b32c9 00000000
-r crc32_u8  8adae4bb 36b59768  eb297e3a 00000000
+r crc32_u8  8adae4bb 36b59768  c0b5a7c8 00000000
 m crc32_u8  069b4435 908d7b40  44f9cd6a 00000000
-r crc32_u8  b2683bbf 21432695  a778ab2d 00000000
+r crc32_u8  b2683bbf 21432695  4b7ee5c0 00000000
 m crc32_u8  11188dbe 47a5f281  6eb7d067 00000000
-r crc32_u8  0b635974 bf639901  f2d4e09a 00000000
+r crc32_u8  0b635974 bf639901  44d62388 00000000
 m crc32_u8  e4e02305 a70c35f0  c638775c 00000000
 r crc32_u16  00000000 4208cb75  b875e2db 00000000
 m crc32_u16  00000000 d5e7ca54  26378d42 00000000