cpu_detect.h 759 B

123456789101112131415161718192021222324252627282930313233343536
  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. /// x86/x64 CPU capabilities that may be detected by this module
  7. struct CPUCaps {
  8. char cpu_string[0x21];
  9. char brand_string[0x41];
  10. bool sse;
  11. bool sse2;
  12. bool sse3;
  13. bool ssse3;
  14. bool sse4_1;
  15. bool sse4_2;
  16. bool lzcnt;
  17. bool avx;
  18. bool avx2;
  19. bool avx512;
  20. bool bmi1;
  21. bool bmi2;
  22. bool fma;
  23. bool fma4;
  24. bool aes;
  25. };
  26. /**
  27. * Gets the supported capabilities of the host CPU
  28. * @return Reference to a CPUCaps struct with the detected host CPU capabilities
  29. */
  30. const CPUCaps& GetCPUCaps();
  31. } // namespace Common