diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-09-08 10:02:40 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-09-08 10:02:40 +0000 |
commit | ccf22d3ed181a14019d0c2f02f2ce30ac8e23ef5 (patch) | |
tree | 02f9099d3a8ab792a8d69167eb8c23a5e8d6a4cc /libavcodec/ppc/check_altivec.c | |
parent | 83f72f138e64b596dce1b543d6af3cf66d300e90 (diff) | |
download | ffmpeg-ccf22d3ed181a14019d0c2f02f2ce30ac8e23ef5.tar.gz |
Merge has_altivec() function into mm_support(), remove it and use
mm_support() instead.
Reduce complexity and simplify pending move to libavutil.
Originally committed as revision 25074 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ppc/check_altivec.c')
-rw-r--r-- | libavcodec/ppc/check_altivec.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libavcodec/ppc/check_altivec.c b/libavcodec/ppc/check_altivec.c index 6b9332ce3a..95ca742668 100644 --- a/libavcodec/ppc/check_altivec.c +++ b/libavcodec/ppc/check_altivec.c @@ -43,14 +43,16 @@ * is present. */ -int has_altivec(void) +int mm_support(void) { +#if HAVE_ALTIVEC #ifdef __AMIGAOS4__ ULONG result = 0; extern struct ExecIFace *IExec; IExec->GetCPUInfoTags(GCIT_VectorUnit, &result, TAG_DONE); - if (result == VECTORTYPE_ALTIVEC) return 1; + if (result == VECTORTYPE_ALTIVEC) + return AV_CPU_FLAG_ALTIVEC; return 0; #elif defined(__APPLE__) || defined(__OpenBSD__) #ifdef __OpenBSD__ @@ -64,7 +66,8 @@ int has_altivec(void) err = sysctl(sels, 2, &has_vu, &len, NULL, 0); - if (err == 0) return has_vu != 0; + if (err == 0) + return has_vu ? AV_CPU_FLAG_ALTIVEC : 0; return 0; #elif CONFIG_RUNTIME_CPUDETECT int proc_ver; @@ -76,12 +79,14 @@ int has_altivec(void) proc_ver == 0x0039 || proc_ver == 0x003c || proc_ver == 0x0044 || proc_ver == 0x0045 || proc_ver == 0x0070) - return 1; + return AV_CPU_FLAG_ALTIVEC; return 0; #else // Since we were compiled for AltiVec, just assume we have it // until someone comes up with a proper way (not involving signal hacks). - return 1; + return AV_CPU_FLAG_ALTIVEC; #endif /* __AMIGAOS4__ */ +#endif /* HAVE_ALTIVEC */ + return 0; } |