From 2edd37a6acc2febf831b9125f36d2853c795843f Mon Sep 17 00:00:00 2001
From: Patric Hedlin <phedlin@openjdk.org>
Date: Wed, 6 Dec 2017 13:07:21 +0100
Subject: [PATCH] 8191339: [JVMCI] BigInteger compiler intrinsics on Graal

Reviewed-by: kvn
---
 src/hotspot/cpu/x86/vm_version_x86.cpp    |  6 ++----
 src/hotspot/share/jvmci/jvmci_globals.hpp | 17 ++++++++++++++++-
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/src/hotspot/cpu/x86/vm_version_x86.cpp b/src/hotspot/cpu/x86/vm_version_x86.cpp
index 14d414d753b..a621609fd71 100644
--- a/src/hotspot/cpu/x86/vm_version_x86.cpp
+++ b/src/hotspot/cpu/x86/vm_version_x86.cpp
@@ -1042,9 +1042,7 @@ void VM_Version::get_processor_features() {
     }
   }
 #endif // COMPILER2 && ASSERT
-#endif // COMPILER2_OR_JVMCI
 
-#ifdef COMPILER2
 #ifdef _LP64
   if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) {
     UseMultiplyToLenIntrinsic = true;
@@ -1092,8 +1090,8 @@ void VM_Version::get_processor_features() {
     }
     FLAG_SET_DEFAULT(UseMulAddIntrinsic, false);
   }
-#endif
-#endif // COMPILER2
+#endif // _LP64
+#endif // COMPILER2_OR_JVMCI
 
   // On new cpus instructions which update whole XMM register should be used
   // to prevent partial register stall due to dependencies on high half.
diff --git a/src/hotspot/share/jvmci/jvmci_globals.hpp b/src/hotspot/share/jvmci/jvmci_globals.hpp
index a88ed845df3..b3e3ff56f8b 100644
--- a/src/hotspot/share/jvmci/jvmci_globals.hpp
+++ b/src/hotspot/share/jvmci/jvmci_globals.hpp
@@ -98,7 +98,22 @@
           "Number of methods to record in call profile")                    \
                                                                             \
   develop(bool, TraceUncollectedSpeculations, false,                        \
-          "Print message when a failed speculation was not collected")
+          "Print message when a failed speculation was not collected")      \
+                                                                            \
+  NOT_COMPILER2(diagnostic(bool, UseMultiplyToLenIntrinsic, false,          \
+          "Enables intrinsification of BigInteger.multiplyToLen()"))        \
+                                                                            \
+  NOT_COMPILER2(diagnostic(bool, UseSquareToLenIntrinsic, false,            \
+          "Enables intrinsification of BigInteger.squareToLen()"))          \
+                                                                            \
+  NOT_COMPILER2(diagnostic(bool, UseMulAddIntrinsic, false,                 \
+          "Enables intrinsification of BigInteger.mulAdd()"))               \
+                                                                            \
+  NOT_COMPILER2(diagnostic(bool, UseMontgomeryMultiplyIntrinsic, false,     \
+          "Enables intrinsification of BigInteger.montgomeryMultiply()"))   \
+                                                                            \
+  NOT_COMPILER2(diagnostic(bool, UseMontgomerySquareIntrinsic, false,       \
+          "Enables intrinsification of BigInteger.montgomerySquare()"))
 
 
 // Read default values for JVMCI globals