OLD | NEW |
1 # Copyright (C) 1999, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009 | 1 # Copyright (C) 1999, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 |
2 # Free Software Foundation, Inc. | 2 # Free Software Foundation, Inc. |
3 | 3 |
4 # This program is free software; you can redistribute it and/or modify | 4 # This program is free software; you can redistribute it and/or modify |
5 # it under the terms of the GNU General Public License as published by | 5 # it under the terms of the GNU General Public License as published by |
6 # the Free Software Foundation; either version 3 of the License, or | 6 # the Free Software Foundation; either version 3 of the License, or |
7 # (at your option) any later version. | 7 # (at your option) any later version. |
8 # | 8 # |
9 # This program is distributed in the hope that it will be useful, | 9 # This program is distributed in the hope that it will be useful, |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
(...skipping 10 matching lines...) Expand all Loading... |
22 | 22 |
23 # Try to compile the code given by CONTENTS into an output file of | 23 # Try to compile the code given by CONTENTS into an output file of |
24 # type TYPE, where TYPE is as for target_compile. Return a list | 24 # type TYPE, where TYPE is as for target_compile. Return a list |
25 # whose first element contains the compiler messages and whose | 25 # whose first element contains the compiler messages and whose |
26 # second element is the name of the output file. | 26 # second element is the name of the output file. |
27 # | 27 # |
28 # BASENAME is a prefix to use for source and output files. | 28 # BASENAME is a prefix to use for source and output files. |
29 # If ARGS is not empty, its first element is a string that | 29 # If ARGS is not empty, its first element is a string that |
30 # should be added to the command line. | 30 # should be added to the command line. |
31 # | 31 # |
32 # Assume by default that CONTENTS is C code. C++ code should contain | 32 # Assume by default that CONTENTS is C code. |
33 # "// C++" and Fortran code should contain "! Fortran". | 33 # Otherwise, code should contain: |
| 34 # "// C++" for c++, |
| 35 # "! Fortran" for Fortran code, |
| 36 # "/* ObjC", for ObjC |
| 37 # and "// ObjC++" for ObjC++ |
| 38 # If the tool is ObjC/ObjC++ then we overide the extension to .m/.mm to |
| 39 # allow for ObjC/ObjC++ specific flags. |
34 proc check_compile {basename type contents args} { | 40 proc check_compile {basename type contents args} { |
35 global tool | 41 global tool |
| 42 verbose "check_compile tool: $tool for $basename" |
36 | 43 |
37 if { [llength $args] > 0 } { | 44 if { [llength $args] > 0 } { |
38 set options [list "additional_flags=[lindex $args 0]"] | 45 set options [list "additional_flags=[lindex $args 0]"] |
39 } else { | 46 } else { |
40 set options "" | 47 set options "" |
41 } | 48 } |
42 switch -glob -- $contents { | 49 switch -glob -- $contents { |
43 "*! Fortran*" { set src ${basename}[pid].f90 } | 50 "*! Fortran*" { set src ${basename}[pid].f90 } |
44 "*// C++*" { set src ${basename}[pid].cc } | 51 "*// C++*" { set src ${basename}[pid].cc } |
45 » default { set src ${basename}[pid].c } | 52 » "*// ObjC++*" { set src ${basename}[pid].mm } |
| 53 » "*/* ObjC*" { set src ${basename}[pid].m } |
| 54 » default { |
| 55 » switch -- $tool { |
| 56 » » "objc" { set src ${basename}[pid].m } |
| 57 » » "obj-c++" { set src ${basename}[pid].mm } |
| 58 » » default { set src ${basename}[pid].c } |
| 59 » } |
| 60 » } |
46 } | 61 } |
| 62 |
47 set compile_type $type | 63 set compile_type $type |
48 switch -glob $type { | 64 switch -glob $type { |
49 assembly { set output ${basename}[pid].s } | 65 assembly { set output ${basename}[pid].s } |
50 object { set output ${basename}[pid].o } | 66 object { set output ${basename}[pid].o } |
51 executable { set output ${basename}[pid].exe } | 67 executable { set output ${basename}[pid].exe } |
52 "rtl-*" { | 68 "rtl-*" { |
53 set output ${basename}[pid].s | 69 set output ${basename}[pid].s |
54 lappend options "additional_flags=-fdump-$type" | 70 lappend options "additional_flags=-fdump-$type" |
55 set compile_type assembly | 71 set compile_type assembly |
56 } | 72 } |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 # VxWorks kernel modules are relocatable objects linked with -r, | 394 # VxWorks kernel modules are relocatable objects linked with -r, |
379 # while RTP executables are linked with -q (--emit-relocs). | 395 # while RTP executables are linked with -q (--emit-relocs). |
380 # Both of these options are incompatible with --gc-sections. | 396 # Both of these options are incompatible with --gc-sections. |
381 if { [istarget *-*-vxworks*] } { | 397 if { [istarget *-*-vxworks*] } { |
382 set gc_sections_available_saved 0 | 398 set gc_sections_available_saved 0 |
383 return 0 | 399 return 0 |
384 } | 400 } |
385 | 401 |
386 # Check if the ld used by gcc supports --gc-sections. | 402 # Check if the ld used by gcc supports --gc-sections. |
387 set gcc_spec [${tool}_target_compile "-dumpspecs" "" "none" ""] | 403 set gcc_spec [${tool}_target_compile "-dumpspecs" "" "none" ""] |
388 » regsub ".*\n\*linker:\[ \t\]*\n(\[^ \t\n\]*).*" "$gcc_spec" {\1} linker | 404 » regsub ".*\n\\*linker:\[ \t\]*\n(\[^ \t\n\]*).*" "$gcc_spec" {\1} linker |
389 set gcc_ld [lindex [${tool}_target_compile "-print-prog-name=$linker" ""
"none" ""] 0] | 405 set gcc_ld [lindex [${tool}_target_compile "-print-prog-name=$linker" ""
"none" ""] 0] |
390 set ld_output [remote_exec host "$gcc_ld" "--help"] | 406 set ld_output [remote_exec host "$gcc_ld" "--help"] |
391 if { [ string first "--gc-sections" $ld_output ] >= 0 } { | 407 if { [ string first "--gc-sections" $ld_output ] >= 0 } { |
392 set gc_sections_available_saved 1 | 408 set gc_sections_available_saved 1 |
393 } else { | 409 } else { |
394 set gc_sections_available_saved 0 | 410 set gc_sections_available_saved 0 |
395 } | 411 } |
396 } | 412 } |
397 return $gc_sections_available_saved | 413 return $gc_sections_available_saved |
398 } | 414 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 # missing other needed machinery. | 500 # missing other needed machinery. |
485 if { [istarget mmix-*-*] | 501 if { [istarget mmix-*-*] |
486 || [istarget arm*-*-eabi*] | 502 || [istarget arm*-*-eabi*] |
487 || [istarget picochip-*-*] | 503 || [istarget picochip-*-*] |
488 || [istarget *-*-netware*] | 504 || [istarget *-*-netware*] |
489 || [istarget arm*-*-elf] | 505 || [istarget arm*-*-elf] |
490 || [istarget arm*-*-symbianelf*] | 506 || [istarget arm*-*-symbianelf*] |
491 || [istarget avr-*-*] | 507 || [istarget avr-*-*] |
492 || [istarget bfin-*-*] | 508 || [istarget bfin-*-*] |
493 || [istarget powerpc-*-eabi*] | 509 || [istarget powerpc-*-eabi*] |
| 510 || [istarget powerpc-*-elf] |
494 || [istarget cris-*-*] | 511 || [istarget cris-*-*] |
495 || [istarget crisv32-*-*] | 512 || [istarget crisv32-*-*] |
496 || [istarget fido-*-elf] | 513 || [istarget fido-*-elf] |
497 || [istarget h8300-*-*] | 514 || [istarget h8300-*-*] |
498 » || [istarget m32c-*-elf] | 515 || [istarget lm32-*-*] |
| 516 || [istarget m32c-*-elf] |
499 || [istarget m68k-*-elf] | 517 || [istarget m68k-*-elf] |
500 || [istarget m68k-*-uclinux*] | 518 || [istarget m68k-*-uclinux*] |
| 519 || [istarget mep-*-elf] |
501 || [istarget mips*-*-elf*] | 520 || [istarget mips*-*-elf*] |
| 521 || [istarget moxie-*-elf*] |
| 522 || [istarget rx-*-*] |
502 || [istarget xstormy16-*] | 523 || [istarget xstormy16-*] |
503 || [istarget xtensa*-*-elf] | 524 || [istarget xtensa*-*-elf] |
504 || [istarget *-*-rtems*] | 525 || [istarget *-*-rtems*] |
505 || [istarget *-*-vxworks*] } { | 526 || [istarget *-*-vxworks*] } { |
506 set profiling_available_saved 0 | 527 set profiling_available_saved 0 |
507 } else { | 528 } else { |
508 set profiling_available_saved 1 | 529 set profiling_available_saved 1 |
509 } | 530 } |
510 } | 531 } |
511 | 532 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 | 625 |
605 # Return 1 if compilation with -pthread is error-free for trivial | 626 # Return 1 if compilation with -pthread is error-free for trivial |
606 # code, 0 otherwise. | 627 # code, 0 otherwise. |
607 | 628 |
608 proc check_effective_target_pthread {} { | 629 proc check_effective_target_pthread {} { |
609 return [check_no_compiler_messages pthread object { | 630 return [check_no_compiler_messages pthread object { |
610 void foo (void) { } | 631 void foo (void) { } |
611 } "-pthread"] | 632 } "-pthread"] |
612 } | 633 } |
613 | 634 |
| 635 # Return 1 if compilation with -mpe-aligned-commons is error-free |
| 636 # for trivial code, 0 otherwise. |
| 637 |
| 638 proc check_effective_target_pe_aligned_commons {} { |
| 639 if { [istarget *-*-cygwin*] || [istarget *-*-mingw*] } { |
| 640 return [check_no_compiler_messages pe_aligned_commons object { |
| 641 int foo; |
| 642 } "-mpe-aligned-commons"] |
| 643 } |
| 644 return 0 |
| 645 } |
| 646 |
614 # Return 1 if the target supports -static | 647 # Return 1 if the target supports -static |
615 proc check_effective_target_static {} { | 648 proc check_effective_target_static {} { |
616 return [check_no_compiler_messages static executable { | 649 return [check_no_compiler_messages static executable { |
617 int main (void) { return 0; } | 650 int main (void) { return 0; } |
618 } "-static"] | 651 } "-static"] |
619 } | 652 } |
620 | 653 |
621 # Return 1 if the target supports -fstack-protector | 654 # Return 1 if the target supports -fstack-protector |
622 proc check_effective_target_fstack_protector {} { | 655 proc check_effective_target_fstack_protector {} { |
623 return [check_runtime fstack_protector { | 656 return [check_runtime fstack_protector { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 | 698 |
666 proc check_effective_target_hard_float { } { | 699 proc check_effective_target_hard_float { } { |
667 if { [istarget mips*-*-*] } { | 700 if { [istarget mips*-*-*] } { |
668 return [check_no_compiler_messages hard_float assembly { | 701 return [check_no_compiler_messages hard_float assembly { |
669 #if (defined __mips_soft_float || defined __mips16) | 702 #if (defined __mips_soft_float || defined __mips16) |
670 #error FOO | 703 #error FOO |
671 #endif | 704 #endif |
672 }] | 705 }] |
673 } | 706 } |
674 | 707 |
| 708 # This proc is actually checking the availabilty of FPU |
| 709 # support for doubles, so on the RX we must fail if the |
| 710 # 64-bit double multilib has been selected. |
| 711 if { [istarget rx-*-*] } { |
| 712 return 0 |
| 713 # return [check_no_compiler_messages hard_float assembly { |
| 714 #if defined __RX_64_BIT_DOUBLES__ |
| 715 #error FOO |
| 716 #endif |
| 717 # }] |
| 718 } |
| 719 |
675 # The generic test equates hard_float with "no call for adding doubles". | 720 # The generic test equates hard_float with "no call for adding doubles". |
676 return [check_no_messages_and_pattern hard_float "!\\(call" rtl-expand { | 721 return [check_no_messages_and_pattern hard_float "!\\(call" rtl-expand { |
677 double a (double b, double c) { return b + c; } | 722 double a (double b, double c) { return b + c; } |
678 }] | 723 }] |
679 } | 724 } |
680 | 725 |
681 # Return true if the target is a 64-bit MIPS target. | 726 # Return true if the target is a 64-bit MIPS target. |
682 | 727 |
683 proc check_effective_target_mips64 { } { | 728 proc check_effective_target_mips64 { } { |
684 return [check_no_compiler_messages mips64 assembly { | 729 return [check_no_compiler_messages mips64 assembly { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 #error FOO | 765 #error FOO |
721 #endif | 766 #endif |
722 #if defined __mips_hard_float \ | 767 #if defined __mips_hard_float \ |
723 && (!defined _ABIO32 || _MIPS_SIM != _ABIO32) \ | 768 && (!defined _ABIO32 || _MIPS_SIM != _ABIO32) \ |
724 && (!defined _ABIO64 || _MIPS_SIM != _ABIO64) | 769 && (!defined _ABIO64 || _MIPS_SIM != _ABIO64) |
725 #error FOO | 770 #error FOO |
726 #endif | 771 #endif |
727 } [add_options_for_mips16_attribute ""]] | 772 } [add_options_for_mips16_attribute ""]] |
728 } | 773 } |
729 | 774 |
| 775 # Return 1 if the target supports long double larger than double when |
| 776 # using the new ABI, 0 otherwise. |
| 777 |
| 778 proc check_effective_target_mips_newabi_large_long_double { } { |
| 779 return [check_no_compiler_messages mips_newabi_large_long_double object { |
| 780 int dummy[sizeof(long double) > sizeof(double) ? 1 : -1]; |
| 781 } "-mabi=64"] |
| 782 } |
| 783 |
730 # Return 1 if the current multilib does not generate PIC by default. | 784 # Return 1 if the current multilib does not generate PIC by default. |
731 | 785 |
732 proc check_effective_target_nonpic { } { | 786 proc check_effective_target_nonpic { } { |
733 return [check_no_compiler_messages nonpic assembly { | 787 return [check_no_compiler_messages nonpic assembly { |
734 #if __PIC__ | 788 #if __PIC__ |
735 #error FOO | 789 #error FOO |
736 #endif | 790 #endif |
737 }] | 791 }] |
738 } | 792 } |
739 | 793 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
849 #else | 903 #else |
850 asm volatile ("ps_mul 0,0,0"); | 904 asm volatile ("ps_mul 0,0,0"); |
851 #endif | 905 #endif |
852 return 0; | 906 return 0; |
853 } | 907 } |
854 } "-mpaired" | 908 } "-mpaired" |
855 } | 909 } |
856 }] | 910 }] |
857 } | 911 } |
858 | 912 |
| 913 # Return 1 if the target OS supports running SSE executables, 0 |
| 914 # otherwise. Cache the result. |
| 915 |
| 916 proc check_sse_os_support_available { } { |
| 917 return [check_cached_effective_target sse_os_support_available { |
| 918 # If this is not the right target then we can skip the test. |
| 919 if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } { |
| 920 expr 0 |
| 921 } elseif { [istarget i?86-*-solaris2*] } { |
| 922 # The Solaris 2 kernel doesn't save and restore SSE registers |
| 923 # before Solaris 9 4/04. Before that, executables die with SIGILL. |
| 924 check_runtime_nocache sse_os_support_available { |
| 925 int main () |
| 926 { |
| 927 __asm__ volatile ("movss %xmm2,%xmm1"); |
| 928 return 0; |
| 929 } |
| 930 } "-msse" |
| 931 } else { |
| 932 expr 1 |
| 933 } |
| 934 }] |
| 935 } |
| 936 |
| 937 # Return 1 if the target supports executing SSE instructions, 0 |
| 938 # otherwise. Cache the result. |
| 939 |
| 940 proc check_sse_hw_available { } { |
| 941 return [check_cached_effective_target sse_hw_available { |
| 942 # If this is not the right target then we can skip the test. |
| 943 if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } { |
| 944 expr 0 |
| 945 } else { |
| 946 check_runtime_nocache sse_hw_available { |
| 947 #include "cpuid.h" |
| 948 int main () |
| 949 { |
| 950 unsigned int eax, ebx, ecx, edx = 0; |
| 951 if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)) |
| 952 return !(edx & bit_SSE); |
| 953 return 1; |
| 954 } |
| 955 } "" |
| 956 } |
| 957 }] |
| 958 } |
| 959 |
859 # Return 1 if the target supports executing SSE2 instructions, 0 | 960 # Return 1 if the target supports executing SSE2 instructions, 0 |
860 # otherwise. Cache the result. | 961 # otherwise. Cache the result. |
861 | 962 |
862 proc check_sse2_hw_available { } { | 963 proc check_sse2_hw_available { } { |
863 return [check_cached_effective_target sse2_hw_available { | 964 return [check_cached_effective_target sse2_hw_available { |
864 # If this is not the right target then we can skip the test. | 965 # If this is not the right target then we can skip the test. |
865 if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } { | 966 if { !([istarget x86_64-*-*] || [istarget i?86-*-*]) } { |
866 expr 0 | 967 expr 0 |
867 } else { | 968 } else { |
868 check_runtime_nocache sse2_hw_available { | 969 check_runtime_nocache sse2_hw_available { |
869 #include "cpuid.h" | 970 #include "cpuid.h" |
870 int main () | 971 int main () |
871 { | 972 { |
872 unsigned int eax, ebx, ecx, edx = 0; | 973 unsigned int eax, ebx, ecx, edx = 0; |
873 if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)) | 974 if (__get_cpuid (1, &eax, &ebx, &ecx, &edx)) |
874 return !(edx & bit_SSE2); | 975 return !(edx & bit_SSE2); |
875 return 1; | 976 return 1; |
876 } | 977 } |
877 } "" | 978 } "" |
878 } | 979 } |
879 }] | 980 }] |
880 } | 981 } |
881 | 982 |
| 983 # Return 1 if the target supports running SSE executables, 0 otherwise. |
| 984 |
| 985 proc check_effective_target_sse_runtime { } { |
| 986 if { [check_sse_hw_available] && [check_sse_os_support_available] } { |
| 987 return 1 |
| 988 } else { |
| 989 return 0 |
| 990 } |
| 991 } |
| 992 |
| 993 # Return 1 if the target supports running SSE2 executables, 0 otherwise. |
| 994 |
| 995 proc check_effective_target_sse2_runtime { } { |
| 996 if { [check_sse2_hw_available] && [check_sse_os_support_available] } { |
| 997 return 1 |
| 998 } else { |
| 999 return 0 |
| 1000 } |
| 1001 } |
| 1002 |
| 1003 # Return 1 if the target supports executing VSX instructions, 0 |
| 1004 # otherwise. Cache the result. |
| 1005 |
| 1006 proc check_vsx_hw_available { } { |
| 1007 return [check_cached_effective_target vsx_hw_available { |
| 1008 # Some simulators are known to not support VSX instructions. |
| 1009 # For now, disable on Darwin |
| 1010 if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] || [ista
rget *-*-darwin*]} { |
| 1011 expr 0 |
| 1012 } else { |
| 1013 set options "-mvsx" |
| 1014 check_runtime_nocache vsx_hw_available { |
| 1015 int main() |
| 1016 { |
| 1017 #ifdef __MACH__ |
| 1018 asm volatile ("xxlor vs0,vs0,vs0"); |
| 1019 #else |
| 1020 asm volatile ("xxlor 0,0,0"); |
| 1021 #endif |
| 1022 return 0; |
| 1023 } |
| 1024 } $options |
| 1025 } |
| 1026 }] |
| 1027 } |
| 1028 |
882 # Return 1 if the target supports executing AltiVec instructions, 0 | 1029 # Return 1 if the target supports executing AltiVec instructions, 0 |
883 # otherwise. Cache the result. | 1030 # otherwise. Cache the result. |
884 | 1031 |
885 proc check_vmx_hw_available { } { | 1032 proc check_vmx_hw_available { } { |
886 return [check_cached_effective_target vmx_hw_available { | 1033 return [check_cached_effective_target vmx_hw_available { |
887 # Some simulators are known to not support VMX instructions. | 1034 # Some simulators are known to not support VMX instructions. |
888 if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] } { | 1035 if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] } { |
889 expr 0 | 1036 expr 0 |
890 } else { | 1037 } else { |
891 # Most targets don't require special flags for this test case, but | 1038 # Most targets don't require special flags for this test case, but |
892 » # Darwin does. | 1039 » # Darwin does. Just to be sure, make sure VSX is not enabled for |
| 1040 » # the altivec tests. |
893 if { [istarget *-*-darwin*] | 1041 if { [istarget *-*-darwin*] |
894 || [istarget *-*-aix*] } { | 1042 || [istarget *-*-aix*] } { |
895 » » set options "-maltivec" | 1043 » » set options "-maltivec -mno-vsx" |
896 } else { | 1044 } else { |
897 » » set options "" | 1045 » » set options "-mno-vsx" |
898 } | 1046 } |
899 check_runtime_nocache vmx_hw_available { | 1047 check_runtime_nocache vmx_hw_available { |
900 int main() | 1048 int main() |
901 { | 1049 { |
902 #ifdef __MACH__ | 1050 #ifdef __MACH__ |
903 asm volatile ("vor v0,v0,v0"); | 1051 asm volatile ("vor v0,v0,v0"); |
904 #else | 1052 #else |
905 asm volatile ("vor 0,0,0"); | 1053 asm volatile ("vor 0,0,0"); |
906 #endif | 1054 #endif |
907 return 0; | 1055 return 0; |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 return [check_function_available "mkfifo"] | 1225 return [check_function_available "mkfifo"] |
1078 } | 1226 } |
1079 | 1227 |
1080 # Returns true iff "__cxa_atexit" is used on the target system. | 1228 # Returns true iff "__cxa_atexit" is used on the target system. |
1081 | 1229 |
1082 proc check_cxa_atexit_available { } { | 1230 proc check_cxa_atexit_available { } { |
1083 return [check_cached_effective_target cxa_atexit_available { | 1231 return [check_cached_effective_target cxa_atexit_available { |
1084 if { [istarget "hppa*-*-hpux10*"] } { | 1232 if { [istarget "hppa*-*-hpux10*"] } { |
1085 # HP-UX 10 doesn't have __cxa_atexit but subsequent test passes. | 1233 # HP-UX 10 doesn't have __cxa_atexit but subsequent test passes. |
1086 expr 0 | 1234 expr 0 |
| 1235 } elseif { [istarget "*-*-vxworks"] } { |
| 1236 # vxworks doesn't have __cxa_atexit but subsequent test passes. |
| 1237 expr 0 |
1087 } else { | 1238 } else { |
1088 check_runtime_nocache cxa_atexit_available { | 1239 check_runtime_nocache cxa_atexit_available { |
1089 // C++ | 1240 // C++ |
1090 #include <stdlib.h> | 1241 #include <stdlib.h> |
1091 static unsigned int count; | 1242 static unsigned int count; |
1092 struct X | 1243 struct X |
1093 { | 1244 { |
1094 X() { count = 1; } | 1245 X() { count = 1; } |
1095 ~X() | 1246 ~X() |
1096 { | 1247 { |
(...skipping 16 matching lines...) Expand all Loading... |
1113 count = 3; | 1264 count = 3; |
1114 } | 1265 } |
1115 }; | 1266 }; |
1116 Y y; | 1267 Y y; |
1117 int main() { return 0; } | 1268 int main() { return 0; } |
1118 } | 1269 } |
1119 } | 1270 } |
1120 }] | 1271 }] |
1121 } | 1272 } |
1122 | 1273 |
| 1274 proc check_effective_target_objc2 { } { |
| 1275 return [check_no_compiler_messages objc2 object { |
| 1276 #ifdef __OBJC2__ |
| 1277 int dummy[1]; |
| 1278 #else |
| 1279 #error |
| 1280 #endif |
| 1281 }] |
| 1282 } |
| 1283 |
| 1284 proc check_effective_target_next_runtime { } { |
| 1285 return [check_no_compiler_messages objc2 object { |
| 1286 #ifdef __NEXT_RUNTIME__ |
| 1287 int dummy[1]; |
| 1288 #else |
| 1289 #error |
| 1290 #endif |
| 1291 }] |
| 1292 } |
1123 | 1293 |
1124 # Return 1 if we're generating 32-bit code using default options, 0 | 1294 # Return 1 if we're generating 32-bit code using default options, 0 |
1125 # otherwise. | 1295 # otherwise. |
1126 | 1296 |
1127 proc check_effective_target_ilp32 { } { | 1297 proc check_effective_target_ilp32 { } { |
1128 return [check_no_compiler_messages ilp32 object { | 1298 return [check_no_compiler_messages ilp32 object { |
1129 int dummy[sizeof (int) == 4 | 1299 int dummy[sizeof (int) == 4 |
1130 && sizeof (void *) == 4 | 1300 && sizeof (void *) == 4 |
1131 && sizeof (long) == 4 ? 1 : -1]; | 1301 && sizeof (long) == 4 ? 1 : -1]; |
1132 }] | 1302 }] |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1193 | 1363 |
1194 # Return 1 if the target supports long double larger than double, | 1364 # Return 1 if the target supports long double larger than double, |
1195 # 0 otherwise. | 1365 # 0 otherwise. |
1196 | 1366 |
1197 proc check_effective_target_large_long_double { } { | 1367 proc check_effective_target_large_long_double { } { |
1198 return [check_no_compiler_messages large_long_double object { | 1368 return [check_no_compiler_messages large_long_double object { |
1199 int dummy[sizeof(long double) > sizeof(double) ? 1 : -1]; | 1369 int dummy[sizeof(long double) > sizeof(double) ? 1 : -1]; |
1200 }] | 1370 }] |
1201 } | 1371 } |
1202 | 1372 |
| 1373 # Return 1 if the target supports double larger than float, |
| 1374 # 0 otherwise. |
| 1375 |
| 1376 proc check_effective_target_large_double { } { |
| 1377 return [check_no_compiler_messages large_double object { |
| 1378 int dummy[sizeof(double) > sizeof(float) ? 1 : -1]; |
| 1379 }] |
| 1380 } |
| 1381 |
| 1382 # Return 1 if the target supports double of 64 bits, |
| 1383 # 0 otherwise. |
| 1384 |
| 1385 proc check_effective_target_double64 { } { |
| 1386 return [check_no_compiler_messages double64 object { |
| 1387 int dummy[sizeof(double) == 8 ? 1 : -1]; |
| 1388 }] |
| 1389 } |
| 1390 |
| 1391 # Return 1 if the target supports double of at least 64 bits, |
| 1392 # 0 otherwise. |
| 1393 |
| 1394 proc check_effective_target_double64plus { } { |
| 1395 return [check_no_compiler_messages double64plus object { |
| 1396 int dummy[sizeof(double) >= 8 ? 1 : -1]; |
| 1397 }] |
| 1398 } |
| 1399 |
1203 # Return 1 if the target supports compiling fixed-point, | 1400 # Return 1 if the target supports compiling fixed-point, |
1204 # 0 otherwise. | 1401 # 0 otherwise. |
1205 | 1402 |
1206 proc check_effective_target_fixed_point { } { | 1403 proc check_effective_target_fixed_point { } { |
1207 return [check_no_compiler_messages fixed_point object { | 1404 return [check_no_compiler_messages fixed_point object { |
1208 _Sat _Fract x; _Sat _Accum y; | 1405 _Sat _Fract x; _Sat _Accum y; |
1209 }] | 1406 }] |
1210 } | 1407 } |
1211 | 1408 |
1212 # Return 1 if the target supports compiling decimal floating point, | 1409 # Return 1 if the target supports compiling decimal floating point, |
1213 # 0 otherwise. | 1410 # 0 otherwise. |
1214 | 1411 |
1215 proc check_effective_target_dfp_nocache { } { | 1412 proc check_effective_target_dfp_nocache { } { |
1216 verbose "check_effective_target_dfp_nocache: compiling source" 2 | 1413 verbose "check_effective_target_dfp_nocache: compiling source" 2 |
1217 set ret [check_no_compiler_messages_nocache dfp object { | 1414 set ret [check_no_compiler_messages_nocache dfp object { |
1218 _Decimal32 x; _Decimal64 y; _Decimal128 z; | 1415 » float x __attribute__((mode(DD))); |
1219 }] | 1416 }] |
1220 verbose "check_effective_target_dfp_nocache: returning $ret" 2 | 1417 verbose "check_effective_target_dfp_nocache: returning $ret" 2 |
1221 return $ret | 1418 return $ret |
1222 } | 1419 } |
1223 | 1420 |
1224 proc check_effective_target_dfprt_nocache { } { | 1421 proc check_effective_target_dfprt_nocache { } { |
1225 return [check_runtime_nocache dfprt { | 1422 return [check_runtime_nocache dfprt { |
1226 » _Decimal32 x = 1.2df; _Decimal64 y = 2.3dd; _Decimal128 z; | 1423 » typedef float d64 __attribute__((mode(DD))); |
| 1424 » d64 x = 1.2df, y = 2.3dd, z; |
1227 int main () { z = x + y; return 0; } | 1425 int main () { z = x + y; return 0; } |
1228 }] | 1426 }] |
1229 } | 1427 } |
1230 | 1428 |
1231 # Return 1 if the target supports compiling Decimal Floating Point, | 1429 # Return 1 if the target supports compiling Decimal Floating Point, |
1232 # 0 otherwise. | 1430 # 0 otherwise. |
1233 # | 1431 # |
1234 # This won't change for different subtargets so cache the result. | 1432 # This won't change for different subtargets so cache the result. |
1235 | 1433 |
1236 proc check_effective_target_dfp { } { | 1434 proc check_effective_target_dfp { } { |
1237 return [check_cached_effective_target dfp { | 1435 return [check_cached_effective_target dfp { |
1238 check_effective_target_dfp_nocache | 1436 check_effective_target_dfp_nocache |
1239 }] | 1437 }] |
1240 } | 1438 } |
1241 | 1439 |
1242 # Return 1 if the target supports linking and executing Decimal Floating | 1440 # Return 1 if the target supports linking and executing Decimal Floating |
1243 # Point, # 0 otherwise. | 1441 # Point, 0 otherwise. |
1244 # | 1442 # |
1245 # This won't change for different subtargets so cache the result. | 1443 # This won't change for different subtargets so cache the result. |
1246 | 1444 |
1247 proc check_effective_target_dfprt { } { | 1445 proc check_effective_target_dfprt { } { |
1248 return [check_cached_effective_target dfprt { | 1446 return [check_cached_effective_target dfprt { |
1249 check_effective_target_dfprt_nocache | 1447 check_effective_target_dfprt_nocache |
1250 }] | 1448 }] |
1251 } | 1449 } |
1252 | 1450 |
| 1451 # Return 1 if the target supports compiling and assembling UCN, 0 otherwise. |
| 1452 |
| 1453 proc check_effective_target_ucn_nocache { } { |
| 1454 # -std=c99 is only valid for C |
| 1455 if [check_effective_target_c] { |
| 1456 set ucnopts "-std=c99" |
| 1457 } |
| 1458 append ucnopts " -fextended-identifiers" |
| 1459 verbose "check_effective_target_ucn_nocache: compiling source" 2 |
| 1460 set ret [check_no_compiler_messages_nocache ucn object { |
| 1461 int \u00C0; |
| 1462 } $ucnopts] |
| 1463 verbose "check_effective_target_ucn_nocache: returning $ret" 2 |
| 1464 return $ret |
| 1465 } |
| 1466 |
| 1467 # Return 1 if the target supports compiling and assembling UCN, 0 otherwise. |
| 1468 # |
| 1469 # This won't change for different subtargets, so cache the result. |
| 1470 |
| 1471 proc check_effective_target_ucn { } { |
| 1472 return [check_cached_effective_target ucn { |
| 1473 check_effective_target_ucn_nocache |
| 1474 }] |
| 1475 } |
| 1476 |
1253 # Return 1 if the target needs a command line argument to enable a SIMD | 1477 # Return 1 if the target needs a command line argument to enable a SIMD |
1254 # instruction set. | 1478 # instruction set. |
1255 | 1479 |
1256 proc check_effective_target_vect_cmdline_needed { } { | 1480 proc check_effective_target_vect_cmdline_needed { } { |
1257 global et_vect_cmdline_needed_saved | 1481 global et_vect_cmdline_needed_saved |
1258 global et_vect_cmdline_needed_target_name | 1482 global et_vect_cmdline_needed_target_name |
1259 | 1483 |
1260 if { ![info exists et_vect_cmdline_needed_target_name] } { | 1484 if { ![info exists et_vect_cmdline_needed_target_name] } { |
1261 set et_vect_cmdline_needed_target_name "" | 1485 set et_vect_cmdline_needed_target_name "" |
1262 } | 1486 } |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1347 # Return 1 if the target supports unsigned int->float conversion | 1571 # Return 1 if the target supports unsigned int->float conversion |
1348 # | 1572 # |
1349 | 1573 |
1350 proc check_effective_target_vect_uintfloat_cvt { } { | 1574 proc check_effective_target_vect_uintfloat_cvt { } { |
1351 global et_vect_uintfloat_cvt_saved | 1575 global et_vect_uintfloat_cvt_saved |
1352 | 1576 |
1353 if [info exists et_vect_uintfloat_cvt_saved] { | 1577 if [info exists et_vect_uintfloat_cvt_saved] { |
1354 verbose "check_effective_target_vect_uintfloat_cvt: using cached result"
2 | 1578 verbose "check_effective_target_vect_uintfloat_cvt: using cached result"
2 |
1355 } else { | 1579 } else { |
1356 set et_vect_uintfloat_cvt_saved 0 | 1580 set et_vect_uintfloat_cvt_saved 0 |
1357 if { ([istarget powerpc*-*-*] | 1581 if { [istarget i?86-*-*] |
1358 » && ![istarget powerpc-*-linux*paired*]) } { | 1582 » || ([istarget powerpc*-*-*] |
| 1583 » » && ![istarget powerpc-*-linux*paired*]) |
| 1584 » || [istarget x86_64-*-*] } { |
1359 set et_vect_uintfloat_cvt_saved 1 | 1585 set et_vect_uintfloat_cvt_saved 1 |
1360 } | 1586 } |
1361 } | 1587 } |
1362 | 1588 |
1363 verbose "check_effective_target_vect_uintfloat_cvt: returning $et_vect_uintf
loat_cvt_saved" 2 | 1589 verbose "check_effective_target_vect_uintfloat_cvt: returning $et_vect_uintf
loat_cvt_saved" 2 |
1364 return $et_vect_uintfloat_cvt_saved | 1590 return $et_vect_uintfloat_cvt_saved |
1365 } | 1591 } |
1366 | 1592 |
1367 | 1593 |
1368 # Return 1 if the target supports signed float->int conversion | 1594 # Return 1 if the target supports signed float->int conversion |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 proc check_effective_target_arm_vfp_ok { } { | 1649 proc check_effective_target_arm_vfp_ok { } { |
1424 if { [check_effective_target_arm32] } { | 1650 if { [check_effective_target_arm32] } { |
1425 return [check_no_compiler_messages arm_vfp_ok object { | 1651 return [check_no_compiler_messages arm_vfp_ok object { |
1426 int dummy; | 1652 int dummy; |
1427 } "-mfpu=vfp -mfloat-abi=softfp"] | 1653 } "-mfpu=vfp -mfloat-abi=softfp"] |
1428 } else { | 1654 } else { |
1429 return 0 | 1655 return 0 |
1430 } | 1656 } |
1431 } | 1657 } |
1432 | 1658 |
| 1659 # Return 1 if this is an ARM target supporting -mfpu=vfp |
| 1660 # -mfloat-abi=hard. Some multilibs may be incompatible with these |
| 1661 # options. |
| 1662 |
| 1663 proc check_effective_target_arm_hard_vfp_ok { } { |
| 1664 if { [check_effective_target_arm32] } { |
| 1665 return [check_no_compiler_messages arm_hard_vfp_ok executable { |
| 1666 int main() { return 0;} |
| 1667 } "-mfpu=vfp -mfloat-abi=hard"] |
| 1668 } else { |
| 1669 return 0 |
| 1670 } |
| 1671 } |
| 1672 |
1433 # Return 1 if this is an ARM target supporting -mfpu=neon | 1673 # Return 1 if this is an ARM target supporting -mfpu=neon |
1434 # -mfloat-abi=softfp. Some multilibs may be incompatible with these | 1674 # -mfloat-abi=softfp. Some multilibs may be incompatible with these |
1435 # options. | 1675 # options. |
1436 | 1676 |
1437 proc check_effective_target_arm_neon_ok { } { | 1677 proc check_effective_target_arm_neon_ok { } { |
1438 if { [check_effective_target_arm32] } { | 1678 if { [check_effective_target_arm32] } { |
1439 return [check_no_compiler_messages arm_neon_ok object { | 1679 return [check_no_compiler_messages arm_neon_ok object { |
| 1680 #include "arm_neon.h" |
1440 int dummy; | 1681 int dummy; |
1441 } "-mfpu=neon -mfloat-abi=softfp"] | 1682 } "-mfpu=neon -mfloat-abi=softfp"] |
1442 } else { | 1683 } else { |
1443 return 0 | 1684 return 0 |
1444 } | 1685 } |
1445 } | 1686 } |
1446 | 1687 |
1447 # Return 1 is this is an ARM target where -mthumb causes Thumb-1 to be | 1688 # Return 1 is this is an ARM target where -mthumb causes Thumb-1 to be |
1448 # used. | 1689 # used. |
1449 | 1690 |
1450 proc check_effective_target_arm_thumb1_ok { } { | 1691 proc check_effective_target_arm_thumb1_ok { } { |
1451 return [check_no_compiler_messages arm_thumb1_ok assembly { | 1692 return [check_no_compiler_messages arm_thumb1_ok assembly { |
1452 #if !defined(__arm__) || !defined(__thumb__) || defined(__thumb2__) | 1693 #if !defined(__arm__) || !defined(__thumb__) || defined(__thumb2__) |
1453 #error FOO | 1694 #error FOO |
1454 #endif | 1695 #endif |
1455 } "-mthumb"] | 1696 } "-mthumb"] |
1456 } | 1697 } |
1457 | 1698 |
| 1699 # Return 1 is this is an ARM target where -mthumb causes Thumb-2 to be |
| 1700 # used. |
| 1701 |
| 1702 proc check_effective_target_arm_thumb2_ok { } { |
| 1703 return [check_no_compiler_messages arm_thumb2_ok assembly { |
| 1704 #if !defined(__thumb2__) |
| 1705 #error FOO |
| 1706 #endif |
| 1707 } "-mthumb"] |
| 1708 } |
| 1709 |
1458 # Return 1 if the target supports executing NEON instructions, 0 | 1710 # Return 1 if the target supports executing NEON instructions, 0 |
1459 # otherwise. Cache the result. | 1711 # otherwise. Cache the result. |
1460 | 1712 |
1461 proc check_effective_target_arm_neon_hw { } { | 1713 proc check_effective_target_arm_neon_hw { } { |
1462 return [check_runtime arm_neon_hw_available { | 1714 return [check_runtime arm_neon_hw_available { |
1463 int | 1715 int |
1464 main (void) | 1716 main (void) |
1465 { | 1717 { |
1466 long long a = 0, b = 1; | 1718 long long a = 0, b = 1; |
1467 asm ("vorr %P0, %P1, %P2" | 1719 asm ("vorr %P0, %P1, %P2" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1505 proc check_effective_target_arm_eabi { } { | 1757 proc check_effective_target_arm_eabi { } { |
1506 return [check_no_compiler_messages arm_eabi object { | 1758 return [check_no_compiler_messages arm_eabi object { |
1507 #ifndef __ARM_EABI__ | 1759 #ifndef __ARM_EABI__ |
1508 #error not EABI | 1760 #error not EABI |
1509 #else | 1761 #else |
1510 int dummy; | 1762 int dummy; |
1511 #endif | 1763 #endif |
1512 }] | 1764 }] |
1513 } | 1765 } |
1514 | 1766 |
| 1767 # Return 1 if this is an ARM target supporting -mcpu=iwmmxt. |
| 1768 # Some multilibs may be incompatible with this option. |
| 1769 |
| 1770 proc check_effective_target_arm_iwmmxt_ok { } { |
| 1771 if { [check_effective_target_arm32] } { |
| 1772 return [check_no_compiler_messages arm_iwmmxt_ok object { |
| 1773 int dummy; |
| 1774 } "-mcpu=iwmmxt"] |
| 1775 } else { |
| 1776 return 0 |
| 1777 } |
| 1778 } |
| 1779 |
1515 # Return 1 if this is a PowerPC target with floating-point registers. | 1780 # Return 1 if this is a PowerPC target with floating-point registers. |
1516 | 1781 |
1517 proc check_effective_target_powerpc_fprs { } { | 1782 proc check_effective_target_powerpc_fprs { } { |
1518 if { [istarget powerpc*-*-*] | 1783 if { [istarget powerpc*-*-*] |
1519 || [istarget rs6000-*-*] } { | 1784 || [istarget rs6000-*-*] } { |
1520 return [check_no_compiler_messages powerpc_fprs object { | 1785 return [check_no_compiler_messages powerpc_fprs object { |
1521 #ifdef __NO_FPRS__ | 1786 #ifdef __NO_FPRS__ |
1522 #error no FPRs | 1787 #error no FPRs |
1523 #else | 1788 #else |
1524 int dummy; | 1789 int dummy; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1560 return 0 | 1825 return 0 |
1561 } | 1826 } |
1562 return [check_no_compiler_messages powerpc_altivec_ok object { | 1827 return [check_no_compiler_messages powerpc_altivec_ok object { |
1563 int dummy; | 1828 int dummy; |
1564 } "-maltivec"] | 1829 } "-maltivec"] |
1565 } else { | 1830 } else { |
1566 return 0 | 1831 return 0 |
1567 } | 1832 } |
1568 } | 1833 } |
1569 | 1834 |
| 1835 # Return 1 if this is a PowerPC target supporting -mvsx |
| 1836 |
| 1837 proc check_effective_target_powerpc_vsx_ok { } { |
| 1838 if { ([istarget powerpc*-*-*] |
| 1839 && ![istarget powerpc-*-linux*paired*]) |
| 1840 || [istarget rs6000-*-*] } { |
| 1841 # AltiVec is not supported on AIX before 5.3. |
| 1842 if { [istarget powerpc*-*-aix4*] |
| 1843 || [istarget powerpc*-*-aix5.1*] |
| 1844 || [istarget powerpc*-*-aix5.2*] } { |
| 1845 return 0 |
| 1846 } |
| 1847 return [check_no_compiler_messages powerpc_vsx_ok object { |
| 1848 int main (void) { |
| 1849 #ifdef __MACH__ |
| 1850 asm volatile ("xxlor vs0,vs0,vs0"); |
| 1851 #else |
| 1852 asm volatile ("xxlor 0,0,0"); |
| 1853 #endif |
| 1854 return 0; |
| 1855 } |
| 1856 } "-mvsx"] |
| 1857 } else { |
| 1858 return 0 |
| 1859 } |
| 1860 } |
| 1861 |
1570 # Return 1 if this is a PowerPC target supporting -mcpu=cell. | 1862 # Return 1 if this is a PowerPC target supporting -mcpu=cell. |
1571 | 1863 |
1572 proc check_effective_target_powerpc_ppu_ok { } { | 1864 proc check_effective_target_powerpc_ppu_ok { } { |
1573 if [check_effective_target_powerpc_altivec_ok] { | 1865 if [check_effective_target_powerpc_altivec_ok] { |
1574 return [check_no_compiler_messages cell_asm_available object { | 1866 return [check_no_compiler_messages cell_asm_available object { |
1575 int main (void) { | 1867 int main (void) { |
1576 #ifdef __MACH__ | 1868 #ifdef __MACH__ |
1577 asm volatile ("lvlx v0,v0,v0"); | 1869 asm volatile ("lvlx v0,v0,v0"); |
1578 #else | 1870 #else |
1579 asm volatile ("lvlx 0,0,0"); | 1871 asm volatile ("lvlx 0,0,0"); |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2168 || [istarget sparc*-*-*] | 2460 || [istarget sparc*-*-*] |
2169 || [istarget ia64-*-*] | 2461 || [istarget ia64-*-*] |
2170 || [check_effective_target_arm32] } { | 2462 || [check_effective_target_arm32] } { |
2171 set et_vect_no_align_saved 1 | 2463 set et_vect_no_align_saved 1 |
2172 } | 2464 } |
2173 } | 2465 } |
2174 verbose "check_effective_target_vect_no_align: returning $et_vect_no_align_s
aved" 2 | 2466 verbose "check_effective_target_vect_no_align: returning $et_vect_no_align_s
aved" 2 |
2175 return $et_vect_no_align_saved | 2467 return $et_vect_no_align_saved |
2176 } | 2468 } |
2177 | 2469 |
| 2470 # Return 1 if the target supports a vector misalign access, 0 otherwise. |
| 2471 # |
| 2472 # This won't change for different subtargets so cache the result. |
| 2473 |
| 2474 proc check_effective_target_vect_hw_misalign { } { |
| 2475 global et_vect_hw_misalign_saved |
| 2476 |
| 2477 if [info exists et_vect_hw_misalign_saved] { |
| 2478 verbose "check_effective_target_vect_hw_misalign: using cached result" 2 |
| 2479 } else { |
| 2480 set et_vect_hw_misalign_saved 0 |
| 2481 if { ([istarget x86_64-*-*] |
| 2482 || [istarget i?86-*-*]) } { |
| 2483 set et_vect_hw_misalign_saved 1 |
| 2484 } |
| 2485 } |
| 2486 verbose "check_effective_target_vect_hw_misalign: returning $et_vect_hw_misa
lign_saved" 2 |
| 2487 return $et_vect_hw_misalign_saved |
| 2488 } |
| 2489 |
| 2490 |
2178 # Return 1 if arrays are aligned to the vector alignment | 2491 # Return 1 if arrays are aligned to the vector alignment |
2179 # boundary, 0 otherwise. | 2492 # boundary, 0 otherwise. |
2180 # | 2493 # |
2181 # This won't change for different subtargets so cache the result. | 2494 # This won't change for different subtargets so cache the result. |
2182 | 2495 |
2183 proc check_effective_target_vect_aligned_arrays { } { | 2496 proc check_effective_target_vect_aligned_arrays { } { |
2184 global et_vect_aligned_arrays | 2497 global et_vect_aligned_arrays |
2185 | 2498 |
2186 if [info exists et_vect_aligned_arrays_saved] { | 2499 if [info exists et_vect_aligned_arrays_saved] { |
2187 verbose "check_effective_target_vect_aligned_arrays: using cached result
" 2 | 2500 verbose "check_effective_target_vect_aligned_arrays: using cached result
" 2 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2328 proc check_effective_target_vect_short_mult { } { | 2641 proc check_effective_target_vect_short_mult { } { |
2329 global et_vect_short_mult_saved | 2642 global et_vect_short_mult_saved |
2330 | 2643 |
2331 if [info exists et_vect_short_mult_saved] { | 2644 if [info exists et_vect_short_mult_saved] { |
2332 verbose "check_effective_target_vect_short_mult: using cached result" 2 | 2645 verbose "check_effective_target_vect_short_mult: using cached result" 2 |
2333 } else { | 2646 } else { |
2334 set et_vect_short_mult_saved 0 | 2647 set et_vect_short_mult_saved 0 |
2335 if { [istarget ia64-*-*] | 2648 if { [istarget ia64-*-*] |
2336 || [istarget spu-*-*] | 2649 || [istarget spu-*-*] |
2337 || [istarget i?86-*-*] | 2650 || [istarget i?86-*-*] |
2338 » || [istarget x86_64-*-*] | 2651 » || [istarget x86_64-*-*] |
2339 || [istarget powerpc*-*-*] | 2652 || [istarget powerpc*-*-*] |
2340 || [check_effective_target_arm32] } { | 2653 || [check_effective_target_arm32] } { |
2341 set et_vect_short_mult_saved 1 | 2654 set et_vect_short_mult_saved 1 |
2342 } | 2655 } |
2343 } | 2656 } |
2344 | 2657 |
2345 verbose "check_effective_target_vect_short_mult: returning $et_vect_short_mu
lt_saved" 2 | 2658 verbose "check_effective_target_vect_short_mult: returning $et_vect_short_mu
lt_saved" 2 |
2346 return $et_vect_short_mult_saved | 2659 return $et_vect_short_mult_saved |
2347 } | 2660 } |
2348 | 2661 |
2349 # Return 1 if the target supports vector int multiplication, 0 otherwise. | 2662 # Return 1 if the target supports vector int multiplication, 0 otherwise. |
(...skipping 20 matching lines...) Expand all Loading... |
2370 | 2683 |
2371 # Return 1 if the target supports vector even/odd elements extraction, 0 otherwi
se. | 2684 # Return 1 if the target supports vector even/odd elements extraction, 0 otherwi
se. |
2372 | 2685 |
2373 proc check_effective_target_vect_extract_even_odd { } { | 2686 proc check_effective_target_vect_extract_even_odd { } { |
2374 global et_vect_extract_even_odd_saved | 2687 global et_vect_extract_even_odd_saved |
2375 | 2688 |
2376 if [info exists et_vect_extract_even_odd_saved] { | 2689 if [info exists et_vect_extract_even_odd_saved] { |
2377 verbose "check_effective_target_vect_extract_even_odd: using cached resu
lt" 2 | 2690 verbose "check_effective_target_vect_extract_even_odd: using cached resu
lt" 2 |
2378 } else { | 2691 } else { |
2379 set et_vect_extract_even_odd_saved 0 | 2692 set et_vect_extract_even_odd_saved 0 |
2380 if { [istarget powerpc*-*-*] | 2693 if { [istarget powerpc*-*-*] |
| 2694 || [istarget i?86-*-*] |
| 2695 || [istarget x86_64-*-*] |
2381 || [istarget spu-*-*] } { | 2696 || [istarget spu-*-*] } { |
2382 set et_vect_extract_even_odd_saved 1 | 2697 set et_vect_extract_even_odd_saved 1 |
2383 } | 2698 } |
2384 } | 2699 } |
2385 | 2700 |
2386 verbose "check_effective_target_vect_extract_even_odd: returning $et_vect_ex
tract_even_odd_saved" 2 | 2701 verbose "check_effective_target_vect_extract_even_odd: returning $et_vect_ex
tract_even_odd_saved" 2 |
2387 return $et_vect_extract_even_odd_saved | 2702 return $et_vect_extract_even_odd_saved |
2388 } | 2703 } |
2389 | 2704 |
2390 # Return 1 if the target supports vector even/odd elements extraction of | 2705 # Return 1 if the target supports vector even/odd elements extraction of |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2469 | 2784 |
2470 # Return 1 if the target supports section-anchors | 2785 # Return 1 if the target supports section-anchors |
2471 | 2786 |
2472 proc check_effective_target_section_anchors { } { | 2787 proc check_effective_target_section_anchors { } { |
2473 global et_section_anchors_saved | 2788 global et_section_anchors_saved |
2474 | 2789 |
2475 if [info exists et_section_anchors_saved] { | 2790 if [info exists et_section_anchors_saved] { |
2476 verbose "check_effective_target_section_anchors: using cached result" 2 | 2791 verbose "check_effective_target_section_anchors: using cached result" 2 |
2477 } else { | 2792 } else { |
2478 set et_section_anchors_saved 0 | 2793 set et_section_anchors_saved 0 |
2479 if { [istarget powerpc*-*-*] } { | 2794 if { [istarget powerpc*-*-*] |
| 2795 » || [istarget arm*-*-*] } { |
2480 set et_section_anchors_saved 1 | 2796 set et_section_anchors_saved 1 |
2481 } | 2797 } |
2482 } | 2798 } |
2483 | 2799 |
2484 verbose "check_effective_target_section_anchors: returning $et_section_ancho
rs_saved" 2 | 2800 verbose "check_effective_target_section_anchors: returning $et_section_ancho
rs_saved" 2 |
2485 return $et_section_anchors_saved | 2801 return $et_section_anchors_saved |
2486 } | 2802 } |
2487 | 2803 |
2488 # Return 1 if the target supports atomic operations on "int" and "long". | 2804 # Return 1 if the target supports atomic operations on "int" and "long". |
2489 | 2805 |
2490 proc check_effective_target_sync_int_long { } { | 2806 proc check_effective_target_sync_int_long { } { |
2491 global et_sync_int_long_saved | 2807 global et_sync_int_long_saved |
2492 | 2808 |
2493 if [info exists et_sync_int_long_saved] { | 2809 if [info exists et_sync_int_long_saved] { |
2494 verbose "check_effective_target_sync_int_long: using cached result" 2 | 2810 verbose "check_effective_target_sync_int_long: using cached result" 2 |
2495 } else { | 2811 } else { |
2496 set et_sync_int_long_saved 0 | 2812 set et_sync_int_long_saved 0 |
2497 # This is intentionally powerpc but not rs6000, rs6000 doesn't have the | 2813 # This is intentionally powerpc but not rs6000, rs6000 doesn't have the |
2498 # load-reserved/store-conditional instructions. | 2814 # load-reserved/store-conditional instructions. |
2499 if { [istarget ia64-*-*] | 2815 if { [istarget ia64-*-*] |
2500 || [istarget i?86-*-*] | 2816 || [istarget i?86-*-*] |
2501 || [istarget x86_64-*-*] | 2817 || [istarget x86_64-*-*] |
2502 || [istarget alpha*-*-*] | 2818 || [istarget alpha*-*-*] |
| 2819 || [istarget bfin*-*linux*] |
2503 || [istarget s390*-*-*] | 2820 || [istarget s390*-*-*] |
2504 || [istarget powerpc*-*-*] | 2821 || [istarget powerpc*-*-*] |
2505 || [istarget sparc64-*-*] | 2822 || [istarget sparc64-*-*] |
2506 || [istarget sparcv9-*-*] | 2823 || [istarget sparcv9-*-*] |
2507 || [istarget mips*-*-*] } { | 2824 || [istarget mips*-*-*] } { |
2508 set et_sync_int_long_saved 1 | 2825 set et_sync_int_long_saved 1 |
2509 } | 2826 } |
2510 } | 2827 } |
2511 | 2828 |
2512 verbose "check_effective_target_sync_int_long: returning $et_sync_int_long_s
aved" 2 | 2829 verbose "check_effective_target_sync_int_long: returning $et_sync_int_long_s
aved" 2 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2661 # Return 1 if target supports merging string constants at link time. | 2978 # Return 1 if target supports merging string constants at link time. |
2662 | 2979 |
2663 proc check_effective_target_string_merging { } { | 2980 proc check_effective_target_string_merging { } { |
2664 return [check_no_messages_and_pattern string_merging \ | 2981 return [check_no_messages_and_pattern string_merging \ |
2665 "rodata\\.str" assembly { | 2982 "rodata\\.str" assembly { |
2666 const char *var = "String"; | 2983 const char *var = "String"; |
2667 } {-O2}] | 2984 } {-O2}] |
2668 } | 2985 } |
2669 | 2986 |
2670 # Return 1 if target has the basic signed and unsigned types in | 2987 # Return 1 if target has the basic signed and unsigned types in |
2671 # <stdint.h>, 0 otherwise. | 2988 # <stdint.h>, 0 otherwise. This will be obsolete when GCC ensures a |
| 2989 # working <stdint.h> for all targets. |
2672 | 2990 |
2673 proc check_effective_target_stdint_types { } { | 2991 proc check_effective_target_stdint_types { } { |
2674 return [check_no_compiler_messages stdint_types assembly { | 2992 return [check_no_compiler_messages stdint_types assembly { |
2675 #include <stdint.h> | 2993 #include <stdint.h> |
2676 int8_t a; int16_t b; int32_t c; int64_t d; | 2994 int8_t a; int16_t b; int32_t c; int64_t d; |
2677 uint8_t e; uint16_t f; uint32_t g; uint64_t h; | 2995 uint8_t e; uint16_t f; uint32_t g; uint64_t h; |
2678 }] | 2996 }] |
2679 } | 2997 } |
2680 | 2998 |
| 2999 # Return 1 if target has the basic signed and unsigned types in |
| 3000 # <inttypes.h>, 0 otherwise. This is for tests that GCC's notions of |
| 3001 # these types agree with those in the header, as some systems have |
| 3002 # only <inttypes.h>. |
| 3003 |
| 3004 proc check_effective_target_inttypes_types { } { |
| 3005 return [check_no_compiler_messages inttypes_types assembly { |
| 3006 #include <inttypes.h> |
| 3007 int8_t a; int16_t b; int32_t c; int64_t d; |
| 3008 uint8_t e; uint16_t f; uint32_t g; uint64_t h; |
| 3009 }] |
| 3010 } |
| 3011 |
2681 # Return 1 if programs are intended to be run on a simulator | 3012 # Return 1 if programs are intended to be run on a simulator |
2682 # (i.e. slowly) rather than hardware (i.e. fast). | 3013 # (i.e. slowly) rather than hardware (i.e. fast). |
2683 | 3014 |
2684 proc check_effective_target_simulator { } { | 3015 proc check_effective_target_simulator { } { |
2685 | 3016 |
2686 # All "src/sim" simulators set this one. | 3017 # All "src/sim" simulators set this one. |
2687 if [board_info target exists is_simulator] { | 3018 if [board_info target exists is_simulator] { |
2688 return [board_info target is_simulator] | 3019 return [board_info target is_simulator] |
2689 } | 3020 } |
2690 | 3021 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2780 proc add_options_for_c99_runtime { flags } { | 3111 proc add_options_for_c99_runtime { flags } { |
2781 if { [istarget *-*-solaris2*] } { | 3112 if { [istarget *-*-solaris2*] } { |
2782 return "$flags -std=c99" | 3113 return "$flags -std=c99" |
2783 } | 3114 } |
2784 if { [istarget powerpc-*-darwin*] } { | 3115 if { [istarget powerpc-*-darwin*] } { |
2785 return "$flags -mmacosx-version-min=10.3" | 3116 return "$flags -mmacosx-version-min=10.3" |
2786 } | 3117 } |
2787 return $flags | 3118 return $flags |
2788 } | 3119 } |
2789 | 3120 |
| 3121 # Add to FLAGS all the target-specific flags needed to enable |
| 3122 # full IEEE compliance mode. |
| 3123 |
| 3124 proc add_options_for_ieee { flags } { |
| 3125 if { [istarget "alpha*-*-*"] |
| 3126 || [istarget "sh*-*-*"] } { |
| 3127 return "$flags -mieee" |
| 3128 } |
| 3129 return $flags |
| 3130 } |
| 3131 |
| 3132 # Add to FLAGS the flags needed to enable functions to bind locally |
| 3133 # when using pic/PIC passes in the testsuite. |
| 3134 |
| 3135 proc add_options_for_bind_pic_locally { flags } { |
| 3136 if {[check_no_compiler_messages using_pic2 assembly { |
| 3137 #if __PIC__ != 2 |
| 3138 #error FOO |
| 3139 #endif |
| 3140 }]} { |
| 3141 return "$flags -fPIE" |
| 3142 } |
| 3143 if {[check_no_compiler_messages using_pic1 assembly { |
| 3144 #if __PIC__ != 1 |
| 3145 #error FOO |
| 3146 #endif |
| 3147 }]} { |
| 3148 return "$flags -fpie" |
| 3149 } |
| 3150 |
| 3151 return $flags |
| 3152 } |
| 3153 |
2790 # Return 1 if the target provides a full C99 runtime. | 3154 # Return 1 if the target provides a full C99 runtime. |
2791 | 3155 |
2792 proc check_effective_target_c99_runtime { } { | 3156 proc check_effective_target_c99_runtime { } { |
2793 return [check_cached_effective_target c99_runtime { | 3157 return [check_cached_effective_target c99_runtime { |
2794 global srcdir | 3158 global srcdir |
2795 | 3159 |
2796 set file [open "$srcdir/gcc.dg/builtins-config.h"] | 3160 set file [open "$srcdir/gcc.dg/builtins-config.h"] |
2797 set contents [read $file] | 3161 set contents [read $file] |
2798 close $file | 3162 close $file |
2799 append contents { | 3163 append contents { |
(...skipping 29 matching lines...) Expand all Loading... |
2829 | 3193 |
2830 proc check_effective_target_avx { } { | 3194 proc check_effective_target_avx { } { |
2831 return [check_no_compiler_messages avx object { | 3195 return [check_no_compiler_messages avx object { |
2832 void _mm256_zeroall (void) | 3196 void _mm256_zeroall (void) |
2833 { | 3197 { |
2834 __builtin_ia32_vzeroall (); | 3198 __builtin_ia32_vzeroall (); |
2835 } | 3199 } |
2836 } "-O2 -mavx" ] | 3200 } "-O2 -mavx" ] |
2837 } | 3201 } |
2838 | 3202 |
| 3203 # Return 1 if sse instructions can be compiled. |
| 3204 proc check_effective_target_sse { } { |
| 3205 return [check_no_compiler_messages sse object { |
| 3206 int main () |
| 3207 { |
| 3208 __builtin_ia32_stmxcsr (); |
| 3209 return 0; |
| 3210 } |
| 3211 } "-O2 -msse" ] |
| 3212 } |
| 3213 |
| 3214 # Return 1 if sse2 instructions can be compiled. |
| 3215 proc check_effective_target_sse2 { } { |
| 3216 return [check_no_compiler_messages sse2 object { |
| 3217 typedef long long __m128i __attribute__ ((__vector_size__ (16))); |
| 3218 |
| 3219 __m128i _mm_srli_si128 (__m128i __A, int __N) |
| 3220 { |
| 3221 return (__m128i)__builtin_ia32_psrldqi128 (__A, 8); |
| 3222 } |
| 3223 } "-O2 -msse2" ] |
| 3224 } |
| 3225 |
2839 # Return 1 if C wchar_t type is compatible with char16_t. | 3226 # Return 1 if C wchar_t type is compatible with char16_t. |
2840 | 3227 |
2841 proc check_effective_target_wchar_t_char16_t_compatible { } { | 3228 proc check_effective_target_wchar_t_char16_t_compatible { } { |
2842 return [check_no_compiler_messages wchar_t_char16_t object { | 3229 return [check_no_compiler_messages wchar_t_char16_t object { |
2843 __WCHAR_TYPE__ wc; | 3230 __WCHAR_TYPE__ wc; |
2844 __CHAR16_TYPE__ *p16 = &wc; | 3231 __CHAR16_TYPE__ *p16 = &wc; |
2845 char t[(((__CHAR16_TYPE__) -1) < 0 == ((__WCHAR_TYPE__) -1) < 0) ? 1 : -
1]; | 3232 char t[(((__CHAR16_TYPE__) -1) < 0 == ((__WCHAR_TYPE__) -1) < 0) ? 1 : -
1]; |
2846 }] | 3233 }] |
2847 } | 3234 } |
2848 | 3235 |
(...skipping 17 matching lines...) Expand all Loading... |
2866 x = pow10 (1); | 3253 x = pow10 (1); |
2867 return 0; | 3254 return 0; |
2868 } | 3255 } |
2869 } "-lm" ] | 3256 } "-lm" ] |
2870 } | 3257 } |
2871 | 3258 |
2872 # Return 1 if current options generate DFP instructions, 0 otherwise. | 3259 # Return 1 if current options generate DFP instructions, 0 otherwise. |
2873 | 3260 |
2874 proc check_effective_target_hard_dfp {} { | 3261 proc check_effective_target_hard_dfp {} { |
2875 return [check_no_messages_and_pattern hard_dfp "!adddd3" assembly { | 3262 return [check_no_messages_and_pattern hard_dfp "!adddd3" assembly { |
2876 » _Decimal64 x, y, z; | 3263 » typedef float d64 __attribute__((mode(DD))); |
| 3264 » d64 x, y, z; |
2877 void foo (void) { z = x + y; } | 3265 void foo (void) { z = x + y; } |
2878 }] | 3266 }] |
2879 } | 3267 } |
2880 | 3268 |
2881 # Return 1 if string.h and wchar.h headers provide C++ requires overloads | 3269 # Return 1 if string.h and wchar.h headers provide C++ requires overloads |
2882 # for strchr etc. functions. | 3270 # for strchr etc. functions. |
2883 | 3271 |
2884 proc check_effective_target_correct_iso_cpp_string_wchar_protos { } { | 3272 proc check_effective_target_correct_iso_cpp_string_wchar_protos { } { |
2885 return [check_no_compiler_messages correct_iso_cpp_string_wchar_protos assem
bly { | 3273 return [check_no_compiler_messages correct_iso_cpp_string_wchar_protos assem
bly { |
2886 #include <string.h> | 3274 #include <string.h> |
2887 #include <wchar.h> | 3275 #include <wchar.h> |
2888 #if !defined(__cplusplus) \ | 3276 #if !defined(__cplusplus) \ |
2889 || !defined(__CORRECT_ISO_CPP_STRING_H_PROTO) \ | 3277 || !defined(__CORRECT_ISO_CPP_STRING_H_PROTO) \ |
2890 || !defined(__CORRECT_ISO_CPP_WCHAR_H_PROTO) | 3278 || !defined(__CORRECT_ISO_CPP_WCHAR_H_PROTO) |
2891 ISO C++ correct string.h and wchar.h protos not supported. | 3279 ISO C++ correct string.h and wchar.h protos not supported. |
2892 #else | 3280 #else |
2893 int i; | 3281 int i; |
2894 #endif | 3282 #endif |
2895 }] | 3283 }] |
2896 } | 3284 } |
2897 | 3285 |
| 3286 # Return 1 if GNU as is used. |
| 3287 |
| 3288 proc check_effective_target_gas { } { |
| 3289 global use_gas_saved |
| 3290 global tool |
| 3291 |
| 3292 if {![info exists use_gas_saved]} { |
| 3293 # Check if the as used by gcc is GNU as. |
| 3294 set gcc_as [lindex [${tool}_target_compile "-print-prog-name=as" "" "non
e" ""] 0] |
| 3295 # Provide /dev/null as input, otherwise gas times out reading from |
| 3296 # stdin. |
| 3297 set status [remote_exec host "$gcc_as" "-v /dev/null"] |
| 3298 set as_output [lindex $status 1] |
| 3299 if { [ string first "GNU" $as_output ] >= 0 } { |
| 3300 set use_gas_saved 1 |
| 3301 } else { |
| 3302 set use_gas_saved 0 |
| 3303 } |
| 3304 } |
| 3305 return $use_gas_saved |
| 3306 } |
| 3307 |
| 3308 # Return 1 if the compiler has been configure with link-time optimization |
| 3309 # (LTO) support. |
| 3310 |
| 3311 proc check_effective_target_lto { } { |
| 3312 global ENABLE_LTO |
| 3313 return [info exists ENABLE_LTO] |
| 3314 } |
| 3315 |
2898 # Return 1 if the language for the compiler under test is C. | 3316 # Return 1 if the language for the compiler under test is C. |
2899 | 3317 |
2900 proc check_effective_target_c { } { | 3318 proc check_effective_target_c { } { |
2901 global tool | 3319 global tool |
2902 if [string match $tool "gcc"] { | 3320 if [string match $tool "gcc"] { |
2903 return 1 | 3321 return 1 |
2904 } | 3322 } |
2905 return 0 | 3323 return 0 |
2906 } | 3324 } |
2907 | 3325 |
2908 # Return 1 if the language for the compiler under test is C++. | 3326 # Return 1 if the language for the compiler under test is C++. |
2909 | 3327 |
2910 proc check_effective_target_c++ { } { | 3328 proc check_effective_target_c++ { } { |
2911 global tool | 3329 global tool |
2912 if [string match $tool "g++"] { | 3330 if [string match $tool "g++"] { |
2913 return 1 | 3331 return 1 |
2914 } | 3332 } |
2915 return 0 | 3333 return 0 |
2916 } | 3334 } |
2917 | |
OLD | NEW |