MCPcopy Create free account
hub / github.com/numpy/numpy / npy__cpu_getxcr0

Function npy__cpu_getxcr0

numpy/core/src/common/npy_cpu_features.c:376–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

374#endif
375
376static int
377npy__cpu_getxcr0(void)
378{
379#if defined(_MSC_VER) || defined (__INTEL_COMPILER)
380 return _xgetbv(0);
381#elif defined(__GNUC__) || defined(__clang__)
382 /* named form of xgetbv not supported on OSX, so must use byte form, see:
383 * https://github.com/asmjit/asmjit/issues/78
384 */
385 unsigned int eax, edx;
386 __asm(".byte 0x0F, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c"(0));
387 return eax;
388#else
389 return 0;
390#endif
391}
392
393static void
394npy__cpu_cpuid(int reg[4], int func_id)

Callers 1

npy__cpu_init_featuresFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected