cpu.odin 1.3 KB

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