diff options
author | Måns Rullgård <mans@mansr.com> | 2009-07-22 16:05:24 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2009-07-22 16:05:24 +0000 |
commit | fa0912fe50e59df72b7bf81f8838d2c6d9780343 (patch) | |
tree | 9690d15c65887d405ce9e76448fde01f8a2867c0 | |
parent | b06da1725adb661f59ee91ad35591e5d250c3374 (diff) | |
download | ffmpeg-fa0912fe50e59df72b7bf81f8838d2c6d9780343.tar.gz |
configure: group all cpu-specific tests together
Originally committed as revision 19485 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rwxr-xr-x | configure | 101 |
1 files changed, 49 insertions, 52 deletions
@@ -1996,7 +1996,55 @@ check_cc <<EOF && enable inline_asm void foo(void) { __asm__ volatile ("" ::); } EOF -if enabled x86; then +if enabled arm; then + check_ld <<EOF && enable vfp_args +__asm__ (".eabi_attribute 28, 1"); +int main(void) { return 0; } +EOF + + # We have to check if pld is a nop and disable it. + check_asm pld '"pld [r0]"' + + enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"' + enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"' + enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"' + enabled armvfp && check_asm armvfp '"fadds s0, s0, s0"' + enabled iwmmxt && check_asm iwmmxt '"wunpckelub wr6, wr4"' + enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"' +elif enabled mips; then + check_asm loongson '"dmult.g $1, $2, $3"' + enabled mmi && check_asm mmi '"lq $2, 0($2)"' +elif enabled ppc; then + check_asm dcbzl '"dcbzl 0, 1"' + check_asm ppc4xx '"maclhw r10, r11, r12"' + check_asm xform_asm '"lwzx 0, %y0" :: "Z"(*(int*)0)' + + # AltiVec flags: The FSF version of GCC differs from the Apple version + if enabled altivec; then + check_cflags -maltivec -mabi=altivec && + { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } || + check_cflags -faltivec + + # check if our compiler supports Motorola AltiVec C API + check_cc <<EOF || disable altivec +$inc_altivec_h +int main(void) { + vector signed int v1, v2, v3; + v1 = vec_add(v2,v3); + return 0; +} +EOF + + # check if our compiler supports braces for vector declarations + check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations." +$inc_altivec_h +int main (void) { (vector int) {1}; return 0; } +EOF + fi +elif enabled sparc; then + enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc && + add_cflags -mcpu=ultrasparc -mtune=ultrasparc +elif enabled x86; then # check whether EBP is available on x86 # As 'i' is stored on the stack, this program will crash # if the base pointer is used to access it because the @@ -2041,57 +2089,6 @@ EOF disabled yasm || { check_yasm "pabsw xmm0, xmm0" && enable yasm; } fi -# check for assembler specific support - -enabled arm && check_ld <<EOF && enable vfp_args -__asm__ (".eabi_attribute 28, 1"); -int main(void) { return 0; } -EOF - -enabled mips && check_asm loongson '"dmult.g $1, $2, $3"' - -enabled ppc && check_asm dcbzl '"dcbzl 0, 1"' -enabled ppc && check_asm ppc4xx '"maclhw r10, r11, r12"' -enabled ppc && check_asm xform_asm '"lwzx 0, %y0" :: "Z"(*(int*)0)' - -# check for SIMD availability - -# AltiVec flags: The FSF version of GCC differs from the Apple version -if enabled altivec; then - check_cflags -maltivec -mabi=altivec && - { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } || - check_cflags -faltivec - - # check if our compiler supports Motorola AltiVec C API - check_cc <<EOF || disable altivec -$inc_altivec_h -int main(void) { - vector signed int v1, v2, v3; - v1 = vec_add(v2,v3); - return 0; -} -EOF - - # check if our compiler supports braces for vector declarations - check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations." -$inc_altivec_h -int main (void) { (vector int) {1}; return 0; } -EOF -fi - -# We have to check if pld is a nop and disable it. -enabled arm && check_asm pld '"pld [r0]"' -enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"' -enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"' -enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"' -enabled armvfp && check_asm armvfp '"fadds s0, s0, s0"' -enabled iwmmxt && check_asm iwmmxt '"wunpckelub wr6, wr4"' -enabled mmi && check_asm mmi '"lq $2, 0($2)"' -enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"' -enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc - -enabled vis && add_cflags -mcpu=ultrasparc -mtune=ultrasparc - check_cc <<EOF || die "endian test failed" unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E'; EOF |