-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[clang][driver] Use rva22u64_v as the default march for Fuchsia targets #131183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
@llvm/pr-subscribers-clang-driver @llvm/pr-subscribers-clang Author: Paul Kirth (ilovepi) ChangesFuchsia supports RVA22 + Vector as outlined in https://fuchsia.dev/fuchsia-src/contribute/governance/rfcs/0234_riscv_abi_rva22+v?hl=en Full diff: https://github.com/llvm/llvm-project/pull/131183.diff 2 Files Affected:
diff --git a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
index 776dc81027046..a6c29af1df762 100644
--- a/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
@@ -325,7 +325,8 @@ std::string riscv::getRISCVArch(const llvm::opt::ArgList &Args,
if (MABI.starts_with_insensitive("lp64")) {
if (Triple.isAndroid())
return "rv64imafdcv_zba_zbb_zbs";
-
+ if(Triple.isOSFuchsia())
+ return "rva22u64_v";
return "rv64imafdc";
}
}
@@ -345,6 +346,8 @@ std::string riscv::getRISCVArch(const llvm::opt::ArgList &Args,
return "rv64imac";
if (Triple.isAndroid())
return "rv64imafdcv_zba_zbb_zbs";
+ if (Triple.isOSFuchsia())
+ return "rva22u64_v";
return "rv64imafdc";
}
diff --git a/clang/test/Driver/riscv-features.c b/clang/test/Driver/riscv-features.c
index b58ec3b523e5c..80dec2c71f985 100644
--- a/clang/test/Driver/riscv-features.c
+++ b/clang/test/Driver/riscv-features.c
@@ -73,3 +73,15 @@
// ERR-SPLIT-DWARF: error: -gsplit-dwarf{{.*}} is unsupported with RISC-V linker relaxation (-mrelax)
// SPLIT-DWARF: "-split-dwarf-file"
+
+// RUN: %clang -mabi=lp64d --target=riscv64-unknown-fuchsia -### %s -fsyntax-only 2>&1 | FileCheck %s -check-prefixes=FUCHSIA
+// FUCHSIA: "-target-feature" "+m"
+// FUCHSIA-SAME: "-target-feature" "+a"
+// FUCHSIA-SAME: "-target-feature" "+f"
+// FUCHSIA-SAME: "-target-feature" "+d"
+// FUCHSIA-SAME: "-target-feature" "+c"
+// FUCHSIA-SAME: "-target-feature" "+v"
+// FUCHSIA-SAME: "-target-feature" "+zba"
+// FUCHSIA-SAME: "-target-feature" "+zbb"
+// FUCHSIA-SAME: "-target-feature" "+zbs"
+
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
hiraditya
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
e36cc43 to
8ea1c37
Compare
8ea1c37 to
30a2a3b
Compare

Fuchsia supports RVA22 + Vector as outlined in https://fuchsia.dev/fuchsia-src/contribute/governance/rfcs/0234_riscv_abi_rva22+v?hl=en