fixed #1587: update crc64_sse42_dispatch(), add appropriate parameters to inline asm

This commit is contained in:
Zixuan Fu 2023-10-03 19:42:53 +08:00
parent c485d510b7
commit 767af11ad0

View File

@ -1121,11 +1121,8 @@ uint64_t crc64_sse42_dispatch(uint64_t crc, const char *buf, int64_t len)
uint32_t d = 0;
uint32_t vendor_info[4];
__asm__("mov $0x0, %eax\n\t");
__asm__("cpuid\n\t");
__asm__("mov %%ebx, %0\n\t":"=r" (vendor_info[0]));
__asm__("mov %%edx, %0\n\t":"=r" (vendor_info[1]));
__asm__("mov %%ecx, %0\n\t":"=r" (vendor_info[2]));
uint32_t leaf = 0;
asm("cpuid" : "+a"(leaf), "=b"(vendor_info[0]), "=d"(vendor_info[1]), "=c"(vendor_info[2]));
vendor_info[3]='\0';
if (strcmp((char*)vendor_info, "GenuineIntel") == 0) {