<div dir="ltr">Hi Craig, Quentin, Jim,<div><br></div><div>Just bringing this patch to your attention here. I haven't turned it off in the backend since some processors do support it and we want to allow the code generation, with this change we simply make the user use -mrtm to get the functionality for now.</div><div><br></div><div>Question: Do we want to split the haswell and broadwell cpu to handle this different feature set or just leave it as an optional "enable it yourself" since it's an errata fix?</div><div><br></div><div>I went ahead and committed with this question outstanding so that users won't get illegal instructions if they happen to have the affected units.</div><div><br></div><div>-eric<br><br><div class="gmail_quote"><div dir="ltr">On Tue, Mar 28, 2017 at 4:15 PM Eric Christopher via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: echristo<br class="gmail_msg">
Date: Tue Mar 28 18:03:19 2017<br class="gmail_msg">
New Revision: 298956<br class="gmail_msg">
<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=298956&view=rev" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=298956&view=rev</a><br class="gmail_msg">
Log:<br class="gmail_msg">
Default enable the rtm feature only on skylake and later for now because Intel disabled the feature on some haswell and broadwell processors:<br class="gmail_msg">
<br class="gmail_msg">
<a href="http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/core-m-processor-family-spec-update.pdf" rel="noreferrer" class="gmail_msg" target="_blank">http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/core-m-processor-family-spec-update.pdf</a><br class="gmail_msg">
<br class="gmail_msg">
the -mrtm option will still work normally.<br class="gmail_msg">
<br class="gmail_msg">
Modified:<br class="gmail_msg">
    cfe/trunk/lib/Basic/Targets.cpp<br class="gmail_msg">
    cfe/trunk/test/Preprocessor/predefined-arch-macros.c<br class="gmail_msg">
<br class="gmail_msg">
Modified: cfe/trunk/lib/Basic/Targets.cpp<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=298956&r1=298955&r2=298956&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=298956&r1=298955&r2=298956&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- cfe/trunk/lib/Basic/Targets.cpp (original)<br class="gmail_msg">
+++ cfe/trunk/lib/Basic/Targets.cpp Tue Mar 28 18:03:19 2017<br class="gmail_msg">
@@ -3194,6 +3194,7 @@ bool X86TargetInfo::initFeatureMap(<br class="gmail_msg">
     setFeatureEnabledImpl(Features, "mpx", true);<br class="gmail_msg">
     setFeatureEnabledImpl(Features, "sgx", true);<br class="gmail_msg">
     setFeatureEnabledImpl(Features, "clflushopt", true);<br class="gmail_msg">
+    setFeatureEnabledImpl(Features, "rtm", true);<br class="gmail_msg">
     LLVM_FALLTHROUGH;<br class="gmail_msg">
   case CK_Broadwell:<br class="gmail_msg">
     setFeatureEnabledImpl(Features, "rdseed", true);<br class="gmail_msg">
@@ -3204,7 +3205,6 @@ bool X86TargetInfo::initFeatureMap(<br class="gmail_msg">
     setFeatureEnabledImpl(Features, "lzcnt", true);<br class="gmail_msg">
     setFeatureEnabledImpl(Features, "bmi", true);<br class="gmail_msg">
     setFeatureEnabledImpl(Features, "bmi2", true);<br class="gmail_msg">
-    setFeatureEnabledImpl(Features, "rtm", true);<br class="gmail_msg">
     setFeatureEnabledImpl(Features, "fma", true);<br class="gmail_msg">
     setFeatureEnabledImpl(Features, "movbe", true);<br class="gmail_msg">
     LLVM_FALLTHROUGH;<br class="gmail_msg">
<br class="gmail_msg">
Modified: cfe/trunk/test/Preprocessor/predefined-arch-macros.c<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/predefined-arch-macros.c?rev=298956&r1=298955&r2=298956&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/predefined-arch-macros.c?rev=298956&r1=298955&r2=298956&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- cfe/trunk/test/Preprocessor/predefined-arch-macros.c (original)<br class="gmail_msg">
+++ cfe/trunk/test/Preprocessor/predefined-arch-macros.c Tue Mar 28 18:03:19 2017<br class="gmail_msg">
@@ -525,7 +525,6 @@<br class="gmail_msg">
 // CHECK_CORE_AVX2_M32: #define __PCLMUL__ 1<br class="gmail_msg">
 // CHECK_CORE_AVX2_M32: #define __POPCNT__ 1<br class="gmail_msg">
 // CHECK_CORE_AVX2_M32: #define __RDRND__ 1<br class="gmail_msg">
-// CHECK_CORE_AVX2_M32: #define __RTM__ 1<br class="gmail_msg">
 // CHECK_CORE_AVX2_M32: #define __SSE2__ 1<br class="gmail_msg">
 // CHECK_CORE_AVX2_M32: #define __SSE3__ 1<br class="gmail_msg">
 // CHECK_CORE_AVX2_M32: #define __SSE4_1__ 1<br class="gmail_msg">
@@ -555,7 +554,6 @@<br class="gmail_msg">
 // CHECK_CORE_AVX2_M64: #define __PCLMUL__ 1<br class="gmail_msg">
 // CHECK_CORE_AVX2_M64: #define __POPCNT__ 1<br class="gmail_msg">
 // CHECK_CORE_AVX2_M64: #define __RDRND__ 1<br class="gmail_msg">
-// CHECK_CORE_AVX2_M64: #define __RTM__ 1<br class="gmail_msg">
 // CHECK_CORE_AVX2_M64: #define __SSE2_MATH__ 1<br class="gmail_msg">
 // CHECK_CORE_AVX2_M64: #define __SSE2__ 1<br class="gmail_msg">
 // CHECK_CORE_AVX2_M64: #define __SSE3__ 1<br class="gmail_msg">
@@ -591,7 +589,6 @@<br class="gmail_msg">
 // CHECK_BROADWELL_M32: #define __POPCNT__ 1<br class="gmail_msg">
 // CHECK_BROADWELL_M32: #define __RDRND__ 1<br class="gmail_msg">
 // CHECK_BROADWELL_M32: #define __RDSEED__ 1<br class="gmail_msg">
-// CHECK_BROADWELL_M32: #define __RTM__ 1<br class="gmail_msg">
 // CHECK_BROADWELL_M32: #define __SSE2__ 1<br class="gmail_msg">
 // CHECK_BROADWELL_M32: #define __SSE3__ 1<br class="gmail_msg">
 // CHECK_BROADWELL_M32: #define __SSE4_1__ 1<br class="gmail_msg">
@@ -623,7 +620,6 @@<br class="gmail_msg">
 // CHECK_BROADWELL_M64: #define __POPCNT__ 1<br class="gmail_msg">
 // CHECK_BROADWELL_M64: #define __RDRND__ 1<br class="gmail_msg">
 // CHECK_BROADWELL_M64: #define __RDSEED__ 1<br class="gmail_msg">
-// CHECK_BROADWELL_M64: #define __RTM__ 1<br class="gmail_msg">
 // CHECK_BROADWELL_M64: #define __SSE2_MATH__ 1<br class="gmail_msg">
 // CHECK_BROADWELL_M64: #define __SSE2__ 1<br class="gmail_msg">
 // CHECK_BROADWELL_M64: #define __SSE3__ 1<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
cfe-commits mailing list<br class="gmail_msg">
<a href="mailto:cfe-commits@lists.llvm.org" class="gmail_msg" target="_blank">cfe-commits@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br class="gmail_msg">
</blockquote></div></div></div>