diff options
author | Yang Yujie <yangyujie@loongson.cn> | 2023-08-28 09:32:16 +0800 |
---|---|---|
committer | Lulu Cheng <chenglulu@loongson.cn> | 2023-09-05 11:48:00 +0800 |
commit | f095da2c5a452df7a7e184e0dcb5bb1538dd9086 (patch) | |
tree | 61b8e0363b3b2ed02c6a66c98f12635a80cf840b /gcc | |
parent | bb4a81988c6eb112837c0b38c8e2d352e3bcb01d (diff) | |
download | gcc-f095da2c5a452df7a7e184e0dcb5bb1538dd9086.zip gcc-f095da2c5a452df7a7e184e0dcb5bb1538dd9086.tar.gz gcc-f095da2c5a452df7a7e184e0dcb5bb1538dd9086.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/loongarch/loongarch-c.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/config/loongarch/loongarch-c.cc b/gcc/config/loongarch/loongarch-c.cc index f5a966a..fbc33a1 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) { |