[PATCH] D145809: [RISCV] Error if F and Zfinx extensions are specified together.
Craig Topper via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 10 09:44:04 PST 2023
craig.topper created this revision.
craig.topper added reviewers: reames, jrtc27, kito-cheng, asb.
Herald added subscribers: luke, VincentWu, vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya, arichardson.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added subscribers: cfe-commits, pcwang-thead, eopXD, MaskRay.
Herald added projects: clang, LLVM.
Repository:
rG LLVM Github Monorepo
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,8 @@
// 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145809.504187.patch
Type: text/x-patch
Size: 1243 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230310/80ebf87e/attachment.bin>
More information about the cfe-commits
mailing list