Lines 1-25
Link Here
|
1 |
--- IlmImf/ImfSystemSpecific.cpp.orig 2014-08-10 04:23:57 UTC |
1 |
--- IlmImf/ImfSystemSpecific.cpp.orig 2014-08-10 08:23:57.000000000 +0400 |
2 |
+++ IlmImf/ImfSystemSpecific.cpp |
2 |
+++ IlmImf/ImfSystemSpecific.cpp 2015-04-09 00:08:50.100958000 +0300 |
3 |
@@ -35,6 +35,9 @@ |
3 |
@@ -44,11 +44,23 @@ |
4 |
#include "ImfSystemSpecific.h" |
|
|
5 |
#include "ImfNamespace.h" |
6 |
#include "OpenEXRConfig.h" |
7 |
+#if defined(IMF_HAVE_SSE2) && defined(__GNUC__) |
8 |
+#include <cpuid.h> |
9 |
+#endif |
10 |
|
11 |
OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER |
12 |
|
13 |
@@ -44,11 +47,7 @@ namespace { |
14 |
// Helper functions for gcc + SSE enabled |
4 |
// Helper functions for gcc + SSE enabled |
15 |
void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) |
5 |
void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) |
16 |
{ |
6 |
{ |
17 |
- __asm__ __volatile__ ( |
7 |
+#if __i386__ |
|
|
8 |
__asm__ __volatile__ ( |
18 |
- "cpuid" |
9 |
- "cpuid" |
19 |
- : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) |
10 |
- : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) |
20 |
- : /* Input */ "a"(n) |
11 |
- : /* Input */ "a"(n) |
21 |
- : /* Clobber */); |
12 |
+ "xchgl %%ebx,%k1\n" |
22 |
+ __cpuid(n, eax, ebx, ecx, edx); |
13 |
+ "cpuid\n" |
|
|
14 |
+ "xchgl %%ebx,%k1" \ |
15 |
+ : /* Output */ "=a"(eax), "=&r"(ebx), "=c"(ecx), "=d"(edx) |
16 |
+ : /* Input */ "0"(n) |
17 |
: /* Clobber */); |
18 |
+#else |
19 |
+ __asm__ __volatile__ ( |
20 |
+ "xchgq %%rbx,%q1\n" |
21 |
+ "cpuid\n" |
22 |
+ "xchgq %%rbx,%q1" \ |
23 |
+ : /* Output */ "=a"(eax), "=&r"(ebx), "=c"(ecx), "=d"(edx) |
24 |
+ : /* Input */ "0"(n) |
25 |
+ : /* Clobber */); |
26 |
+#endif |
23 |
} |
27 |
} |
24 |
|
28 |
|
25 |
#else // IMF_HAVE_SSE2 && __GNUC__ |
29 |
#else // IMF_HAVE_SSE2 && __GNUC__ |