Mercurial > hg > CbC > CbC_gcc
comparison gcc/common/config/nds32/nds32-common.c @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 /* Common hooks of Andes NDS32 cpu for GNU compiler | 1 /* Common hooks of Andes NDS32 cpu for GNU compiler |
2 Copyright (C) 2012-2017 Free Software Foundation, Inc. | 2 Copyright (C) 2012-2018 Free Software Foundation, Inc. |
3 Contributed by Andes Technology Corporation. | 3 Contributed by Andes Technology Corporation. |
4 | 4 |
5 This file is part of GCC. | 5 This file is part of GCC. |
6 | 6 |
7 GCC is free software; you can redistribute it and/or modify it | 7 GCC is free software; you can redistribute it and/or modify it |
51 return false; | 51 return false; |
52 } | 52 } |
53 | 53 |
54 return true; | 54 return true; |
55 | 55 |
56 case OPT_misr_secure_: | |
57 /* Check the valid security level: 0 1 2 3. */ | |
58 if (value < 0 || value > 3) | |
59 { | |
60 error_at (loc, "for the option -misr-secure=X, the valid X " | |
61 "must be: 0, 1, 2, or 3"); | |
62 return false; | |
63 } | |
64 return true; | |
65 | |
56 case OPT_mcache_block_size_: | 66 case OPT_mcache_block_size_: |
57 /* Check valid value: 4 8 16 32 64 128 256 512. */ | 67 /* Check valid value: 4 8 16 32 64 128 256 512. */ |
58 if (exact_log2 (value) < 2 || exact_log2 (value) > 9) | 68 if (exact_log2 (value) < 2 || exact_log2 (value) > 9) |
59 { | 69 { |
60 error_at (loc, "for the option -mcache-block-size=X, the valid X " | 70 error_at (loc, "for the option -mcache-block-size=X, the valid X " |
72 /* ------------------------------------------------------------------------ */ | 82 /* ------------------------------------------------------------------------ */ |
73 | 83 |
74 /* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */ | 84 /* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */ |
75 static const struct default_options nds32_option_optimization_table[] = | 85 static const struct default_options nds32_option_optimization_table[] = |
76 { | 86 { |
87 #if TARGET_LINUX_ABI == 0 | |
88 /* Disable -fdelete-null-pointer-checks by default in ELF toolchain. */ | |
89 { OPT_LEVELS_ALL, OPT_fdelete_null_pointer_checks, | |
90 NULL, 0 }, | |
91 #endif | |
77 /* Enable -fsched-pressure by default at -O1 and above. */ | 92 /* Enable -fsched-pressure by default at -O1 and above. */ |
78 { OPT_LEVELS_1_PLUS, OPT_fsched_pressure, NULL, 1 }, | 93 { OPT_LEVELS_1_PLUS, OPT_fsched_pressure, NULL, 1 }, |
79 /* Enable -fomit-frame-pointer by default at all optimization levels. */ | 94 /* Enable -fomit-frame-pointer by default at all optimization levels. */ |
80 { OPT_LEVELS_ALL, OPT_fomit_frame_pointer, NULL, 1 }, | 95 { OPT_LEVELS_ALL, OPT_fomit_frame_pointer, NULL, 1 }, |
96 /* Enable -mrelax-hint by default at all optimization levels. */ | |
97 { OPT_LEVELS_ALL, OPT_mrelax_hint, NULL, 1 }, | |
98 /* Enalbe -malways-align by default at -O1 and above, but not -Os or -Og. */ | |
99 { OPT_LEVELS_1_PLUS_SPEED_ONLY, OPT_malways_align, NULL, 1 }, | |
81 /* Enable -mv3push by default at -Os, but it is useless under V2 ISA. */ | 100 /* Enable -mv3push by default at -Os, but it is useless under V2 ISA. */ |
82 { OPT_LEVELS_SIZE, OPT_mv3push, NULL, 1 }, | 101 { OPT_LEVELS_SIZE, OPT_mv3push, NULL, 1 }, |
83 | 102 |
84 { OPT_LEVELS_NONE, 0, NULL, 0 } | 103 { OPT_LEVELS_NONE, 0, NULL, 0 } |
85 }; | 104 }; |
86 | 105 |
87 /* ------------------------------------------------------------------------ */ | 106 /* ------------------------------------------------------------------------ */ |
107 | |
108 /* Implement TARGET_EXCEPT_UNWIND_INFO. */ | |
109 static enum unwind_info_type | |
110 nds32_except_unwind_info (struct gcc_options *opts ATTRIBUTE_UNUSED) | |
111 { | |
112 if (TARGET_LINUX_ABI) | |
113 return UI_DWARF2; | |
114 | |
115 return UI_SJLJ; | |
116 } | |
117 | |
118 /* ------------------------------------------------------------------------ */ | |
119 | |
88 | 120 |
89 /* Run-time Target Specification. */ | 121 /* Run-time Target Specification. */ |
90 | 122 |
91 /* The default target flags consist of | 123 /* The default target flags consist of |
92 TARGET_CPU_DEFAULT and other MASK_XXX flags. | 124 TARGET_CPU_DEFAULT and other MASK_XXX flags. |
95 the process of 'configure' and 'make' stage. | 127 the process of 'configure' and 'make' stage. |
96 Please check gcc/config.gcc for more implementation detail. | 128 Please check gcc/config.gcc for more implementation detail. |
97 | 129 |
98 Other MASK_XXX flags are set individually. | 130 Other MASK_XXX flags are set individually. |
99 By default we enable | 131 By default we enable |
100 TARGET_16_BIT : Generate 16/32 bit mixed length instruction. | 132 TARGET_16_BIT : Generate 16/32 bit mixed length instruction. |
101 TARGET_PERF_EXT : Generate performance extention instrcution. | 133 TARGET_EXT_PERF : Generate performance extention instrcution. |
102 TARGET_CMOV : Generate conditional move instruction. */ | 134 TARGET_EXT_PERF2 : Generate performance extention version 2 instrcution. |
135 TARGET_EXT_STRING : Generate string extention instrcution. | |
136 TARGET_HW_ABS : Generate hardware abs instruction. | |
137 TARGET_CMOV : Generate conditional move instruction. */ | |
103 #undef TARGET_DEFAULT_TARGET_FLAGS | 138 #undef TARGET_DEFAULT_TARGET_FLAGS |
104 #define TARGET_DEFAULT_TARGET_FLAGS \ | 139 #define TARGET_DEFAULT_TARGET_FLAGS \ |
105 (TARGET_CPU_DEFAULT \ | 140 (TARGET_CPU_DEFAULT \ |
141 | TARGET_DEFAULT_FPU_ISA \ | |
142 | TARGET_DEFAULT_FPU_FMA \ | |
106 | MASK_16_BIT \ | 143 | MASK_16_BIT \ |
107 | MASK_PERF_EXT \ | 144 | MASK_EXT_PERF \ |
145 | MASK_EXT_PERF2 \ | |
146 | MASK_EXT_STRING \ | |
147 | MASK_HW_ABS \ | |
108 | MASK_CMOV) | 148 | MASK_CMOV) |
109 | 149 |
110 #undef TARGET_HANDLE_OPTION | 150 #undef TARGET_HANDLE_OPTION |
111 #define TARGET_HANDLE_OPTION nds32_handle_option | 151 #define TARGET_HANDLE_OPTION nds32_handle_option |
112 | 152 |
115 | 155 |
116 | 156 |
117 /* Defining the Output Assembler Language. */ | 157 /* Defining the Output Assembler Language. */ |
118 | 158 |
119 #undef TARGET_EXCEPT_UNWIND_INFO | 159 #undef TARGET_EXCEPT_UNWIND_INFO |
120 #define TARGET_EXCEPT_UNWIND_INFO sjlj_except_unwind_info | 160 #define TARGET_EXCEPT_UNWIND_INFO nds32_except_unwind_info |
121 | 161 |
122 /* ------------------------------------------------------------------------ */ | 162 /* ------------------------------------------------------------------------ */ |
123 | 163 |
124 struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER; | 164 struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER; |
125 | 165 |