-
Notifications
You must be signed in to change notification settings - Fork 0
/
arm64.patch
75 lines (65 loc) · 2.3 KB
/
arm64.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
--- source/DXT/SquishEncoder.c 2018-04-23 13:52:54.000000000 -0400
+++ source/DXT/SquishEncoder.c 2020-11-09 15:39:33.000000000 -0500
@@ -145,9 +145,11 @@
#if defined(HAP_SSSE3_ALWAYS_AVAILABLE)
HapCodecDXTReadBlockBGRASSSE3(copy_src, copy_dst, src_bytes_per_row);
-#else
+#elif defined(__x86_64__)
if (hasSSSE3) HapCodecDXTReadBlockBGRASSSE3(copy_src, copy_dst, src_bytes_per_row);
else HapCodecDXTReadBlockBGRAScalar(copy_src, copy_dst, src_bytes_per_row);
+#else
+ HapCodecDXTReadBlockBGRAScalar(copy_src, copy_dst, src_bytes_per_row);
#endif
}
--- source/DXT/DXTBlocksSSSE3.c 2018-04-23 13:52:54.000000000 -0400
+++ source/DXT/DXTBlocksSSSE3.c 2020-11-09 15:37:12.000000000 -0500
@@ -25,6 +25,7 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifdef __x86_64__
#include "DXTBlocks.h"
#include <tmmintrin.h>
@@ -42,3 +43,4 @@
copy_dst += 16;
}
}
+#endif
--- source/DXT/DXTBlocks.c 2018-04-23 13:52:54.000000000 -0400
+++ source/DXT/DXTBlocks.c 2020-11-09 15:33:18.000000000 -0500
@@ -46,6 +46,7 @@
#else
+#ifdef __x86_64__
static void hap_cpuid(int info[4],int infoType){
__asm__ __volatile__ (
"cpuid":
@@ -56,11 +57,13 @@
"a" (infoType)
);
}
+#endif
#endif // !defined(_WIN32)
int HapCodecHasSSSE3(void)
{
+#ifdef __x86_64__
int info[4] = { 0, 0, 0, 0 };
int hasSSE2, hasSSE3, hasSSSE3;
@@ -69,6 +72,9 @@
hasSSE3 = (info[2] & ((int)1 << 0)) != 0;
hasSSSE3 = (info[2] & ((int)1 << 9)) != 0;
return (hasSSE2 && hasSSE3 && hasSSSE3);
+#else
+ return 0;
+#endif
}
void HapCodecDXTReadBlockBGRAScalar(const uint8_t *copy_src, uint8_t *copy_dst, unsigned int src_bytes_per_row)
--- source/HapPlatform.h 2020-11-09 15:34:06.000000000 -0500
+++ source/HapPlatform.h 2020-11-09 15:34:22.000000000 -0500
@@ -35,7 +35,7 @@
#else
#define HAP_INLINE inline
#endif
- #if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+ #if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 && __x86_64__
#define HAP_SSSE3_ALWAYS_AVAILABLE
#endif
#else