[Clang][LoongArch] Handle -march/-m{single,double,soft}-float/-mfpu options
authorWeining Lu <luweining@loongson.cn>
Thu, 27 Oct 2022 12:28:56 +0000 (20:28 +0800)
committergonglingqin <gonglingqin@loongson.cn>
Thu, 10 Nov 2022 09:27:28 +0000 (17:27 +0800)
commit135a9272a4c99b7f960086d0bf9d7e7da4c0396d
tree5ccb8b8fbe2ce167358a0ae25d7f7c89f32621e7
parent098e20134af5d32a73bd124ca3ce001baa569cab
[Clang][LoongArch] Handle -march/-m{single,double,soft}-float/-mfpu options

This patch adds options -march, -msingle-float, -mdouble-float,
-msoft-float and -mfpu for LoongArch.

Clang options `msingle_float` and `mdouble_float` are moved from
`m_mips_Features_Group` to `m_Group` because now more than targets use
them.

Reference:
https://github.com/loongson/LoongArch-Documentation/blob/main/docs/LoongArch-toolchain-conventions-EN.adoc

TODO: add -mtune.

Differential Revision: https://reviews.llvm.org/D136146
18 files changed:
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/Arch/LoongArch.cpp
clang/lib/Driver/ToolChains/Arch/LoongArch.h
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Driver/ToolChains/Linux.cpp
clang/test/Driver/loongarch-default-features.c
clang/test/Driver/loongarch-march-error.c [new file with mode: 0644]
clang/test/Driver/loongarch-march.c [new file with mode: 0644]
clang/test/Driver/loongarch-mdouble-float.c [new file with mode: 0644]
clang/test/Driver/loongarch-mfpu-error.c [new file with mode: 0644]
clang/test/Driver/loongarch-mfpu.c [new file with mode: 0644]
clang/test/Driver/loongarch-msingle-float.c [new file with mode: 0644]
clang/test/Driver/loongarch-msoft-float.c [new file with mode: 0644]
llvm/include/llvm/Support/LoongArchTargetParser.def [new file with mode: 0644]
llvm/include/llvm/Support/LoongArchTargetParser.h [new file with mode: 0644]
llvm/lib/Support/CMakeLists.txt
llvm/lib/Support/LoongArchTargetParser.cpp [new file with mode: 0644]