]> granicus.if.org Git - clang/commitdiff
[mips] Add '-mvirt', '-mno-virt', '-mginv', '-mno-ginv' options
authorVladimir Stefanovic <vladimir.stefanovic@rt-rk.com>
Wed, 11 Jul 2018 12:45:25 +0000 (12:45 +0000)
committerVladimir Stefanovic <vladimir.stefanovic@rt-rk.com>
Wed, 11 Jul 2018 12:45:25 +0000 (12:45 +0000)
'-mvirt'/'-mno-virt' enables/disables Virtualization ASE.
'-mginv'/'-mno-ginv' enables/disables GINV (Global Invalidate) ASE.

Differential revision: https://reviews.llvm.org/D48982

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336798 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Options.td
lib/Driver/ToolChains/Arch/Mips.cpp
test/Driver/mips-features.c

index 4a5aa904e4725240aee761f8c18bcba1f6ff0228..5a7e5c9e4e530971016cc55f332111f5d0cfdb29 100644 (file)
@@ -2216,6 +2216,10 @@ def mno_abicalls : Flag<["-"], "mno-abicalls">, Group<m_mips_Features_Group>,
   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]>;
index 0c0e0907193e9de94ed81fe0cf8fb6f9d2877194..6d814631d05f6bea5e88966301477f8c3fa2d99a 100644 (file)
@@ -352,6 +352,10 @@ void mips::getMIPSTargetFeatures(const Driver &D, const llvm::Triple &Triple,
   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 e90f3704f2fc8e3286ee75cf46bd683a1bb3fcfe..f63fb8de55d6c9398953b62ffb86d593826a2659 100644 (file)
 // 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"