cpu_detect.h 980 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright 2013 Dolphin Emulator Project / 2015 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. namespace Common {
  6. enum class Manufacturer : u32 {
  7. Intel = 0,
  8. AMD = 1,
  9. Hygon = 2,
  10. Unknown = 3,
  11. };
  12. /// x86/x64 CPU capabilities that may be detected by this module
  13. struct CPUCaps {
  14. Manufacturer manufacturer;
  15. char cpu_string[0x21];
  16. char brand_string[0x41];
  17. bool sse;
  18. bool sse2;
  19. bool sse3;
  20. bool ssse3;
  21. bool sse4_1;
  22. bool sse4_2;
  23. bool lzcnt;
  24. bool avx;
  25. bool avx2;
  26. bool avx512;
  27. bool bmi1;
  28. bool bmi2;
  29. bool fma;
  30. bool fma4;
  31. bool aes;
  32. bool invariant_tsc;
  33. u32 base_frequency;
  34. u32 max_frequency;
  35. u32 bus_frequency;
  36. };
  37. /**
  38. * Gets the supported capabilities of the host CPU
  39. * @return Reference to a CPUCaps struct with the detected host CPU capabilities
  40. */
  41. const CPUCaps& GetCPUCaps();
  42. } // namespace Common