<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64389>64389</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Backport 2a5e3f4c6c2cdd2aab55fbfdb703ca8163351ea9 to llvm 17
</td>
</tr>
<tr>
<th>Labels</th>
<td>
release:backport
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
topperc
</td>
</tr>
</table>
<pre>
This patch works around what appears to be a CPUID bug in some Sandy Bridge CPUs. That will cause avxvnniint16 to be incorrectly enabled with -march=native on those CPUs.
Patch description:
Don't access leaf 7 subleaf 1 unless subleaf 0 says it is
supported via EAX.
Intel documentation says invalid subleaves return 0. We had been
relying on that behavior instead of checking the max sublef number.
It appears that some Sandy Bridge CPUs return at least the subleaf 0
EDX value for subleaf 1. Best guess is that this is a bug in a
microcode patch since all of the bits we're seeing set in EDX were
introduced after Sandy Bridge was originally released.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsk8GOozgQhp-GXEqNwA4hOXDo3kykuY20s9q5lu0CvG1s5DJk8vYrp-llVpoLWLbrq_8vVyGzHTxRVzRvRXM94JLGELsU5pmiPqhgHt330TLMmPQI9xDfGTCGxRu4j5gA55kwMqQAigDhj29_fb2CWgawHjhMBH-iNw94i9YMlI-5hO858m6dA40LE-D6c_XeWp_q00ayXocYSSf3APKoHBm42zTCy4RRj4W8ekx2JQge0hh4QxfVtaheP77fnpINsY52Tjb4Qr7-eg4AcA2-EG0C1JqYwRH20AIv6rmqYfEu739uVMD4YLAJLO8QXuY5xEQGVovw5fVHuZ_tq68-kQMT9DKRT5gFbTS_orNmS7ISQ6S0RA9VCX8TjGhAEfmdFMk9rB8-rGMCRSOuNkSwnhOhgdCDHkm_50tpJJjw5we9B79MiuLvBf7ymhn7-9f7FIcpV4vTM8F_9dlpX64_YEW3EPQh7hUt4Y04wbDkstotU8odZhnws3Fw50xWx6CDoa0F2XpNgM5llzm3sonhToVoIwETZdNMKWOyhjtF2mnWpxjMoskA9oni__3dkSFEO1iPzj1ynQmZTHkwnTQXecEDdfXpUlftqb1Uh7E7Vu2FTE8XhUK3TdvU-kTHo6BaynMr24PtRCVkda5k3UhZV2V_1r2pUIhWSdVrUxwrmtC60rl1KkMcDpZ5oe50lOfLwaEix8_hFGKTU8hXhfo9d1whRB7a2OXgF7UMXBwrZznxjks2OeretggQ2JDsj_qkhTZGIKqm6VVvVFtJjef6JGVTE17yGGYG1O1hia4bU5o5D5C4FeI22DQuqtRhKsQtX9t-L3MM_5BOhbg9bXAhbk8n_wYAAP__XxNyDQ">