cpu.odin 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. package sys_cpu
  2. Cache_Line_Pad :: struct {_: [_cache_line_size]byte};
  3. initialized: bool;
  4. x86: struct {
  5. _: Cache_Line_Pad,
  6. has_aes: bool, // AES hardware implementation (AES NI)
  7. has_adx: bool, // Multi-precision add-carry instruction extensions
  8. has_avx: bool, // Advanced vector extension
  9. has_avx2: bool, // Advanced vector extension 2
  10. has_bmi1: bool, // Bit manipulation instruction set 1
  11. has_bmi2: bool, // Bit manipulation instruction set 2
  12. has_erms: bool, // Enhanced REP for MOVSB and STOSB
  13. has_fma: bool, // Fused-multiply-add instructions
  14. has_os_xsave: bool, // OS supports XSAVE/XRESTOR for saving/restoring XMM registers.
  15. has_pclmulqdq: bool, // PCLMULQDQ instruction - most often used for AES-GCM
  16. has_popcnt: bool, // Hamming weight instruction POPCNT.
  17. has_rdrand: bool, // RDRAND instruction (on-chip random number generator)
  18. has_rdseed: bool, // RDSEED instruction (on-chip random number generator)
  19. has_sse2: bool, // Streaming SIMD extension 2 (always available on amd64)
  20. has_sse3: bool, // Streaming SIMD extension 3
  21. has_ssse3: bool, // Supplemental streaming SIMD extension 3
  22. has_sse41: bool, // Streaming SIMD extension 4 and 4.1
  23. has_sse42: bool, // Streaming SIMD extension 4 and 4.2
  24. _: Cache_Line_Pad,
  25. };
  26. init :: proc() {
  27. _init();
  28. }