diff options
author | Ian Lance Taylor <iant@golang.org> | 2023-06-21 11:04:04 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2023-06-21 11:04:04 -0700 |
commit | 97e31a0a2a2d2273687fcdb4e5416aab1a2186e1 (patch) | |
tree | d5c1cae4de436a0fe54a5f0a2a197d309f3d654c /gcc/common | |
parent | 6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced (diff) | |
parent | 577223aebc7acdd31e62b33c1682fe54a622ae27 (diff) | |
download | gcc-97e31a0a2a2d2273687fcdb4e5416aab1a2186e1.zip gcc-97e31a0a2a2d2273687fcdb4e5416aab1a2186e1.tar.gz gcc-97e31a0a2a2d2273687fcdb4e5416aab1a2186e1.tar.bz2 |
Merge from trunk revision 577223aebc7acdd31e62b33c1682fe54a622ae27.
Diffstat (limited to 'gcc/common')
-rw-r--r-- | gcc/common/config/avr/avr-common.cc | 6 | ||||
-rw-r--r-- | gcc/common/config/i386/cpuinfo.h | 2 | ||||
-rw-r--r-- | gcc/common/config/i386/i386-common.cc | 44 | ||||
-rw-r--r-- | gcc/common/config/i386/i386-cpuinfo.h | 1 | ||||
-rw-r--r-- | gcc/common/config/i386/i386-isas.h | 2 | ||||
-rw-r--r-- | gcc/common/config/riscv/riscv-common.cc | 149 | ||||
-rw-r--r-- | gcc/common/config/rs6000/rs6000-common.cc | 2 |
7 files changed, 142 insertions, 64 deletions
diff --git a/gcc/common/config/avr/avr-common.cc b/gcc/common/config/avr/avr-common.cc index 2ad0244..2f874c5 100644 --- a/gcc/common/config/avr/avr-common.cc +++ b/gcc/common/config/avr/avr-common.cc @@ -29,12 +29,6 @@ /* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */ static const struct default_options avr_option_optimization_table[] = { - // With -fdelete-null-pointer-checks option, the compiler assumes - // that dereferencing of a null pointer would halt the program. - // For AVR this assumption is not true and a program can safely - // dereference null pointers. Changes made by this option may not - // work properly for AVR. So disable this option. - { OPT_LEVELS_ALL, OPT_fdelete_null_pointer_checks, NULL, 0 }, // The only effect of -fcaller-saves might be that it triggers // a frame without need when it tries to be smart around calls. { OPT_LEVELS_ALL, OPT_fcaller_saves, NULL, 0 }, diff --git a/gcc/common/config/i386/cpuinfo.h b/gcc/common/config/i386/cpuinfo.h index 5bde0cd..61559ed 100644 --- a/gcc/common/config/i386/cpuinfo.h +++ b/gcc/common/config/i386/cpuinfo.h @@ -879,6 +879,8 @@ get_available_features (struct __processor_model *cpu_model, { if (eax & bit_AMX_FP16) set_feature (FEATURE_AMX_FP16); + if (edx & bit_AMX_COMPLEX) + set_feature (FEATURE_AMX_COMPLEX); } } diff --git a/gcc/common/config/i386/i386-common.cc b/gcc/common/config/i386/i386-common.cc index 0181e06..bf126f1 100644 --- a/gcc/common/config/i386/i386-common.cc +++ b/gcc/common/config/i386/i386-common.cc @@ -82,7 +82,7 @@ along with GCC; see the file COPYING3. If not see #define OPTION_MASK_ISA2_AVX5124FMAPS_SET OPTION_MASK_ISA2_AVX5124FMAPS #define OPTION_MASK_ISA2_AVX5124VNNIW_SET OPTION_MASK_ISA2_AVX5124VNNIW #define OPTION_MASK_ISA_AVX512VBMI2_SET \ - (OPTION_MASK_ISA_AVX512VBMI2 | OPTION_MASK_ISA_AVX512F_SET) + (OPTION_MASK_ISA_AVX512VBMI2 | OPTION_MASK_ISA_AVX512BW_SET) #define OPTION_MASK_ISA_AVX512FP16_SET OPTION_MASK_ISA_AVX512BW_SET #define OPTION_MASK_ISA2_AVX512FP16_SET OPTION_MASK_ISA2_AVX512FP16 #define OPTION_MASK_ISA_AVX512VNNI_SET \ @@ -91,7 +91,7 @@ along with GCC; see the file COPYING3. If not see #define OPTION_MASK_ISA_AVX512VPOPCNTDQ_SET \ (OPTION_MASK_ISA_AVX512VPOPCNTDQ | OPTION_MASK_ISA_AVX512F_SET) #define OPTION_MASK_ISA_AVX512BITALG_SET \ - (OPTION_MASK_ISA_AVX512BITALG | OPTION_MASK_ISA_AVX512F_SET) + (OPTION_MASK_ISA_AVX512BITALG | OPTION_MASK_ISA_AVX512BW_SET) #define OPTION_MASK_ISA2_AVX512BF16_SET OPTION_MASK_ISA2_AVX512BF16 #define OPTION_MASK_ISA_RTM_SET OPTION_MASK_ISA_RTM #define OPTION_MASK_ISA_PRFCHW_SET OPTION_MASK_ISA_PRFCHW @@ -117,6 +117,8 @@ along with GCC; see the file COPYING3. If not see (OPTION_MASK_ISA2_AMX_TILE | OPTION_MASK_ISA2_AMX_FP16) #define OPTION_MASK_ISA2_PREFETCHI_SET OPTION_MASK_ISA2_PREFETCHI #define OPTION_MASK_ISA2_RAOINT_SET OPTION_MASK_ISA2_RAOINT +#define OPTION_MASK_ISA2_AMX_COMPLEX_SET \ + (OPTION_MASK_ISA2_AMX_TILE | OPTION_MASK_ISA2_AMX_COMPLEX) /* SSE4 includes both SSE4.1 and SSE4.2. -msse4 should be the same as -msse4.2. */ @@ -169,7 +171,9 @@ along with GCC; see the file COPYING3. If not see #define OPTION_MASK_ISA_GFNI_SET OPTION_MASK_ISA_GFNI #define OPTION_MASK_ISA_SHSTK_SET OPTION_MASK_ISA_SHSTK #define OPTION_MASK_ISA2_VAES_SET OPTION_MASK_ISA2_VAES -#define OPTION_MASK_ISA_VPCLMULQDQ_SET OPTION_MASK_ISA_VPCLMULQDQ +#define OPTION_MASK_ISA_VPCLMULQDQ_SET \ + (OPTION_MASK_ISA_VPCLMULQDQ | OPTION_MASK_ISA_PCLMUL_SET \ + | OPTION_MASK_ISA_AVX_SET) #define OPTION_MASK_ISA_MOVDIRI_SET OPTION_MASK_ISA_MOVDIRI #define OPTION_MASK_ISA2_MOVDIR64B_SET OPTION_MASK_ISA2_MOVDIR64B #define OPTION_MASK_ISA2_WAITPKG_SET OPTION_MASK_ISA2_WAITPKG @@ -209,7 +213,7 @@ along with GCC; see the file COPYING3. If not see #define OPTION_MASK_ISA_AVX_UNSET \ (OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_FMA_UNSET \ | OPTION_MASK_ISA_FMA4_UNSET | OPTION_MASK_ISA_F16C_UNSET \ - | OPTION_MASK_ISA_AVX2_UNSET ) + | OPTION_MASK_ISA_AVX2_UNSET | OPTION_MASK_ISA_VPCLMULQDQ_UNSET) #define OPTION_MASK_ISA_FMA_UNSET OPTION_MASK_ISA_FMA #define OPTION_MASK_ISA_FXSR_UNSET OPTION_MASK_ISA_FXSR #define OPTION_MASK_ISA_XSAVE_UNSET \ @@ -230,16 +234,15 @@ along with GCC; see the file COPYING3. If not see | OPTION_MASK_ISA_AVX512PF_UNSET | OPTION_MASK_ISA_AVX512ER_UNSET \ | OPTION_MASK_ISA_AVX512DQ_UNSET | OPTION_MASK_ISA_AVX512BW_UNSET \ | OPTION_MASK_ISA_AVX512VL_UNSET | OPTION_MASK_ISA_AVX512IFMA_UNSET \ - | OPTION_MASK_ISA_AVX512VBMI2_UNSET \ | OPTION_MASK_ISA_AVX512VNNI_UNSET \ - | OPTION_MASK_ISA_AVX512VPOPCNTDQ_UNSET \ - | OPTION_MASK_ISA_AVX512BITALG_UNSET) + | OPTION_MASK_ISA_AVX512VPOPCNTDQ_UNSET) #define OPTION_MASK_ISA_AVX512CD_UNSET OPTION_MASK_ISA_AVX512CD #define OPTION_MASK_ISA_AVX512PF_UNSET OPTION_MASK_ISA_AVX512PF #define OPTION_MASK_ISA_AVX512ER_UNSET OPTION_MASK_ISA_AVX512ER #define OPTION_MASK_ISA_AVX512DQ_UNSET OPTION_MASK_ISA_AVX512DQ #define OPTION_MASK_ISA_AVX512BW_UNSET \ - (OPTION_MASK_ISA_AVX512BW | OPTION_MASK_ISA_AVX512VBMI_UNSET) + (OPTION_MASK_ISA_AVX512BW | OPTION_MASK_ISA_AVX512VBMI_UNSET \ + | OPTION_MASK_ISA_AVX512VBMI2_UNSET | OPTION_MASK_ISA_AVX512BITALG_UNSET) #define OPTION_MASK_ISA_AVX512VL_UNSET OPTION_MASK_ISA_AVX512VL #define OPTION_MASK_ISA_AVX512IFMA_UNSET OPTION_MASK_ISA_AVX512IFMA #define OPTION_MASK_ISA2_AVXIFMA_UNSET OPTION_MASK_ISA2_AVXIFMA @@ -282,7 +285,8 @@ along with GCC; see the file COPYING3. If not see #define OPTION_MASK_ISA2_TSXLDTRK_UNSET OPTION_MASK_ISA2_TSXLDTRK #define OPTION_MASK_ISA2_AMX_TILE_UNSET \ (OPTION_MASK_ISA2_AMX_TILE | OPTION_MASK_ISA2_AMX_INT8_UNSET \ - | OPTION_MASK_ISA2_AMX_BF16_UNSET | OPTION_MASK_ISA2_AMX_FP16_UNSET) + | OPTION_MASK_ISA2_AMX_BF16_UNSET | OPTION_MASK_ISA2_AMX_FP16_UNSET \ + | OPTION_MASK_ISA2_AMX_COMPLEX_UNSET) #define OPTION_MASK_ISA2_AMX_INT8_UNSET OPTION_MASK_ISA2_AMX_INT8 #define OPTION_MASK_ISA2_AMX_BF16_UNSET OPTION_MASK_ISA2_AMX_BF16 #define OPTION_MASK_ISA2_UINTR_UNSET OPTION_MASK_ISA2_UINTR @@ -296,6 +300,7 @@ along with GCC; see the file COPYING3. If not see #define OPTION_MASK_ISA2_AMX_FP16_UNSET OPTION_MASK_ISA2_AMX_FP16 #define OPTION_MASK_ISA2_PREFETCHI_UNSET OPTION_MASK_ISA2_PREFETCHI #define OPTION_MASK_ISA2_RAOINT_UNSET OPTION_MASK_ISA2_RAOINT +#define OPTION_MASK_ISA2_AMX_COMPLEX_UNSET OPTION_MASK_ISA2_AMX_COMPLEX /* SSE4 includes both SSE4.1 and SSE4.2. -mno-sse4 should the same as -mno-sse4.1. */ @@ -311,7 +316,8 @@ along with GCC; see the file COPYING3. If not see #define OPTION_MASK_ISA_AES_UNSET OPTION_MASK_ISA_AES #define OPTION_MASK_ISA_SHA_UNSET OPTION_MASK_ISA_SHA -#define OPTION_MASK_ISA_PCLMUL_UNSET OPTION_MASK_ISA_PCLMUL +#define OPTION_MASK_ISA_PCLMUL_UNSET \ + (OPTION_MASK_ISA_PCLMUL | OPTION_MASK_ISA_VPCLMULQDQ_UNSET) #define OPTION_MASK_ISA_ABM_UNSET OPTION_MASK_ISA_ABM #define OPTION_MASK_ISA2_PCONFIG_UNSET OPTION_MASK_ISA2_PCONFIG #define OPTION_MASK_ISA2_WBNOINVD_UNSET OPTION_MASK_ISA2_WBNOINVD @@ -342,7 +348,8 @@ along with GCC; see the file COPYING3. If not see | OPTION_MASK_ISA2_AVX512VP2INTERSECT_UNSET) #define OPTION_MASK_ISA2_GENERAL_REGS_ONLY_UNSET \ OPTION_MASK_ISA2_SSE_UNSET -#define OPTION_MASK_ISA2_AVX_UNSET OPTION_MASK_ISA2_AVX2_UNSET +#define OPTION_MASK_ISA2_AVX_UNSET \ + (OPTION_MASK_ISA2_AVX2_UNSET | OPTION_MASK_ISA2_VAES_UNSET) #define OPTION_MASK_ISA2_SSE4_2_UNSET OPTION_MASK_ISA2_AVX_UNSET #define OPTION_MASK_ISA2_SSE4_1_UNSET OPTION_MASK_ISA2_SSE4_2_UNSET #define OPTION_MASK_ISA2_SSE4_UNSET OPTION_MASK_ISA2_SSE4_1_UNSET @@ -679,6 +686,8 @@ ix86_handle_option (struct gcc_options *opts, { opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA2_VAES_SET; opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA2_VAES_SET; + opts->x_ix86_isa_flags |= OPTION_MASK_ISA_AVX_SET; + opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_AVX_SET; } else { @@ -1246,6 +1255,19 @@ ix86_handle_option (struct gcc_options *opts, } return true; + case OPT_mamx_complex: + if (value) + { + opts->x_ix86_isa_flags2 |= OPTION_MASK_ISA2_AMX_COMPLEX_SET; + opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA2_AMX_COMPLEX_SET; + } + else + { + opts->x_ix86_isa_flags2 &= ~OPTION_MASK_ISA2_AMX_COMPLEX_UNSET; + opts->x_ix86_isa_flags2_explicit |= OPTION_MASK_ISA2_AMX_COMPLEX_UNSET; + } + return true; + case OPT_mfma: if (value) { diff --git a/gcc/common/config/i386/i386-cpuinfo.h b/gcc/common/config/i386/i386-cpuinfo.h index b5933b85..2dafbb2 100644 --- a/gcc/common/config/i386/i386-cpuinfo.h +++ b/gcc/common/config/i386/i386-cpuinfo.h @@ -253,6 +253,7 @@ enum processor_features FEATURE_AMX_FP16, FEATURE_PREFETCHI, FEATURE_RAOINT, + FEATURE_AMX_COMPLEX, CPU_FEATURE_MAX }; diff --git a/gcc/common/config/i386/i386-isas.h b/gcc/common/config/i386/i386-isas.h index 8ed1428..d4b0b23 100644 --- a/gcc/common/config/i386/i386-isas.h +++ b/gcc/common/config/i386/i386-isas.h @@ -184,4 +184,6 @@ ISA_NAMES_TABLE_START ISA_NAMES_TABLE_ENTRY("amx-fp16", FEATURE_AMX_FP16, P_NONE, "-mamx-fp16") ISA_NAMES_TABLE_ENTRY("prefetchi", FEATURE_PREFETCHI, P_NONE, "-mprefetchi") ISA_NAMES_TABLE_ENTRY("raoint", FEATURE_RAOINT, P_NONE, "-mraoint") + ISA_NAMES_TABLE_ENTRY("amx-complex", FEATURE_AMX_COMPLEX, + P_NONE, "-mamx-complex") ISA_NAMES_TABLE_END diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc index ef221be..3247d52 100644 --- a/gcc/common/config/riscv/riscv-common.cc +++ b/gcc/common/config/riscv/riscv-common.cc @@ -104,7 +104,10 @@ static const riscv_implied_info_t riscv_implied_info[] = {"zfh", "zfhmin"}, {"zfhmin", "f"}, - + {"zvfhmin", "zve32f"}, + {"zvfh", "zve32f"}, + {"zvfh", "zfhmin"}, + {"zhinx", "zhinxmin"}, {"zhinxmin", "zfinx"}, @@ -216,6 +219,8 @@ static const struct riscv_ext_version riscv_ext_version_table[] = {"zfh", ISA_SPEC_CLASS_NONE, 1, 0}, {"zfhmin", ISA_SPEC_CLASS_NONE, 1, 0}, + {"zvfhmin", ISA_SPEC_CLASS_NONE, 1, 0}, + {"zvfh", ISA_SPEC_CLASS_NONE, 1, 0}, {"zmmul", ISA_SPEC_CLASS_NONE, 1, 0}, @@ -398,10 +403,10 @@ multi_letter_subset_rank (const std::string &subset) char multiletter_class = subset[0]; switch (multiletter_class) { - case 's': + case 'z': high_order = 0; break; - case 'z': + case 's': high_order = 1; break; case 'x': @@ -1121,14 +1126,14 @@ riscv_subset_list::parse (const char *arch, location_t loc) if (p == NULL) goto fail; - /* Parsing supervisor extension. */ - p = subset_list->parse_multiletter_ext (p, "s", "supervisor extension"); + /* Parsing sub-extensions. */ + p = subset_list->parse_multiletter_ext (p, "z", "sub-extension"); if (p == NULL) goto fail; - /* Parsing sub-extensions. */ - p = subset_list->parse_multiletter_ext (p, "z", "sub-extension"); + /* Parsing supervisor extension. */ + p = subset_list->parse_multiletter_ext (p, "s", "supervisor extension"); if (p == NULL) goto fail; @@ -1153,6 +1158,10 @@ riscv_subset_list::parse (const char *arch, location_t loc) subset_list->handle_combine_ext (); + if (subset_list->lookup ("zfinx") && subset_list->lookup ("f")) + error_at (loc, "%<-march=%s%>: z*inx conflicts with floating-point " + "extensions", arch); + return subset_list; fail: @@ -1239,6 +1248,8 @@ static const riscv_ext_flag_table_t riscv_ext_flag_table[] = {"zve64x", &gcc_options::x_riscv_vector_elen_flags, MASK_VECTOR_ELEN_64}, {"zve64f", &gcc_options::x_riscv_vector_elen_flags, MASK_VECTOR_ELEN_FP_32}, {"zve64d", &gcc_options::x_riscv_vector_elen_flags, MASK_VECTOR_ELEN_FP_64}, + {"zvfhmin", &gcc_options::x_riscv_vector_elen_flags, MASK_VECTOR_ELEN_FP_16}, + {"zvfh", &gcc_options::x_riscv_vector_elen_flags, MASK_VECTOR_ELEN_FP_16}, {"zvl32b", &gcc_options::x_riscv_zvl_flags, MASK_ZVL32B}, {"zvl64b", &gcc_options::x_riscv_zvl_flags, MASK_ZVL64B}, @@ -1255,6 +1266,8 @@ static const riscv_ext_flag_table_t riscv_ext_flag_table[] = {"zfhmin", &gcc_options::x_riscv_zf_subext, MASK_ZFHMIN}, {"zfh", &gcc_options::x_riscv_zf_subext, MASK_ZFH}, + {"zvfhmin", &gcc_options::x_riscv_zf_subext, MASK_ZVFHMIN}, + {"zvfh", &gcc_options::x_riscv_zf_subext, MASK_ZVFH}, {"zmmul", &gcc_options::x_riscv_zm_subext, MASK_ZMMUL}, @@ -1437,9 +1450,6 @@ riscv_multi_lib_check (int argc ATTRIBUTE_UNUSED, return ""; } -/* We only override this in bare-metal toolchain. */ -#ifdef RISCV_USE_CUSTOMISED_MULTI_LIB - /* Find last switch with the prefix, options are take last one in general, return NULL if not found, and return the option value if found, it could return empty string if the option has no value. */ @@ -1593,6 +1603,65 @@ riscv_check_conds ( return match_score + ok_count * 100; } +static const char * +riscv_select_multilib_by_abi ( + const std::string &riscv_current_abi_str, + const std::vector<riscv_multi_lib_info_t> &multilib_infos) +{ + for (size_t i = 0; i < multilib_infos.size (); ++i) + if (riscv_current_abi_str == multilib_infos[i].abi_str) + return xstrdup (multilib_infos[i].path.c_str ()); + + return NULL; +} + +static const char * +riscv_select_multilib ( + const std::string &riscv_current_abi_str, + const riscv_subset_list *subset_list, const struct switchstr *switches, + int n_switches, const std::vector<riscv_multi_lib_info_t> &multilib_infos) +{ + int match_score = 0; + int max_match_score = 0; + int best_match_multi_lib = -1; + /* Try to decision which set we should used. */ + /* We have 3 level decision tree here, ABI, check input arch/ABI must + be superset of multi-lib arch, and other rest option checking. */ + for (size_t i = 0; i < multilib_infos.size (); ++i) + { + /* Check ABI is same first. */ + if (riscv_current_abi_str != multilib_infos[i].abi_str) + continue; + + /* Found a potential compatible multi-lib setting! + Calculate the match score. */ + match_score = subset_list->match_score (multilib_infos[i].subset_list); + + /* Checking other cond in the multi-lib setting. */ + match_score = riscv_check_conds (switches, n_switches, match_score, + multilib_infos[i].conds); + + /* Record highest match score multi-lib setting. */ + if (match_score > max_match_score) + { + best_match_multi_lib = i; + max_match_score = match_score; + } + } + + if (best_match_multi_lib == -1) + { + riscv_no_matched_multi_lib = true; + return NULL; + } + else + return xstrdup (multilib_infos[best_match_multi_lib].path.c_str ()); +} + +#ifndef RISCV_USE_CUSTOMISED_MULTI_LIB +#define RISCV_USE_CUSTOMISED_MULTI_LIB select_by_builtin +#endif + /* Implement TARGET_COMPUTE_MULTILIB. */ static const char * riscv_compute_multilib ( @@ -1605,6 +1674,11 @@ riscv_compute_multilib ( const char *multilib_exclusions ATTRIBUTE_UNUSED, const char *multilib_reuse ATTRIBUTE_UNUSED) { + enum riscv_multilib_select_kind select_kind = RISCV_USE_CUSTOMISED_MULTI_LIB; + + if (select_kind == select_by_builtin) + return multilib_dir; + const char *p; const char *this_path; size_t this_path_len; @@ -1668,7 +1742,13 @@ riscv_compute_multilib ( } this_path_len = p - this_path; - multilib_info.path = std::string (this_path, this_path_len); + const char *multi_os_dir_pos + = (const char *) memchr (this_path, ':', this_path_len); + if (multi_os_dir_pos) + multilib_info.path + = std::string (this_path, multi_os_dir_pos - this_path); + else + multilib_info.path = std::string (this_path, this_path_len); option_conds.clear (); /* Pasrse option check list into vector<string>. @@ -1703,48 +1783,23 @@ riscv_compute_multilib ( p++; } - int match_score = 0; - int max_match_score = 0; - int best_match_multi_lib = -1; - /* Try to decision which set we should used. */ - /* We have 3 level decision tree here, ABI, check input arch/ABI must - be superset of multi-lib arch, and other rest option checking. */ - for (size_t i = 0; i < multilib_infos.size (); ++i) - { - /* Check ABI is same first. */ - if (riscv_current_abi_str != multilib_infos[i].abi_str) - continue; - - /* Found a potential compatible multi-lib setting! - Calculate the match score. */ - match_score = subset_list->match_score (multilib_infos[i].subset_list); - - /* Checking other cond in the multi-lib setting. */ - match_score = riscv_check_conds (switches, - n_switches, - match_score, - multilib_infos[i].conds); - - /* Record highest match score multi-lib setting. */ - if (match_score > max_match_score) - { - best_match_multi_lib = i; - max_match_score = match_score; - } - } - - if (best_match_multi_lib == -1) + switch (select_kind) { - riscv_no_matched_multi_lib = true; - return multilib_dir; + case select_by_abi: + return riscv_select_multilib_by_abi (riscv_current_abi_str, + multilib_infos); + case select_by_abi_arch_cmodel: + return riscv_select_multilib (riscv_current_abi_str, subset_list, + switches, n_switches, multilib_infos); + case select_by_builtin: + gcc_unreachable (); + default: + gcc_unreachable (); } - else - return xstrdup (multilib_infos[best_match_multi_lib].path.c_str ()); } #undef TARGET_COMPUTE_MULTILIB #define TARGET_COMPUTE_MULTILIB riscv_compute_multilib -#endif vec<const char *> riscv_get_valid_option_values (int option_code, diff --git a/gcc/common/config/rs6000/rs6000-common.cc b/gcc/common/config/rs6000/rs6000-common.cc index 2140c44..968db21 100644 --- a/gcc/common/config/rs6000/rs6000-common.cc +++ b/gcc/common/config/rs6000/rs6000-common.cc @@ -34,6 +34,8 @@ static const struct default_options rs6000_option_optimization_table[] = { OPT_LEVELS_ALL, OPT_fsplit_wide_types_early, NULL, 1 }, /* Enable -fsched-pressure for first pass instruction scheduling. */ { OPT_LEVELS_1_PLUS, OPT_fsched_pressure, NULL, 1 }, + /* Enable -free for zero extension and sign extension elimination.*/ + { OPT_LEVELS_2_PLUS, OPT_free, NULL, 1 }, /* Enable -munroll-only-small-loops with -funroll-loops to unroll small loops at -O2 and above by default. */ { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_funroll_loops, NULL, 1 }, |