# HG changeset patch # User pacman # Date 1141169078 0 # Node ID 485f04e5a58c8171cf79b4c3cdf5efaee061698b # Parent ed66aa736773e0f420d32711b960eef8e7a79da4 add Amiga-style AltiVec detection, patch from andrea at amigasoft dot net diff -r ed66aa736773 -r 485f04e5a58c cpudetect.c --- a/cpudetect.c Tue Feb 28 21:54:24 2006 +0000 +++ b/cpudetect.c Tue Feb 28 23:24:38 2006 +0000 @@ -33,6 +33,10 @@ #include #endif +#ifdef __AMIGAOS4__ +#include +#endif + //#define X86_FXSR_MAGIC /* Thanks to the FreeBSD project for some of this cpuid code, and * help understanding how to use it. Thanks to the Mesa @@ -468,6 +472,7 @@ #ifdef SYS_DARWIN #include #else +#ifndef __AMIGAOS4__ #include #include @@ -484,6 +489,7 @@ canjump = 0; siglongjmp (jmpbuf, 1); } +#endif //__AMIGAOS4__ #endif void GetCpuCaps( CpuCaps *caps) @@ -517,6 +523,13 @@ caps->hasAltiVec = 1; } #else /* SYS_DARWIN */ +#ifdef __AMIGAOS4__ + ULONG result = 0; + + GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE); + if (result == VECTORTYPE_ALTIVEC) + caps->hasAltiVec = 1; +#else /* no Darwin, do it the brute-force way */ /* this is borrowed from the libmpeg2 library */ { @@ -535,6 +548,7 @@ caps->hasAltiVec = 1; } } +#endif //__AMIGAOS4__ #endif /* SYS_DARWIN */ mp_msg(MSGT_CPUDETECT,MSGL_INFO,"AltiVec %sfound\n", (caps->hasAltiVec ? "" : "not ")); #endif /* HAVE_ALTIVEC */