SHARE
TWEET

Untitled

a guest Jan 21st, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from cpuid import *
  2.  
  3. def _is_set(id, reg_idx, bit):
  4.     regs = cpuid(id)
  5.  
  6.     if (1 << bit) & regs[reg_idx]:
  7.         return "Yes"
  8.     else:
  9.         return "--"
  10.  
  11. print("Vendor ID         : %s" % cpu_vendor())
  12. print("CPU name          : %s" % cpu_name())
  13. print("Microarchitecture : %s%s" % cpu_microarchitecture())
  14. print("Vector instructions supported:")
  15. print("SSE       : %s" % _is_set(1, 3, 25))
  16. print("SSE2      : %s" % _is_set(1, 3, 26))
  17. print("SSE3      : %s" % _is_set(1, 2, 0))
  18. print("SSSE3     : %s" % _is_set(1, 2, 9))
  19. print("SSE4.1    : %s" % _is_set(1, 2, 19))
  20. print("SSE4.2    : %s" % _is_set(1, 2, 20))
  21. print("SSE4a     : %s" % _is_set(0x80000001, 2, 6))
  22. print("AVX       : %s" % _is_set(1, 2, 28))
  23. print("AVX2      : %s" % _is_set(7, 1, 5))
  24. print("BMI1      : %s" % _is_set(7, 1, 3))
  25. print("BMI2      : %s" % _is_set(7, 1, 8))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top