mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-06-19 19:03:00 +02:00
configure: Simplify AltiVec/VSX check with a helper function
This commit is contained in:
@@ -4445,29 +4445,19 @@ elif enabled ppc; then
|
|||||||
check_cflags -maltivec -mabi=altivec
|
check_cflags -maltivec -mabi=altivec
|
||||||
|
|
||||||
# check if our compiler supports Motorola AltiVec C API
|
# check if our compiler supports Motorola AltiVec C API
|
||||||
check_cc <<EOF || disable altivec
|
check_code cc altivec.h "vector signed int v1 = (vector signed int) { 0 };
|
||||||
#include <altivec.h>
|
vector signed int v2 = (vector signed int) { 1 };
|
||||||
int main(void) {
|
v1 = vec_add(v1, v2);" ||
|
||||||
vector signed int v1 = (vector signed int) { 0 };
|
disable altivec
|
||||||
vector signed int v2 = (vector signed int) { 1 };
|
|
||||||
v1 = vec_add(v1, v2);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
|
enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if enabled vsx; then
|
if enabled vsx; then
|
||||||
check_cflags -mvsx &&
|
check_cflags -mvsx &&
|
||||||
check_cc <<EOF || disable vsx
|
check_code cc altivec.h "int v[4] = { 0 };
|
||||||
#include <altivec.h>
|
vector signed int v1 = vec_vsx_ld(0, v);" ||
|
||||||
int main(void) {
|
disable vsx
|
||||||
int v[4] = { 0 };
|
|
||||||
vector signed int v1 = vec_vsx_ld(0, v);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if enabled power8; then
|
if enabled power8; then
|
||||||
|
|||||||
Reference in New Issue
Block a user