43 |
#endif |
#endif |
44 |
#endif |
#endif |
45 |
|
|
46 |
|
#if defined(__amigaos4__) |
47 |
|
#include <exec/exec.h> |
48 |
|
#include <proto/exec.h> |
49 |
|
#endif |
50 |
|
|
51 |
#include "xvid.h" |
#include "xvid.h" |
52 |
#include "decoder.h" |
#include "decoder.h" |
53 |
#include "encoder.h" |
#include "encoder.h" |
74 |
|
|
75 |
#if (defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)) && defined(_MSC_VER) |
#if (defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)) && defined(_MSC_VER) |
76 |
# include <windows.h> |
# include <windows.h> |
77 |
#elif defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64) || defined(ARCH_IS_PPC) |
#elif defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64) || (defined(ARCH_IS_PPC) && !defined(__amigaos4__)) |
78 |
# include <signal.h> |
# include <signal.h> |
79 |
# include <setjmp.h> |
# include <setjmp.h> |
80 |
|
|
87 |
} |
} |
88 |
#endif |
#endif |
89 |
|
|
|
|
|
90 |
/* |
/* |
91 |
* Calls the funcptr, and returns whether SIGILL (illegal instruction) was |
* Calls the funcptr, and returns whether SIGILL (illegal instruction) was |
92 |
* signalled |
* signalled |
109 |
} |
} |
110 |
return(0); |
return(0); |
111 |
} |
} |
112 |
#elif defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64) || defined(ARCH_IS_PPC) |
#elif defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64) || (defined(ARCH_IS_PPC) && !defined(__amigaos4__)) |
113 |
static int |
static int |
114 |
sigill_check(void (*func)()) |
sigill_check(void (*func)()) |
115 |
{ |
{ |
161 |
#endif |
#endif |
162 |
|
|
163 |
#if defined(ARCH_IS_PPC) |
#if defined(ARCH_IS_PPC) |
164 |
|
#if defined(__amigaos4__) |
165 |
|
{ |
166 |
|
uint32_t vector_unit = VECTORTYPE_NONE; |
167 |
|
IExec->GetCPUInfoTags(GCIT_VectorUnit, &vector_unit, TAG_END); |
168 |
|
if (vector_unit == VECTORTYPE_ALTIVEC) { |
169 |
|
cpu_flags |= XVID_CPU_ALTIVEC; |
170 |
|
} |
171 |
|
} |
172 |
|
#else |
173 |
if (!sigill_check(altivec_trigger)) |
if (!sigill_check(altivec_trigger)) |
174 |
cpu_flags |= XVID_CPU_ALTIVEC; |
cpu_flags |= XVID_CPU_ALTIVEC; |
175 |
#endif |
#endif |
176 |
|
#endif |
177 |
|
|
178 |
return cpu_flags; |
return cpu_flags; |
179 |
} |
} |
721 |
info -> num_threads = 1; |
info -> num_threads = 1; |
722 |
} |
} |
723 |
|
|
724 |
|
#elif defined(__amigaos4__) |
725 |
|
|
726 |
|
{ |
727 |
|
uint32_t num_threads = 1; |
728 |
|
IExec->GetCPUInfoTags(GCIT_NumberOfCPUs, &num_threads, TAG_END); |
729 |
|
info->num_threads = num_threads; |
730 |
|
} |
731 |
|
|
732 |
#endif |
#endif |
733 |
|
|
734 |
return 0; |
return 0; |