Commit d1603c3
[X86] Workaround possible CPUID bug in Sandy Bridge.
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.
This is causing avxvnniint16 to be incorrectly enabled with -march=native
on these CPUs.
Reviewed By: pengfei, anna
Differential Revision: https://reviews.llvm.org/D156963
(cherry picked from commit 2a5e3f4)1 parent 51a4700 commit d1603c3
File tree
2 files changed
+12
-3
lines changed- compiler-rt/lib/builtins
- llvm/lib/TargetParser
2 files changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
751 | 751 | | |
752 | 752 | | |
753 | 753 | | |
| 754 | + | |
| 755 | + | |
754 | 756 | | |
755 | | - | |
| 757 | + | |
| 758 | + | |
756 | 759 | | |
757 | 760 | | |
758 | 761 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1241 | 1241 | | |
1242 | 1242 | | |
1243 | 1243 | | |
| 1244 | + | |
| 1245 | + | |
1244 | 1246 | | |
1245 | | - | |
| 1247 | + | |
| 1248 | + | |
1246 | 1249 | | |
1247 | 1250 | | |
1248 | 1251 | | |
| |||
1750 | 1753 | | |
1751 | 1754 | | |
1752 | 1755 | | |
| 1756 | + | |
| 1757 | + | |
1753 | 1758 | | |
1754 | | - | |
| 1759 | + | |
| 1760 | + | |
1755 | 1761 | | |
1756 | 1762 | | |
1757 | 1763 | | |
| |||
0 commit comments