comparison configure @ 32160:00dcf8f66ea2

Use inline_asm_check to simplify a bunch of configure checks.
author diego
date Tue, 14 Sep 2010 13:43:53 +0000
parents f74d42014f51
children 9b6e0f5a982f
comparison
equal deleted inserted replaced
32159:f74d42014f51 32160:00dcf8f66ea2
2628 fi #if x86_32 2628 fi #if x86_32
2629 2629
2630 echocheck ".align is a power of two" 2630 echocheck ".align is a power of two"
2631 if test "$_asmalign_pot" = auto ; then 2631 if test "$_asmalign_pot" = auto ; then
2632 _asmalign_pot=no 2632 _asmalign_pot=no
2633 cat > $TMPC << EOF 2633 inline_asm_check '".align 3"' && _asmalign_pot=yes
2634 int main(void) { __asm__ (".align 3"); return 0; }
2635 EOF
2636 cc_check && _asmalign_pot=yes
2637 fi 2634 fi
2638 if test "$_asmalign_pot" = "yes" ; then 2635 if test "$_asmalign_pot" = "yes" ; then
2639 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"' 2636 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"'
2640 else 2637 else
2641 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"' 2638 def_asmalign_pot='#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"'
2785 2782
2786 if ppc ; then 2783 if ppc ; then
2787 def_xform_asm='#define HAVE_XFORM_ASM 0' 2784 def_xform_asm='#define HAVE_XFORM_ASM 0'
2788 xform_asm=no 2785 xform_asm=no
2789 echocheck "XFORM ASM support" 2786 echocheck "XFORM ASM support"
2790 cat > $TMPC << EOF 2787 inline_asm_check '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' &&
2791 int main(void) { __asm__ volatile ("lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)); return 0; } 2788 xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2792 EOF
2793 cc_check && xform_asm=yes && def_xform_asm='#define HAVE_XFORM_ASM 1'
2794 echores "$xform_asm" 2789 echores "$xform_asm"
2795 2790
2796 def_ibm_asm='#define HAVE_IBM_ASM 0' 2791 def_ibm_asm='#define HAVE_IBM_ASM 0'
2797 ibm_asm=no 2792 ibm_asm=no
2798 echocheck "IBM ASM support" 2793 echocheck "IBM ASM support"
2799 cat > $TMPC << EOF 2794 inline_asm_check '"add 0, 0, 0"' &&
2800 int main(void) { __asm__ volatile ("add 0, 0, 0"); return 0; } 2795 ibm_asm=yes && def_ibm_asm='#define HAVE_IBM_ASM 1'
2801 EOF
2802 cc_check && ibm_asm=yes && def_ibm_asm='#define HAVE_IBM_ASM 1'
2803 echores "$ibm_asm" 2796 echores "$ibm_asm"
2804 2797
2805 def_gnu_as='#define HAVE_GNU_AS 0' 2798 def_gnu_as='#define HAVE_GNU_AS 0'
2806 gnu_as=no 2799 gnu_as=no
2807 echocheck "GNU assembler" 2800 echocheck "GNU assembler"
2808 cat > $TMPC << EOF 2801 inline_asm_check '".macro m n\n\\n:.int 0\n.endm\nm x"' &&
2809 int main(void) { __asm__ volatile (".macro m n\n\\n:.int 0\n.endm\nm x"); return 0; } 2802 gnu_as=yes && def_gnu_as='#define HAVE_GNU_AS 1'
2810 EOF
2811 cc_check && gnu_as=yes && def_gnu_as='#define HAVE_GNU_AS 1'
2812 echores "$gnu_as" 2803 echores "$gnu_as"
2813 2804
2814 fi 2805 fi
2815 2806
2816 if arm ; then 2807 if arm ; then
2817 echocheck "ARM pld instruction" 2808 echocheck "ARM pld instruction"
2818 cat > $TMPC << EOF
2819 int main(void) { __asm__ volatile ("pld [r0]"); return 0; }
2820 EOF
2821 pld=no 2809 pld=no
2822 cc_check && pld=yes 2810 inline_asm_check '"pld [r0]"' && pld=yes
2823 echores "$pld" 2811 echores "$pld"
2824 2812
2825 echocheck "ARMv5TE (Enhanced DSP Extensions)" 2813 echocheck "ARMv5TE (Enhanced DSP Extensions)"
2826 if test $_armv5te = "auto" ; then 2814 if test $_armv5te = "auto" ; then
2827 cat > $TMPC << EOF
2828 int main(void) { __asm__ volatile ("qadd r0, r0, r0"); return 0; }
2829 EOF
2830 _armv5te=no 2815 _armv5te=no
2831 cc_check && _armv5te=yes 2816 inline_asm_check '"qadd r0, r0, r0"' && _armv5te=yes
2832 fi 2817 fi
2833 echores "$_armv5te" 2818 echores "$_armv5te"
2834 2819
2835 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes 2820 test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes
2836 2821
2837 echocheck "ARMv6 (SIMD instructions)" 2822 echocheck "ARMv6 (SIMD instructions)"
2838 if test $_armv6 = "auto" ; then 2823 if test $_armv6 = "auto" ; then
2839 cat > $TMPC << EOF
2840 int main(void) { __asm__ volatile ("sadd16 r0, r0, r0"); return 0; }
2841 EOF
2842 _armv6=no 2824 _armv6=no
2843 cc_check && _armv6=yes 2825 inline_asm_check '"sadd16 r0, r0, r0"' && _armv6=yes
2844 fi 2826 fi
2845 echores "$_armv6" 2827 echores "$_armv6"
2846 2828
2847 echocheck "ARMv6t2 (SIMD instructions)" 2829 echocheck "ARMv6t2 (SIMD instructions)"
2848 if test $_armv6t2 = "auto" ; then 2830 if test $_armv6t2 = "auto" ; then
2849 cat > $TMPC << EOF
2850 int main(void) { __asm__ volatile ("movt r0, #0"); return 0; }
2851 EOF
2852 _armv6t2=no 2831 _armv6t2=no
2853 cc_check && _armv6t2=yes 2832 inline_asm_check '"movt r0, #0"' && _armv6t2=yes
2854 fi 2833 fi
2855 echores "$_armv6" 2834 echores "$_armv6"
2856 2835
2857 echocheck "ARM VFP" 2836 echocheck "ARM VFP"
2858 if test $_armvfp = "auto" ; then 2837 if test $_armvfp = "auto" ; then
2859 cat > $TMPC << EOF
2860 int main(void) { __asm__ volatile ("fadds s0, s0, s0"); return 0; }
2861 EOF
2862 _armvfp=no 2838 _armvfp=no
2863 cc_check && _armvfp=yes 2839 inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
2864 fi 2840 fi
2865 echores "$_armvfp" 2841 echores "$_armvfp"
2866 2842
2867 echocheck "ARM NEON" 2843 echocheck "ARM NEON"
2868 if test $neon = "auto" ; then 2844 if test $neon = "auto" ; then
2869 cat > $TMPC << EOF
2870 int main(void) { __asm__ volatile ("vadd.i16 q0, q0, q0"); return 0; }
2871 EOF
2872 neon=no 2845 neon=no
2873 cc_check && neon=yes 2846 inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
2874 fi 2847 fi
2875 echores "$neon" 2848 echores "$neon"
2876 2849
2877 echocheck "iWMMXt (Intel XScale SIMD instructions)" 2850 echocheck "iWMMXt (Intel XScale SIMD instructions)"
2878 if test $_iwmmxt = "auto" ; then 2851 if test $_iwmmxt = "auto" ; then
2879 cat > $TMPC << EOF
2880 int main(void) { __asm__ volatile ("wunpckelub wr6, wr4"); return 0; }
2881 EOF
2882 _iwmmxt=no 2852 _iwmmxt=no
2883 cc_check && _iwmmxt=yes 2853 inline_asm_check '"wunpckelub wr6, wr4"' && _iwmmxt=yes
2884 fi 2854 fi
2885 echores "$_iwmmxt" 2855 echores "$_iwmmxt"
2886 fi 2856 fi
2887 2857
2888 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI' 2858 cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI'