llvm-project/compiler-rt/lib
Roman Lebedev c62746ac6e
[X86] Fix AMD Znver3 model checks
While `-march=` is correctly detected as `znver3` for the cpu,
apparently the model check is incorrect:
```
$ lscpu
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         48 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  32
  On-line CPU(s) list:   0-31
Vendor ID:               AuthenticAMD
  Model name:            AMD Ryzen 9 5950X 16-Core Processor
    CPU family:          25
    Model:               33
    Thread(s) per core:  2
    Core(s) per socket:  16
    Socket(s):           1
    Stepping:            0
    Frequency boost:     disabled
    CPU max MHz:         6017.8462
    CPU min MHz:         2200.0000
    BogoMIPS:            8050.07
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse
                         3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_p
                         state ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbn
                         oinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm
Virtualization features:
  Virtualization:        AMD-V
Caches (sum of all):
  L1d:                   512 KiB (16 instances)
  L1i:                   512 KiB (16 instances)
  L2:                    8 MiB (16 instances)
  L3:                    64 MiB (2 instances)
NUMA:
  NUMA node(s):          1
  NUMA node0 CPU(s):     0-31
Vulnerabilities:
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP always-on, RSB filling
  Srbds:                 Not affected
  Tsx async abort:       Not affected
```

Model is 33 (0x21), while the code was expecting it to be `0x00 .. 0x1F`.
https://github.com/torvalds/linux/blob/v5.17-rc8/drivers/hwmon/k10temp.c#L432-L453 agrees.
I'm not sure if other ranges listed here should also be accepted.

I noticed this while implementing CPU model detection
for halide (https://github.com/halide/Halide/pull/6648)

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D121708
2022-03-15 20:28:02 +03:00
..
BlocksRuntime
asan [ASAN] Fix darwin-interface test 2022-03-15 06:14:07 -07:00
builtins [X86] Fix AMD Znver3 model checks 2022-03-15 20:28:02 +03:00
cfi sanitizer_common: prefix thread-safety macros with SANITIZER_ 2022-01-07 15:11:00 +01:00
crt Revert "[CMake][compiler-rt] Make CRT separately buildable" 2022-03-07 23:59:29 -08:00
dfsan [DFSan] Remove trampolines to unblock opaque pointers. (Reland with fix) 2022-03-14 16:03:25 -07:00
fuzzer Reapply "[cmake] Prefix gtest and gtest_main with "llvm_"." 2022-03-04 13:45:43 -08:00
gwp_asan Reapply "[cmake] Prefix gtest and gtest_main with "llvm_"." 2022-03-04 13:45:43 -08:00
hwasan [HWASan] Use hwasan_memalign for aligned new. 2022-02-23 14:22:03 -08:00
interception Reapply "[cmake] Prefix gtest and gtest_main with "llvm_"." 2022-03-04 13:45:43 -08:00
lsan [lsan] ppc64: dynamically pick address range for allocator 2022-03-11 20:16:17 -08:00
memprof Reland "[memprof] Refactor out the MemInfoBlock into a macro based def." 2022-02-14 16:05:05 -08:00
msan [msan] Fix unittest for 9397bdc6 2022-03-10 01:21:30 +00:00
orc Reapply "[cmake] Prefix gtest and gtest_main with "llvm_"." 2022-03-04 13:45:43 -08:00
profile [InstrProf][NFC] Fix warning by removing typecast 2022-03-04 10:48:25 -08:00
safestack Revert "sanitizers: increase .clang-format columns to 100" 2021-07-28 09:40:21 +02:00
sanitizer_common Revert "[MSAN] add interceptor for timer_create, timer_settime, timer_gettime" 2022-03-09 14:57:05 -08:00
scudo Reapply "[cmake] Prefix gtest and gtest_main with "llvm_"." 2022-03-04 13:45:43 -08:00
stats [compiler-rt] separate lsan, ubsan, stats configuration from SANITIZER_COMMON_SUPPORTED_OS 2021-11-10 19:16:20 -08:00
tsan tsan: fix another false positive related to open/close 2022-03-10 17:02:51 +01:00
ubsan sanitizer_common: make internal/external headers compatible 2022-02-11 19:39:44 +01:00
ubsan_minimal [compiler-rt] separate lsan, ubsan, stats configuration from SANITIZER_COMMON_SUPPORTED_OS 2021-11-10 19:16:20 -08:00
xray Reapply "[cmake] Prefix gtest and gtest_main with "llvm_"." 2022-03-04 13:45:43 -08:00
CMakeLists.txt [ORC-RT] Re-apply "Initial ORC Runtime directories and build..." with fixes. 2021-04-24 16:00:20 -07:00