mirror of
https://github.com/mpv-player/mpv
synced 2025-04-01 23:00:41 +00:00
add Amiga-style AltiVec detection, patch from andrea at amigasoft dot net
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17703 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
ffdf7260bb
commit
e4ecd258d5
14
cpudetect.c
14
cpudetect.c
@ -33,6 +33,10 @@ CpuCaps gCpuCaps;
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __AMIGAOS4__
|
||||||
|
#include <proto/exec.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
//#define X86_FXSR_MAGIC
|
//#define X86_FXSR_MAGIC
|
||||||
/* Thanks to the FreeBSD project for some of this cpuid code, and
|
/* Thanks to the FreeBSD project for some of this cpuid code, and
|
||||||
* help understanding how to use it. Thanks to the Mesa
|
* help understanding how to use it. Thanks to the Mesa
|
||||||
@ -468,6 +472,7 @@ static void check_os_katmai_support( void )
|
|||||||
#ifdef SYS_DARWIN
|
#ifdef SYS_DARWIN
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#else
|
#else
|
||||||
|
#ifndef __AMIGAOS4__
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
|
|
||||||
@ -484,6 +489,7 @@ static void sigill_handler (int sig)
|
|||||||
canjump = 0;
|
canjump = 0;
|
||||||
siglongjmp (jmpbuf, 1);
|
siglongjmp (jmpbuf, 1);
|
||||||
}
|
}
|
||||||
|
#endif //__AMIGAOS4__
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void GetCpuCaps( CpuCaps *caps)
|
void GetCpuCaps( CpuCaps *caps)
|
||||||
@ -517,6 +523,13 @@ void GetCpuCaps( CpuCaps *caps)
|
|||||||
caps->hasAltiVec = 1;
|
caps->hasAltiVec = 1;
|
||||||
}
|
}
|
||||||
#else /* SYS_DARWIN */
|
#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 */
|
/* no Darwin, do it the brute-force way */
|
||||||
/* this is borrowed from the libmpeg2 library */
|
/* this is borrowed from the libmpeg2 library */
|
||||||
{
|
{
|
||||||
@ -535,6 +548,7 @@ void GetCpuCaps( CpuCaps *caps)
|
|||||||
caps->hasAltiVec = 1;
|
caps->hasAltiVec = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif //__AMIGAOS4__
|
||||||
#endif /* SYS_DARWIN */
|
#endif /* SYS_DARWIN */
|
||||||
mp_msg(MSGT_CPUDETECT,MSGL_INFO,"AltiVec %sfound\n", (caps->hasAltiVec ? "" : "not "));
|
mp_msg(MSGT_CPUDETECT,MSGL_INFO,"AltiVec %sfound\n", (caps->hasAltiVec ? "" : "not "));
|
||||||
#endif /* HAVE_ALTIVEC */
|
#endif /* HAVE_ALTIVEC */
|
||||||
|
Loading…
Reference in New Issue
Block a user