This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] libitm: add HTM fastpath


Hello!

> This patch adds support for using strongly-isolated HTMs with
> serial-irrevocable mode as fallback.  Such HTMs can execute
> uninstrumented code transactionally, and eventually aborted transactions
> will cause no visible side effects.  Data conflicts with
> nontransactional accesses lead to transactions being aborted.

+static inline bool
+htm_available ()
+{
+  const unsigned cpuid_rtm = (1 << 11);
+  if (__get_cpuid_max (0, NULL) >= 7)
+    {
+      unsigned a, b, c, d;
+      __cpuid_count (7, 0, a, b, c, d);
+      if (b & cpuid_rtm)
+	return true;
+    }
+  return false;

You can use bit_RTM from cpuid.h instead of cpuid_rtm here.

Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]