gcc/ChangeLog: * config/loongarch/loongarch-d.cc: Undefine LoongArch32. Define LoongArch_SF, LoongArch_F32, LoongArch_F64
gcc/d/ChangeLog: * dmd/cond.d: Same. * implement-d.texi: Same. --- gcc/config/loongarch/loongarch-d.cc | 27 ++++++++++++++------------- gcc/d/dmd/cond.d | 6 +++--- gcc/d/implement-d.texi | 6 ++++++ 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/gcc/config/loongarch/loongarch-d.cc b/gcc/config/loongarch/loongarch-d.cc index 9ac483c39a7..4692b78708a 100644 --- a/gcc/config/loongarch/loongarch-d.cc +++ b/gcc/config/loongarch/loongarch-d.cc @@ -29,24 +29,27 @@ along with GCC; see the file COPYING3. If not see void loongarch_d_target_versions (void) { - if (TARGET_64BIT) + if (TARGET_ABI_LP64) d_add_builtin_version ("LoongArch64"); - else - d_add_builtin_version ("LoongArch32"); - if (TARGET_HARD_FLOAT_ABI) + if (TARGET_DOUBLE_FLOAT_ABI) + { + d_add_builtin_version ("LoongArch_F64"); + d_add_builtin_version ("D_HardFloat"); + } + else if (TARGET_SINGLE_FLOAT_ABI) { - d_add_builtin_version ("LoongArch_HardFloat"); + d_add_builtin_version ("LoongArch_F32"); d_add_builtin_version ("D_HardFloat"); } - else if (TARGET_SOFT_FLOAT_ABI) + else { - d_add_builtin_version ("LoongArch_SoftFloat"); + d_add_builtin_version ("LoongArch_SF"); d_add_builtin_version ("D_SoftFloat"); } } -/* Handle a call to `__traits(getTargetInfo, "floatAbi")'. */ +/* Handle trait getTargetInfo with key "floatAbi" */ static tree loongarch_d_handle_target_float_abi (void) @@ -55,10 +58,8 @@ loongarch_d_handle_target_float_abi (void) if (TARGET_HARD_FLOAT_ABI) abi = "hard"; - else if (TARGET_SOFT_FLOAT_ABI) - abi = "soft"; else - abi = ""; + abi = "soft"; return build_string_literal (strlen (abi) + 1, abi); } @@ -69,8 +70,8 @@ void loongarch_d_register_target_info (void) { const struct d_target_info_spec handlers[] = { - {"floatAbi", loongarch_d_handle_target_float_abi}, - {NULL, NULL}, + { "floatAbi", loongarch_d_handle_target_float_abi }, + { NULL, NULL }, }; d_add_target_info_handlers (handlers); diff --git a/gcc/d/dmd/cond.d b/gcc/d/dmd/cond.d index a8d099433a2..a6317eeffb1 100644 --- a/gcc/d/dmd/cond.d +++ b/gcc/d/dmd/cond.d @@ -692,10 +692,10 @@ extern (C++) final class VersionCondition : DVCondition case "LDC": case "linux": case "LittleEndian": - case "LoongArch32": case "LoongArch64": - case "LoongArch_HardFloat": - case "LoongArch_SoftFloat": + case "LoongArch_F64": + case "LoongArch_F32": + case "LoongArch_SF": case "MinGW": case "MIPS32": case "MIPS64": diff --git a/gcc/d/implement-d.texi b/gcc/d/implement-d.texi index 6f33bc192fe..cc0d1ecf593 100644 --- a/gcc/d/implement-d.texi +++ b/gcc/d/implement-d.texi @@ -1966,6 +1966,12 @@ Version relating to GNU Hurd systems. @item linux Version relating to Linux systems. +@item LoongArch64 +@item LoongArch_SF +@item LoongArch_F32 +@item LoongArch_F64 +Versions relating to the LoongArch family of processors. + @item MinGW Version relating to the MinGW environment. -- 2.42.1