From: Yang Yujie Date: Mon, 28 Aug 2023 01:32:16 +0000 (+0800) Subject: LoongArch: define preprocessing macros "__loongarch_{arch,tune}" X-Git-Tag: basepoints/gcc-15~6473 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f095da2c5a452df7a7e184e0dcb5bb1538dd9086;p=thirdparty%2Fgcc.git LoongArch: define preprocessing macros "__loongarch_{arch,tune}" These are exported according to the LoongArch Toolchain Conventions[1] as a replacement of the obsolete "_LOONGARCH_{ARCH,TUNE}" macros, which are expanded to strings representing the actual architecture and microarchitecture of the target. [1] currently relased at https://github.com/loongson/LoongArch-Documentation /blob/main/docs/LoongArch-toolchain-conventions-EN.adoc gcc/ChangeLog: * config/loongarch/loongarch-c.cc: Export macros "__loongarch_{arch,tune}" in the preprocessor. --- diff --git a/gcc/config/loongarch/loongarch-c.cc b/gcc/config/loongarch/loongarch-c.cc index f5a966a1d1c7..fbc33a10351f 100644 --- a/gcc/config/loongarch/loongarch-c.cc +++ b/gcc/config/loongarch/loongarch-c.cc @@ -64,6 +64,9 @@ loongarch_cpu_cpp_builtins (cpp_reader *pfile) LARCH_CPP_SET_PROCESSOR ("_LOONGARCH_ARCH", la_target.cpu_arch); LARCH_CPP_SET_PROCESSOR ("_LOONGARCH_TUNE", la_target.cpu_tune); + LARCH_CPP_SET_PROCESSOR ("__loongarch_arch", la_target.cpu_arch); + LARCH_CPP_SET_PROCESSOR ("__loongarch_tune", la_target.cpu_tune); + /* Base architecture / ABI. */ if (TARGET_64BIT) {