aboutsummaryrefslogtreecommitdiff
path: root/clang
diff options
context:
space:
mode:
authorYeting Kuo <46629943+yetingk@users.noreply.github.com>2023-11-08 00:05:16 +0800
committerGitHub <noreply@github.com>2023-11-08 00:05:16 +0800
commit75d6795e420274346b14aca8b6bd49bfe6030eeb (patch)
tree93558790ea77680764310d4ff1b9af6eeffb64de /clang
parentf0cdf4b468f6ee48b0d0d51ce78145455e2f07a6 (diff)
downloadllvm-75d6795e420274346b14aca8b6bd49bfe6030eeb.zip
llvm-75d6795e420274346b14aca8b6bd49bfe6030eeb.tar.gz
llvm-75d6795e420274346b14aca8b6bd49bfe6030eeb.tar.bz2
[RISCV][Clang][TargetParser] Support getting feature unaligned-scalar-mem from mcpu. (#71513)
This patch reference ac1ffd3caca12c254e0b8c847aa8ce8e51b6cfbf to suppot a soft coding way to identify whether a cpu has a feature `unaligned-scalar-mem` by `RISCVProcessors.td`. This patch does not provide test case since there is no risc-v cpu support `unaligned-scalar-mem` in llvm upstream now.
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Driver/ToolChains/Arch/RISCV.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
index a05f4b7..346fb67 100644
--- a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
@@ -63,6 +63,9 @@ static void getRISCFeaturesFromMcpu(const Driver &D, const Arg *A,
D.Diag(clang::diag::err_drv_unsupported_option_argument)
<< A->getSpelling() << Mcpu;
}
+
+ if (llvm::RISCV::hasFastUnalignedAccess(Mcpu))
+ Features.push_back("+unaligned-scalar-mem");
}
void riscv::getRISCVTargetFeatures(const Driver &D, const llvm::Triple &Triple,