<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Mar 28, 2017 at 4:31 PM Craig Topper <<a href="mailto:craig.topper@gmail.com">craig.topper@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">So if you use -march=hsw the backend will think rtm is enabled, but clang will block the intrinsics in the frontend?</div></blockquote><div><br></div><div>Yeah. I've come to the conclusion that I think we should remove the feature from the backend too. Using the option/feature in the frontend (or during codegen of any sort) will turn on the instruction in the backend and we should just rely on the option/feature.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Not sure what you mean by split the haswell and broadwell cpu.</div></div></blockquote><div><br></div><div>Into something similar to how the skylake cpu is configured in the front end with different feature sets. I don't really think it's a good idea here, but I thought I'd raise it.</div><div><br></div><div>Thoughts?</div><div><br></div><div>-eric</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra gmail_msg"></div><div class="gmail_extra gmail_msg"><br clear="all" class="gmail_msg"><div class="gmail_msg"><div class="m_-5662945790853440096gmail_signature gmail_msg" data-smartmail="gmail_signature">~Craig</div></div></div><div class="gmail_extra gmail_msg">
<br class="gmail_msg"><div class="gmail_quote gmail_msg">On Tue, Mar 28, 2017 at 4:18 PM, Eric Christopher <span dir="ltr" class="gmail_msg"><<a href="mailto:echristo@gmail.com" class="gmail_msg" target="_blank">echristo@gmail.com</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Hi Craig, Quentin, Jim,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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 class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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 class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">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><span class="m_-5662945790853440096HOEnZb gmail_msg"><font color="#888888" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div></font></span><div class="gmail_msg"><span class="m_-5662945790853440096HOEnZb gmail_msg"><font color="#888888" class="gmail_msg">-eric</font></span><div class="gmail_msg"><div class="m_-5662945790853440096h5 gmail_msg"><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Tue, Mar 28, 2017 at 4:15 PM Eric Christopher via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" class="gmail_msg" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: echristo<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
Date: Tue Mar 28 18:03:19 2017<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
New Revision: 298956<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=298956&view=rev" rel="noreferrer" class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=298956&view=rev</a><br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
Log:<br class="m_-5662945790853440096m_7454996103709562215gmail_msg 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="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
<br class="m_-5662945790853440096m_7454996103709562215gmail_msg 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="m_-5662945790853440096m_7454996103709562215gmail_msg 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="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
the -mrtm option will still work normally.<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
Modified:<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
cfe/trunk/lib/Basic/Targets.cpp<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
cfe/trunk/test/Preprocessor/predefined-arch-macros.c<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
Modified: cfe/trunk/lib/Basic/Targets.cpp<br class="m_-5662945790853440096m_7454996103709562215gmail_msg 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="m_-5662945790853440096m_7454996103709562215gmail_msg 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="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
==============================================================================<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
--- cfe/trunk/lib/Basic/Targets.cpp (original)<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
+++ cfe/trunk/lib/Basic/Targets.cpp Tue Mar 28 18:03:19 2017<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
@@ -3194,6 +3194,7 @@ bool X86TargetInfo::initFeatureMap(<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
setFeatureEnabledImpl(Features, "mpx", true);<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
setFeatureEnabledImpl(Features, "sgx", true);<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
setFeatureEnabledImpl(Features, "clflushopt", true);<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
+ setFeatureEnabledImpl(Features, "rtm", true);<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
LLVM_FALLTHROUGH;<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
case CK_Broadwell:<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
setFeatureEnabledImpl(Features, "rdseed", true);<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
@@ -3204,7 +3205,6 @@ bool X86TargetInfo::initFeatureMap(<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
setFeatureEnabledImpl(Features, "lzcnt", true);<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
setFeatureEnabledImpl(Features, "bmi", true);<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
setFeatureEnabledImpl(Features, "bmi2", true);<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
- setFeatureEnabledImpl(Features, "rtm", true);<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
setFeatureEnabledImpl(Features, "fma", true);<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
setFeatureEnabledImpl(Features, "movbe", true);<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
LLVM_FALLTHROUGH;<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
Modified: cfe/trunk/test/Preprocessor/predefined-arch-macros.c<br class="m_-5662945790853440096m_7454996103709562215gmail_msg 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="m_-5662945790853440096m_7454996103709562215gmail_msg 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="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
==============================================================================<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
--- cfe/trunk/test/Preprocessor/predefined-arch-macros.c (original)<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
+++ cfe/trunk/test/Preprocessor/predefined-arch-macros.c Tue Mar 28 18:03:19 2017<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
@@ -525,7 +525,6 @@<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_CORE_AVX2_M32: #define __PCLMUL__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_CORE_AVX2_M32: #define __POPCNT__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_CORE_AVX2_M32: #define __RDRND__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
-// CHECK_CORE_AVX2_M32: #define __RTM__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_CORE_AVX2_M32: #define __SSE2__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_CORE_AVX2_M32: #define __SSE3__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_CORE_AVX2_M32: #define __SSE4_1__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
@@ -555,7 +554,6 @@<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_CORE_AVX2_M64: #define __PCLMUL__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_CORE_AVX2_M64: #define __POPCNT__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_CORE_AVX2_M64: #define __RDRND__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
-// CHECK_CORE_AVX2_M64: #define __RTM__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_CORE_AVX2_M64: #define __SSE2_MATH__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_CORE_AVX2_M64: #define __SSE2__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_CORE_AVX2_M64: #define __SSE3__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
@@ -591,7 +589,6 @@<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_BROADWELL_M32: #define __POPCNT__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_BROADWELL_M32: #define __RDRND__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_BROADWELL_M32: #define __RDSEED__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
-// CHECK_BROADWELL_M32: #define __RTM__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_BROADWELL_M32: #define __SSE2__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_BROADWELL_M32: #define __SSE3__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_BROADWELL_M32: #define __SSE4_1__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
@@ -623,7 +620,6 @@<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_BROADWELL_M64: #define __POPCNT__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_BROADWELL_M64: #define __RDRND__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_BROADWELL_M64: #define __RDSEED__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
-// CHECK_BROADWELL_M64: #define __RTM__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_BROADWELL_M64: #define __SSE2_MATH__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_BROADWELL_M64: #define __SSE2__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
// CHECK_BROADWELL_M64: #define __SSE3__ 1<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
_______________________________________________<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
cfe-commits mailing list<br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
<a href="mailto:cfe-commits@lists.llvm.org" class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg" target="_blank">cfe-commits@lists.llvm.org</a><br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br class="m_-5662945790853440096m_7454996103709562215gmail_msg gmail_msg">
</blockquote></div></div></div></div></div>
</blockquote></div><br class="gmail_msg"></div></blockquote></div></div>