Cross-Platform build scripts for audio plugins
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

232 lines
6.7KB

  1. diff --git a/libaften/a52enc.c b/libaften/a52enc.c
  2. index 0d1dd65..a95ea0e 100644
  3. --- a/libaften/a52enc.c
  4. +++ b/libaften/a52enc.c
  5. @@ -309,19 +309,19 @@ static void
  6. select_mdct(A52Context *ctx)
  7. {
  8. #ifndef CONFIG_DOUBLE
  9. -#ifdef HAVE_SSE3
  10. +#if defined(HAVE_SSE3) && !defined(__aarch64__)
  11. if (cpu_caps_have_sse3()) {
  12. sse3_mdct_init(ctx);
  13. return;
  14. }
  15. #endif
  16. -#ifdef HAVE_SSE
  17. +#if defined(HAVE_SSE) && !defined(__aarch64__)
  18. if (cpu_caps_have_sse()) {
  19. sse_mdct_init(ctx);
  20. return;
  21. }
  22. #endif
  23. -#ifdef HAVE_ALTIVEC
  24. +#if defined(HAVE_ALTIVEC) && !defined(__aarch64__)
  25. if (cpu_caps_have_altivec()) {
  26. mdct_init_altivec(ctx);
  27. return;
  28. @@ -335,19 +335,19 @@ static void
  29. select_mdct_thread(A52ThreadContext *tctx)
  30. {
  31. #ifndef CONFIG_DOUBLE
  32. -#ifdef HAVE_SSE3
  33. +#if defined(HAVE_SSE3) && !defined(__aarch64__)
  34. if (cpu_caps_have_sse3()) {
  35. sse3_mdct_thread_init(tctx);
  36. return;
  37. }
  38. #endif
  39. -#ifdef HAVE_SSE
  40. +#if defined(HAVE_SSE) && !defined(__aarch64__)
  41. if (cpu_caps_have_sse()) {
  42. sse_mdct_thread_init(tctx);
  43. return;
  44. }
  45. #endif
  46. -#ifdef HAVE_ALTIVEC
  47. +#if defined(HAVE_ALTIVEC) && !defined(__aarch64__)
  48. if (cpu_caps_have_altivec()) {
  49. mdct_thread_init_altivec(tctx);
  50. return;
  51. diff --git a/libaften/exponent.c b/libaften/exponent.c
  52. index 137b930..956ad2e 100644
  53. --- a/libaften/exponent.c
  54. +++ b/libaften/exponent.c
  55. @@ -67,13 +67,13 @@ exponent_init(A52Context *ctx)
  56. }
  57. }
  58. -#ifdef HAVE_SSE2
  59. +#if defined(HAVE_SSE2) && !defined(__aarch64__)
  60. if (cpu_caps_have_sse2()) {
  61. ctx->process_exponents = sse2_process_exponents;
  62. return;
  63. }
  64. #endif /* HAVE_SSE2 */
  65. -#ifdef HAVE_MMX
  66. +#if defined(HAVE_MMX) && !defined(__aarch64__)
  67. if (cpu_caps_have_mmx()) {
  68. ctx->process_exponents = mmx_process_exponents;
  69. return;
  70. diff --git a/libaften/window.c b/libaften/window.c
  71. index f649b5f..f994a86 100644
  72. --- a/libaften/window.c
  73. +++ b/libaften/window.c
  74. @@ -78,7 +78,7 @@ kbd_window_init(A52Context *ctx, FLOAT alpha, FLOAT *window, int n, int iter)
  75. window[n-1-i] = window[i];
  76. }
  77. #ifndef CONFIG_DOUBLE
  78. -#ifdef HAVE_SSE
  79. +#if defined(HAVE_SSE) && !defined(__aarch64__)
  80. if (cpu_caps_have_sse()) {
  81. ctx->apply_a52_window = sse_apply_a52_window;
  82. return;
  83. diff --git a/libaften/x86/x86_cpu_caps.c b/libaften/x86/x86_cpu_caps.c
  84. index e5a50a8..07cb4fb 100644
  85. --- a/libaften/x86/x86_cpu_caps.c
  86. +++ b/libaften/x86/x86_cpu_caps.c
  87. @@ -37,7 +37,7 @@
  88. #define CYRIX_MMXEXT_BIT 24
  89. -#ifdef HAVE_CPU_CAPS_DETECTION
  90. +#if defined(HAVE_CPU_CAPS_DETECTION) && !defined(__aarch64__)
  91. #include "asm_support.h"
  92. // derived from loki_cpuinfo.c, 1997-98 by H. Dietz and R. Fisher
  93. @@ -122,7 +122,7 @@ void cpu_caps_detect(void)
  94. /* end compiled in SIMD routines */
  95. /* runtime detection */
  96. -#ifdef HAVE_CPU_CAPS_DETECTION
  97. +#if defined(HAVE_CPU_CAPS_DETECTION) && !defined(__aarch64__)
  98. {
  99. uint32_t caps1, caps2, caps3;
  100. diff --git a/libaften/x86/x86_mmx_exponent.c b/libaften/x86/x86_mmx_exponent.c
  101. index b9962f4..2ea545e 100644
  102. --- a/libaften/x86/x86_mmx_exponent.c
  103. +++ b/libaften/x86/x86_mmx_exponent.c
  104. @@ -27,6 +27,8 @@
  105. */
  106. #include "exponent_common.c"
  107. +
  108. +#ifndef __aarch64__
  109. #include "x86_simd_support.h"
  110. #include <mmintrin.h>
  111. @@ -366,3 +368,4 @@ mmx_process_exponents(A52ThreadContext *tctx)
  112. group_exponents(tctx);
  113. _mm_empty();
  114. }
  115. +#endif // !__aarch64__
  116. diff --git a/libaften/x86/x86_sse2_exponent.c b/libaften/x86/x86_sse2_exponent.c
  117. index 4abda29..32a41b5 100644
  118. --- a/libaften/x86/x86_sse2_exponent.c
  119. +++ b/libaften/x86/x86_sse2_exponent.c
  120. @@ -27,6 +27,8 @@
  121. */
  122. #include "exponent_common.c"
  123. +
  124. +#ifndef __aarch64__
  125. #include "x86_simd_support.h"
  126. #include <emmintrin.h>
  127. @@ -373,3 +375,4 @@ sse2_process_exponents(A52ThreadContext *tctx)
  128. group_exponents(tctx);
  129. }
  130. +#endif // !__aarch64__
  131. diff --git a/libaften/x86/x86_sse_mdct_common.c b/libaften/x86/x86_sse_mdct_common.c
  132. index 991edeb..e3287b0 100644
  133. --- a/libaften/x86/x86_sse_mdct_common.c
  134. +++ b/libaften/x86/x86_sse_mdct_common.c
  135. @@ -49,6 +49,7 @@
  136. #include "a52.h"
  137. #include "mdct.h"
  138. +#ifndef __aarch64__
  139. #include "x86_simd_support.h"
  140. @@ -683,3 +684,4 @@ mdct_256(A52ThreadContext *tctx, FLOAT *out, FLOAT *in)
  141. _mm_store_ps(out + j+4, XMM3);
  142. }
  143. }
  144. +#endif // !__aarch64__
  145. diff --git a/libaften/x86/x86_sse_mdct_common_init.c b/libaften/x86/x86_sse_mdct_common_init.c
  146. index 22bb058..4754a12 100644
  147. --- a/libaften/x86/x86_sse_mdct_common_init.c
  148. +++ b/libaften/x86/x86_sse_mdct_common_init.c
  149. @@ -49,6 +49,7 @@
  150. #include "a52.h"
  151. #include "mdct.h"
  152. +#ifndef __aarch64__
  153. #include "x86_simd_support.h"
  154. #include "x86_sse_mdct_common_init.h"
  155. @@ -408,3 +409,4 @@ sse_mdct_tctx_close(MDCTThreadContext *tmdct)
  156. if(tmdct->buffer1) aligned_free(tmdct->buffer1);
  157. }
  158. }
  159. +#endif // !__aarch64__
  160. diff --git a/libaften/x86/x86_sse_mdct_dummy.c b/libaften/x86/x86_sse_mdct_dummy.c
  161. index f95c5e4..3b95204 100644
  162. --- a/libaften/x86/x86_sse_mdct_dummy.c
  163. +++ b/libaften/x86/x86_sse_mdct_dummy.c
  164. @@ -20,6 +20,7 @@
  165. #include "x86_sse_mdct_common_init.h"
  166. #include "x86_sse_mdct_common.c"
  167. +#ifndef __aarch64__
  168. static void
  169. sse_mdct_close(A52Context *ctx)
  170. {
  171. @@ -65,3 +66,4 @@ sse_mdct_thread_init(A52ThreadContext *tctx)
  172. aligned_malloc(A52_NUM_BLOCKS * A52_MAX_CHANNELS * (256 + 512) * sizeof(FLOAT));
  173. alloc_block_buffers(tctx);
  174. }
  175. +#endif // !__aarch64__
  176. diff --git a/libaften/x86/x86_sse_window.c b/libaften/x86/x86_sse_window.c
  177. index b8c4ba2..9b323cb 100644
  178. --- a/libaften/x86/x86_sse_window.c
  179. +++ b/libaften/x86/x86_sse_window.c
  180. @@ -19,6 +19,7 @@
  181. *********************************************************************/
  182. #include "window.h"
  183. +#ifndef __aarch64__
  184. #include <xmmintrin.h>
  185. void
  186. @@ -33,3 +34,4 @@ sse_apply_a52_window(FLOAT *samples)
  187. _mm_store_ps(samples+i, input);
  188. }
  189. }
  190. +#endif // !__aarch64__
  191. diff --git a/CMakeLists.txt b/CMakeLists.txt
  192. index ba6f0f2..fc2fc45 100644
  193. --- a/CMakeLists.txt
  194. +++ b/CMakeLists.txt
  195. @@ -179,7 +179,7 @@ IF(SVN_VERSION)
  196. ENDIF(SVN_VERSION)
  197. # do SIMD stuff
  198. -IF(CMAKE_SYSTEM_MACHINE MATCHES "i.86" OR CMAKE_SYSTEM_MACHINE MATCHES "x86_64")
  199. +IF(CMAKE_SYSTEM_MACHINE MATCHES "i.86" OR CMAKE_SYSTEM_MACHINE MATCHES "x86_64" OR APPLE)
  200. CHECK_MMX()
  201. IF(HAVE_MMX)
  202. @@ -231,7 +231,7 @@ IF(CMAKE_SYSTEM_MACHINE MATCHES "i.86" OR CMAKE_SYSTEM_MACHINE MATCHES "x86_64")
  203. CHECK_CASTSI128()
  204. ENDIF(HAVE_SSE3)
  205. ENDIF(HAVE_MMX)
  206. -ENDIF(CMAKE_SYSTEM_MACHINE MATCHES "i.86" OR CMAKE_SYSTEM_MACHINE MATCHES "x86_64")
  207. +ENDIF(CMAKE_SYSTEM_MACHINE MATCHES "i.86" OR CMAKE_SYSTEM_MACHINE MATCHES "x86_64" OR APPLE)
  208. IF(CMAKE_SYSTEM_MACHINE MATCHES "Power Macintosh" OR CMAKE_SYSTEM_MACHINE MATCHES "ppc")
  209. CHECK_ALTIVEC()