Originally committed as revision 19485 to svn://svn.ffmpeg.org/ffmpeg/trunk
Måns Rullgård authored on 2009/07/23 01:05:24... | ... |
@@ -1996,7 +1996,55 @@ check_cc <<EOF && enable inline_asm |
1996 | 1996 |
void foo(void) { __asm__ volatile ("" ::); } |
1997 | 1997 |
EOF |
1998 | 1998 |
|
1999 |
-if enabled x86; then |
|
1999 |
+if enabled arm; then |
|
2000 |
+ check_ld <<EOF && enable vfp_args |
|
2001 |
+__asm__ (".eabi_attribute 28, 1"); |
|
2002 |
+int main(void) { return 0; } |
|
2003 |
+EOF |
|
2004 |
+ |
|
2005 |
+ # We have to check if pld is a nop and disable it. |
|
2006 |
+ check_asm pld '"pld [r0]"' |
|
2007 |
+ |
|
2008 |
+ enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"' |
|
2009 |
+ enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"' |
|
2010 |
+ enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"' |
|
2011 |
+ enabled armvfp && check_asm armvfp '"fadds s0, s0, s0"' |
|
2012 |
+ enabled iwmmxt && check_asm iwmmxt '"wunpckelub wr6, wr4"' |
|
2013 |
+ enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"' |
|
2014 |
+elif enabled mips; then |
|
2015 |
+ check_asm loongson '"dmult.g $1, $2, $3"' |
|
2016 |
+ enabled mmi && check_asm mmi '"lq $2, 0($2)"' |
|
2017 |
+elif enabled ppc; then |
|
2018 |
+ check_asm dcbzl '"dcbzl 0, 1"' |
|
2019 |
+ check_asm ppc4xx '"maclhw r10, r11, r12"' |
|
2020 |
+ check_asm xform_asm '"lwzx 0, %y0" :: "Z"(*(int*)0)' |
|
2021 |
+ |
|
2022 |
+ # AltiVec flags: The FSF version of GCC differs from the Apple version |
|
2023 |
+ if enabled altivec; then |
|
2024 |
+ check_cflags -maltivec -mabi=altivec && |
|
2025 |
+ { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } || |
|
2026 |
+ check_cflags -faltivec |
|
2027 |
+ |
|
2028 |
+ # check if our compiler supports Motorola AltiVec C API |
|
2029 |
+ check_cc <<EOF || disable altivec |
|
2030 |
+$inc_altivec_h |
|
2031 |
+int main(void) { |
|
2032 |
+ vector signed int v1, v2, v3; |
|
2033 |
+ v1 = vec_add(v2,v3); |
|
2034 |
+ return 0; |
|
2035 |
+} |
|
2036 |
+EOF |
|
2037 |
+ |
|
2038 |
+ # check if our compiler supports braces for vector declarations |
|
2039 |
+ check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations." |
|
2040 |
+$inc_altivec_h |
|
2041 |
+int main (void) { (vector int) {1}; return 0; } |
|
2042 |
+EOF |
|
2043 |
+ fi |
|
2044 |
+elif enabled sparc; then |
|
2045 |
+ enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc && |
|
2046 |
+ add_cflags -mcpu=ultrasparc -mtune=ultrasparc |
|
2047 |
+elif enabled x86; then |
|
2000 | 2048 |
# check whether EBP is available on x86 |
2001 | 2049 |
# As 'i' is stored on the stack, this program will crash |
2002 | 2050 |
# if the base pointer is used to access it because the |
... | ... |
@@ -2041,57 +2089,6 @@ EOF |
2041 | 2041 |
disabled yasm || { check_yasm "pabsw xmm0, xmm0" && enable yasm; } |
2042 | 2042 |
fi |
2043 | 2043 |
|
2044 |
-# check for assembler specific support |
|
2045 |
- |
|
2046 |
-enabled arm && check_ld <<EOF && enable vfp_args |
|
2047 |
-__asm__ (".eabi_attribute 28, 1"); |
|
2048 |
-int main(void) { return 0; } |
|
2049 |
-EOF |
|
2050 |
- |
|
2051 |
-enabled mips && check_asm loongson '"dmult.g $1, $2, $3"' |
|
2052 |
- |
|
2053 |
-enabled ppc && check_asm dcbzl '"dcbzl 0, 1"' |
|
2054 |
-enabled ppc && check_asm ppc4xx '"maclhw r10, r11, r12"' |
|
2055 |
-enabled ppc && check_asm xform_asm '"lwzx 0, %y0" :: "Z"(*(int*)0)' |
|
2056 |
- |
|
2057 |
-# check for SIMD availability |
|
2058 |
- |
|
2059 |
-# AltiVec flags: The FSF version of GCC differs from the Apple version |
|
2060 |
-if enabled altivec; then |
|
2061 |
- check_cflags -maltivec -mabi=altivec && |
|
2062 |
- { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } || |
|
2063 |
- check_cflags -faltivec |
|
2064 |
- |
|
2065 |
- # check if our compiler supports Motorola AltiVec C API |
|
2066 |
- check_cc <<EOF || disable altivec |
|
2067 |
-$inc_altivec_h |
|
2068 |
-int main(void) { |
|
2069 |
- vector signed int v1, v2, v3; |
|
2070 |
- v1 = vec_add(v2,v3); |
|
2071 |
- return 0; |
|
2072 |
-} |
|
2073 |
-EOF |
|
2074 |
- |
|
2075 |
- # check if our compiler supports braces for vector declarations |
|
2076 |
- check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations." |
|
2077 |
-$inc_altivec_h |
|
2078 |
-int main (void) { (vector int) {1}; return 0; } |
|
2079 |
-EOF |
|
2080 |
-fi |
|
2081 |
- |
|
2082 |
-# We have to check if pld is a nop and disable it. |
|
2083 |
-enabled arm && check_asm pld '"pld [r0]"' |
|
2084 |
-enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"' |
|
2085 |
-enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"' |
|
2086 |
-enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"' |
|
2087 |
-enabled armvfp && check_asm armvfp '"fadds s0, s0, s0"' |
|
2088 |
-enabled iwmmxt && check_asm iwmmxt '"wunpckelub wr6, wr4"' |
|
2089 |
-enabled mmi && check_asm mmi '"lq $2, 0($2)"' |
|
2090 |
-enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"' |
|
2091 |
-enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc |
|
2092 |
- |
|
2093 |
-enabled vis && add_cflags -mcpu=ultrasparc -mtune=ultrasparc |
|
2094 |
- |
|
2095 | 2044 |
check_cc <<EOF || die "endian test failed" |
2096 | 2045 |
unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E'; |
2097 | 2046 |
EOF |