[clang] [SPARC] Enable +ua2007 for -Av8plusd/-Av9d (PR #234060)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 20 20:15:53 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-driver
Author: Ying Huang (yingopq)
<details>
<summary>Changes</summary>
FMA instructions are modeled under ua2007, but the mappings for -Av8plusd/-Av9d omitted it, so `fmadds` failed to assemble with "instruction requires a CPU feature not currently enabled". Add +ua2007 to match GNU as.
Fix #<!-- -->225925.
---
Full diff: https://github.com/llvm/llvm-project/pull/234060.diff
2 Files Affected:
- (modified) clang/lib/Driver/ToolChains/Clang.cpp (+2-2)
- (modified) clang/test/Driver/sparc-ias-Wa.s (+2)
``````````diff
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index e856952e196886..e6ee08daf831f0 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -2798,11 +2798,11 @@ static void CollectArgsForIntegratedAssembler(Compilation &C,
.Case("-Av8plus", {"+v8plus", "+v9"})
.Case("-Av8plusa", {"+v8plus", "+v9", "+vis"})
.Case("-Av8plusb", {"+v8plus", "+v9", "+vis", "+vis2"})
- .Case("-Av8plusd", {"+v8plus", "+v9", "+vis", "+vis2", "+vis3"})
+ .Case("-Av8plusd", {"+v8plus", "+v9", "+vis", "+vis2", "+vis3", "+ua2007"})
.Case("-Av9", {"+v9"})
.Case("-Av9a", {"+v9", "+vis"})
.Case("-Av9b", {"+v9", "+vis", "+vis2"})
- .Case("-Av9d", {"+v9", "+vis", "+vis2", "+vis3"})
+ .Case("-Av9d", {"+v9", "+vis", "+vis2", "+vis3", "+ua2007"})
.Default({});
if (!SparcTargetFeatures.empty())
continue;
diff --git a/clang/test/Driver/sparc-ias-Wa.s b/clang/test/Driver/sparc-ias-Wa.s
index c031f237297d3b..1c4b48ef777d3f 100644
--- a/clang/test/Driver/sparc-ias-Wa.s
+++ b/clang/test/Driver/sparc-ias-Wa.s
@@ -32,6 +32,7 @@
// V8PLUSD: "-target-feature" "+vis"
// V8PLUSD: "-target-feature" "+vis2"
// V8PLUSD: "-target-feature" "+vis3"
+// V8PLUSD: "-target-feature" "+ua2007"
// RUN: %clang --target=sparc-linux-gnu -### -fintegrated-as -c %s -Wa,-Av9 2>&1 | \
// RUN: FileCheck -check-prefix=V9 %s
@@ -58,6 +59,7 @@
// V9D: "-target-feature" "+vis"
// V9D: "-target-feature" "+vis2"
// V9D: "-target-feature" "+vis3"
+// V9D: "-target-feature" "+ua2007"
// RUN: %clang --target=sparc64-linux-gnu -### -fintegrated-as -c %s 2>&1 | \
// RUN: FileCheck -check-prefix=VIS-DEFAULT %s
``````````
</details>
https://github.com/llvm/llvm-project/pull/234060
More information about the cfe-commits
mailing list