[PATCH] D48982: [mips] Add '-mvirt', '-mno-virt', '-mginv', '-mno-ginv' options
Vladimir Stefanovic via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 5 10:49:56 PDT 2018
vstefanovic created this revision.
vstefanovic added a reviewer: atanasyan.
Herald added subscribers: cfe-commits, arichardson, sdardis.
'-mvirt'/'-mno-virt' enables/disables Virtualization ASE.
'-mginv'/'-mno-ginv' enables/disables GINV (Global Invalidate) ASE.
Repository:
rC Clang
https://reviews.llvm.org/D48982
Files:
include/clang/Driver/Options.td
lib/Driver/ToolChains/Arch/Mips.cpp
test/Driver/mips-features.c
Index: test/Driver/mips-features.c
===================================================================
--- test/Driver/mips-features.c
+++ test/Driver/mips-features.c
@@ -420,3 +420,27 @@
// RUN: -mcrc -mno-crc 2>&1 \
// RUN: | FileCheck --check-prefix=CHECK-NO-CRC %s
// CHECK-NO-CRC: "-target-feature" "-crc"
+//
+// -mvirt
+// RUN: %clang -target mips-unknown-linux-gnu -### -c %s \
+// RUN: -mno-virt -mvirt 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-VIRT %s
+// CHECK-VIRT: "-target-feature" "+virt"
+//
+// -mno-virt
+// RUN: %clang -target mips-unknown-linux-gnu -### -c %s \
+// RUN: -mvirt -mno-virt 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NO-VIRT %s
+// CHECK-NO-VIRT: "-target-feature" "-virt"
+//
+// -mginv
+// RUN: %clang -target mips-unknown-linux-gnu -### -c %s \
+// RUN: -mno-ginv -mginv 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-GINV %s
+// CHECK-GINV: "-target-feature" "+ginv"
+//
+// -mno-ginv
+// RUN: %clang -target mips-unknown-linux-gnu -### -c %s \
+// RUN: -mginv -mno-ginv 2>&1 \
+// RUN: | FileCheck --check-prefix=CHECK-NO-GINV %s
+// CHECK-NO-GINV: "-target-feature" "-ginv"
Index: lib/Driver/ToolChains/Arch/Mips.cpp
===================================================================
--- lib/Driver/ToolChains/Arch/Mips.cpp
+++ lib/Driver/ToolChains/Arch/Mips.cpp
@@ -352,6 +352,10 @@
AddTargetFeature(Args, Features, options::OPT_mmt, options::OPT_mno_mt, "mt");
AddTargetFeature(Args, Features, options::OPT_mcrc, options::OPT_mno_crc,
"crc");
+ AddTargetFeature(Args, Features, options::OPT_mvirt, options::OPT_mno_virt,
+ "virt");
+ AddTargetFeature(Args, Features, options::OPT_mginv, options::OPT_mno_ginv,
+ "ginv");
if (Arg *A = Args.getLastArg(options::OPT_mindirect_jump_EQ)) {
StringRef Val = StringRef(A->getValue());
Index: include/clang/Driver/Options.td
===================================================================
--- include/clang/Driver/Options.td
+++ include/clang/Driver/Options.td
@@ -2214,6 +2214,10 @@
HelpText<"Disable SVR4-style position-independent code (Mips only)">;
def mno_crc : Flag<["-"], "mno-crc">, Group<m_mips_Features_Group>,
HelpText<"Disallow use of CRC instructions (Mips only)">;
+def mvirt : Flag<["-"], "mvirt">, Group<m_mips_Features_Group>;
+def mno_virt : Flag<["-"], "mno-virt">, Group<m_mips_Features_Group>;
+def mginv : Flag<["-"], "mginv">, Group<m_mips_Features_Group>;
+def mno_ginv : Flag<["-"], "mno-ginv">, Group<m_mips_Features_Group>;
def mips1 : Flag<["-"], "mips1">,
Alias<march_EQ>, AliasArgs<["mips1"]>, Group<m_mips_Features_Group>,
HelpText<"Equivalent to -march=mips1">, Flags<[HelpHidden]>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48982.154267.patch
Type: text/x-patch
Size: 2741 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180705/1b7b0864/attachment.bin>
More information about the cfe-commits
mailing list