python/hypothesis: update to 6.121.0
[oi-userland.git] / components / library / openexr / patches / 016-cpuid.patch
blobde5cab0ad242a6f700f55feb016d10f2866867e3
1 --- openexr-3.2.0/src/lib/OpenEXR/ImfSystemSpecific.cpp.orig 2023-08-28 19:56:26.000000000 +0200
2 +++ openexr-3.2.0/src/lib/OpenEXR/ImfSystemSpecific.cpp 2023-09-02 09:30:06.458371741 +0200
3 @@ -19,23 +19,22 @@
4 #if defined(IMF_HAVE_SSE2) && defined(__GNUC__) && !defined(__e2k__)
6 // Helper functions for gcc + SSE enabled
8 +#include <cpuid.h>
10 void
11 -cpuid (int n, int& eax, int& ebx, int& ecx, int& edx)
12 +cpuid (unsigned int n, unsigned int& eax, unsigned int& ebx, unsigned int& ecx, unsigned int& edx)
14 - __asm__ __volatile__(
15 - "cpuid"
16 - : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx)
17 - : /* Input */ "a"(n)
18 - : /* Clobber */);
19 + __get_cpuid(n, &eax, &ebx, &ecx, &edx);
22 #elif defined(_MSC_VER) && ( defined(_M_IX86) || ( defined(_M_AMD64) && !defined(_M_ARM64EC) ) )
24 // Helper functions for MSVC
25 void
26 -cpuid (int n, int& eax, int& ebx, int& ecx, int& edx)
27 +cpuid (unsigned int n, unsigned int& eax, unsigned int& ebx, unsigned int& ecx, unsigned int& edx)
29 - int cpuInfo[4] = { -1 };
30 + unsigned int cpuInfo[4] = { -1 };
31 __cpuid (cpuInfo, n);
32 eax = cpuInfo[0];
33 ebx = cpuInfo[1];
34 @@ -47,7 +46,7 @@
36 // Helper functions for generic compiler - all disabled
37 void
38 -cpuid (int n, int& eax, int& ebx, int& ecx, int& edx)
39 +cpuid (unsigned int n, unsigned int& eax, unsigned int& ebx, unsigned int& ecx, unsigned int& edx)
41 eax = ebx = ecx = edx = 0;
43 @@ -57,7 +56,7 @@
44 #ifdef IMF_HAVE_GCC_INLINEASM_X86
46 void
47 -xgetbv (int n, int& eax, int& edx)
48 +xgetbv (unsigned int n, unsigned int& eax, unsigned int& edx)
50 __asm__ __volatile__("xgetbv"
51 : /* Output */ "=a"(eax), "=d"(edx)
52 @@ -68,7 +67,7 @@
53 #else // IMF_HAVE_GCC_INLINEASM_X86
55 void
56 -xgetbv (int n, int& eax, int& edx)
57 +xgetbv (unsigned int n, unsigned int& eax, unsigned int& edx)
59 eax = edx = 0;
61 @@ -111,8 +110,8 @@
62 # endif
63 #else // x86/x86_64
64 bool osxsave = false;
65 - int max = 0;
66 - int eax, ebx, ecx, edx;
67 + unsigned int max = 0;
68 + unsigned int eax, ebx, ecx, edx;
70 cpuid (0, max, ebx, ecx, edx);
71 if (max > 0)