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: * gcc/config/loongarch/loongarch-c.cc: Export macros "__loongarch_{arch,tune}" in the preprocessor. --- gcc/config/loongarch/loongarch-c.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/config/loongarch/loongarch-c.cc b/gcc/config/loongarch/loongarch-c.cc index 660c68f0e06..7bee037cc4a 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) { -- 2.41.0