From f095da2c5a452df7a7e184e0dcb5bb1538dd9086 Mon Sep 17 00:00:00 2001 From: Yang Yujie Date: Mon, 28 Aug 2023 09:32:16 +0800 Subject: [PATCH] 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. --- 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 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) { -- 2.47.2