[PATCH] D145809: [RISCV] Error if F and Zfinx extensions are specified together.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 10 10:12:05 PST 2023
craig.topper updated this revision to Diff 504203.
craig.topper added a comment.
Add test for D and Zdinx which will produce the same error as F and Zfinx.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D145809/new/
https://reviews.llvm.org/D145809
Files:
clang/test/Driver/riscv-arch.c
llvm/lib/Support/RISCVISAInfo.cpp
Index: llvm/lib/Support/RISCVISAInfo.cpp
===================================================================
--- llvm/lib/Support/RISCVISAInfo.cpp
+++ llvm/lib/Support/RISCVISAInfo.cpp
@@ -839,6 +839,10 @@
errc::invalid_argument,
"standard user-level extension 'e' requires 'rv32'");
+ if (HasF && HasZfinx)
+ return createStringError(errc::invalid_argument,
+ "'f' and 'zfinx' extensions are incompatible");
+
if (HasZve32f && !HasF && !HasZfinx)
return createStringError(
errc::invalid_argument,
Index: clang/test/Driver/riscv-arch.c
===================================================================
--- clang/test/Driver/riscv-arch.c
+++ clang/test/Driver/riscv-arch.c
@@ -583,3 +583,13 @@
// RUN: %clang -target riscv32-unknown-elf -march=rv32i_zmmul1p0 -### %s \
// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-ZMMUL-GOODVERS %s
// RV32-ZMMUL-GOODVERS: "-target-feature" "+zmmul"
+
+// RUN: %clang --target=riscv32-unknown-elf -march=rv32ifzfinx -### %s \
+// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-F-ZFINX-ER %s
+// RV32-F-ZFINX-ER: error: invalid arch name 'rv32ifzfinx',
+// RV32-F-ZFINX-ER: 'f' and 'zfinx' extensions are incompatible
+
+// RUN: %clang --target=riscv32-unknown-elf -march=rv32idzdinx -### %s \
+// RUN: -fsyntax-only 2>&1 | FileCheck -check-prefix=RV32-D-ZDINX-ER %s
+// RV32-D-ZDINX-ER: error: invalid arch name 'rv32idzdinx',
+// RV32-D-ZFINX-ER: 'f' and 'zfinx' extensions are incompatible
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145809.504203.patch
Type: text/x-patch
Size: 1519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230310/6bdc0d03/attachment.bin>
More information about the llvm-commits
mailing list