[PATCH] D97504: [llvm-exegesis] Disable the LBR check on AMD

Petr Penzin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 9 22:30:56 PST 2021


ppenzin reopened this revision.
ppenzin added a comment.
This revision is now accepted and ready to land.

Order of registers in vendor string looks off, and I can see this patch breaking a project I am building.

Debugger walkthrough on AMD A10 running FreeBSD:

  (gdb) 
  515	  if (EBX == 0x756e6547 && ECX == 0x6c65746e && EDX == 0x49656e69)
  (gdb) 
  519	  if (EBX == 0x68747541 && ECX == 0x69746e65 && EDX == 0x444d4163)
  (gdb) 
  522	  return VendorSignatures::UNKNOWN;
  (gdb) p/x EBX
  $2 = 0x68747541
  (gdb) p/x ECX
  $3 = 0x444d4163
  (gdb) p/x EDX
  $4 = 0x69746e65

I think the latter two registers are in wrong order (see inline comment).



================
Comment at: llvm/lib/Support/Host.cpp:514-519
+  // "Genu ineI ntel"
+  if (EBX == 0x756e6547 && ECX == 0x6c65746e && EDX == 0x49656e69)
+    return VendorSignatures::GENUINE_INTEL;
+
+  // "Auth enti cAMD"
+  if (EBX == 0x68747541 && ECX == 0x69746e65 && EDX == 0x444d4163)
----------------
I think you have ECX and EDX flipped around, vendor string supposed to be read from EBX, EDX, ECX (in order): https://en.wikipedia.org/wiki/CPUID#EAX=0:_Highest_Function_Parameter_and_Manufacturer_ID

I can observe this patch returning `UNKNOWN` instead of `AUTHENTIC_AMD` on AMD A10 running FreeBSD.




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97504/new/

https://reviews.llvm.org/D97504



More information about the llvm-commits mailing list