| 391 | } |
| 392 | |
| 393 | static void |
| 394 | npy__cpu_cpuid(int reg[4], int func_id) |
| 395 | { |
| 396 | #if defined(_MSC_VER) |
| 397 | __cpuidex(reg, func_id, 0); |
| 398 | #elif defined(__INTEL_COMPILER) |
| 399 | __cpuid(reg, func_id); |
| 400 | #elif defined(__GNUC__) || defined(__clang__) |
| 401 | #if defined(NPY_CPU_X86) && defined(__PIC__) |
| 402 | // %ebx may be the PIC register |
| 403 | __asm__("xchg{l}\t{%%}ebx, %1\n\t" |
| 404 | "cpuid\n\t" |
| 405 | "xchg{l}\t{%%}ebx, %1\n\t" |
| 406 | : "=a" (reg[0]), "=r" (reg[1]), "=c" (reg[2]), |
| 407 | "=d" (reg[3]) |
| 408 | : "a" (func_id), "c" (0) |
| 409 | ); |
| 410 | #else |
| 411 | __asm__("cpuid\n\t" |
| 412 | : "=a" (reg[0]), "=b" (reg[1]), "=c" (reg[2]), |
| 413 | "=d" (reg[3]) |
| 414 | : "a" (func_id), "c" (0) |
| 415 | ); |
| 416 | #endif |
| 417 | #else |
| 418 | reg[0] = 0; |
| 419 | #endif |
| 420 | } |
| 421 | |
| 422 | static void |
| 423 | npy__cpu_init_features(void) |
no outgoing calls
no test coverage detected