diff options
author | Yang Yujie <yangyujie@loongson.cn> | 2024-04-23 10:42:47 +0800 |
---|---|---|
committer | Lulu Cheng <chenglulu@loongson.cn> | 2024-04-23 11:28:59 +0800 |
commit | b4ebdd153b2b068082b452772095260b03b78cc2 (patch) | |
tree | e04d9fc1186d11502b78617e0758d1d719443141 /gcc/config.gcc | |
parent | 8c6ee63bcd653c736d4cabafcbfd4f62582391ff (diff) | |
download | gcc-b4ebdd153b2b068082b452772095260b03b78cc2.zip gcc-b4ebdd153b2b068082b452772095260b03b78cc2.tar.gz gcc-b4ebdd153b2b068082b452772095260b03b78cc2.tar.bz2 |
LoongArch: Define ISA versions
These ISA versions are defined as -march= parameters and
are recommended for building binaries for distribution.
Detailed description of these definitions can be found at
https://github.com/loongson/la-toolchain-conventions, which
the LoongArch GCC port aims to conform to.
gcc/ChangeLog:
* config.gcc: Make la64v1.0 the default ISA preset of the lp64d ABI.
* config/loongarch/genopts/loongarch-strings: Define la64v1.0, la64v1.1.
* config/loongarch/genopts/loongarch.opt.in: Likewise.
* config/loongarch/loongarch-c.cc (LARCH_CPP_SET_PROCESSOR): Likewise.
(loongarch_cpu_cpp_builtins): Likewise.
* config/loongarch/loongarch-cpu.cc (get_native_prid): Likewise.
(fill_native_cpu_config): Likewise.
* config/loongarch/loongarch-def.cc (array_tune): Likewise.
* config/loongarch/loongarch-def.h: Likewise.
* config/loongarch/loongarch-driver.cc (driver_set_m_parm): Likewise.
(driver_get_normalized_m_opts): Likewise.
* config/loongarch/loongarch-opts.cc (default_tune_for_arch): Likewise.
(TUNE_FOR_ARCH): Likewise.
(arch_str): Likewise.
(loongarch_target_option_override): Likewise.
* config/loongarch/loongarch-opts.h (TARGET_uARCH_LA464): Likewise.
(TARGET_uARCH_LA664): Likewise.
* config/loongarch/loongarch-str.h (STR_CPU_ABI_DEFAULT): Likewise.
(STR_ARCH_ABI_DEFAULT): Likewise.
(STR_TUNE_GENERIC): Likewise.
(STR_ARCH_LA64V1_0): Likewise.
(STR_ARCH_LA64V1_1): Likewise.
* config/loongarch/loongarch.cc (loongarch_cpu_sched_reassociation_width): Likewise.
(loongarch_asm_code_end): Likewise.
* config/loongarch/loongarch.opt: Likewise.
* doc/invoke.texi: Likewise.
Diffstat (limited to 'gcc/config.gcc')
-rw-r--r-- | gcc/config.gcc | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc index 029ad1f..2cdecf7 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -5073,7 +5073,7 @@ case "${target}" in # Perform initial sanity checks on --with-* options. case ${with_arch} in - "" | abi-default | loongarch64 | la[46]64) ;; # OK, append here. + "" | la64v1.[01] | abi-default | loongarch64 | la[46]64) ;; # OK, append here. native) if test x${host} != x${target}; then echo "--with-arch=native is illegal for cross-compiler." 1>&2 @@ -5120,10 +5120,18 @@ case "${target}" in # Infer ISA-related default options from the ABI: pass 1 case ${abi_base}/${abi_ext} in - lp64*/base) + lp64d/base) # architectures that support lp64* ABI - arch_pattern="native|abi-default|loongarch64|la[46]64" - # default architecture for lp64* ABI + arch_pattern="native|abi-default|la64v1.[01]|loongarch64|la[46]64" + + # default architecture for lp64d ABI + arch_default="la64v1.0" + ;; + lp64[fs]/base) + # architectures that support lp64* ABI + arch_pattern="native|abi-default|la64v1.[01]|loongarch64|la[46]64" + + # default architecture for lp64[fs] ABI arch_default="abi-default" ;; *) @@ -5195,15 +5203,7 @@ case "${target}" in # Check default with_tune configuration using with_arch. - case ${with_arch} in - loongarch64) - tune_pattern="native|abi-default|loongarch64|la[46]64" - ;; - *) - # By default, $with_tune == $with_arch - tune_pattern="*" - ;; - esac + tune_pattern="native|generic|loongarch64|la[46]64" case ${with_tune} in "") ;; # OK @@ -5253,7 +5253,7 @@ case "${target}" in # Fixed: use the default gcc configuration for all multilib # builds by default. with_multilib_default="" ;; - arch,native|arch,loongarch64|arch,la[46]64) # OK, append here. + arch,native|arch,la64v1.[01]|arch,loongarch64|arch,la[46]64) # OK, append here. with_multilib_default="/march=${component}" ;; arch,*) with_multilib_default="/march=abi-default" @@ -5353,7 +5353,7 @@ case "${target}" in if test x${parse_state} = x"arch"; then # -march option case ${component} in - native | abi-default | loongarch64 | la[46]64) # OK, append here. + native | abi-default | la64v1.[01] | loongarch64 | la[46]64) # OK, append here. # Append -march spec for each multilib variant. loongarch_multilib_list_make="${loongarch_multilib_list_make}/march=${component}" parse_state="opts" @@ -5926,7 +5926,7 @@ case ${target} in # See macro definitions from loongarch-opts.h and loongarch-cpu.h. # Architecture - tm_defines="${tm_defines} DEFAULT_CPU_ARCH=CPU_$(echo ${with_arch} | tr a-z- A-Z_)" + tm_defines="${tm_defines} DEFAULT_CPU_ARCH=ARCH_$(echo ${with_arch} | tr a-z.- A-Z__)" # Base ABI type tm_defines="${tm_defines} DEFAULT_ABI_BASE=ABI_BASE_$(echo ${abi_base} | tr a-z- A-Z_)" @@ -5938,7 +5938,7 @@ case ${target} in # Microarchitecture if test x${with_tune} != x; then - tm_defines="${tm_defines} DEFAULT_CPU_TUNE=CPU_$(echo ${with_tune} | tr a-z- A-Z_)" + tm_defines="${tm_defines} DEFAULT_CPU_TUNE=TUNE_$(echo ${with_tune} | tr a-z.- A-Z__)" fi # FPU adjustment |