cpu.features readonly


This property gets instruction sets supported by the CPU, as a table with the following fields:

  • MMX: true if the CPU supports MMX instruction set, or false otherwise.
  • SSE: true if the CPU supports SSE instruction set, or false otherwise.
  • SSE2: true if the CPU supports SSE2 instruction set, or false otherwise.
  • SSE3: true if the CPU supports SSE3 instruction set, or false otherwise.
  • SSSE3: true if the CPU supports SSSE3 instruction set, or false otherwise.
  • SSE4_1: true if the CPU supports SSE4.1 instruction set, or false otherwise.
  • SSE4_2: true if the CPU supports SSE4.2 instruction set, or false otherwise.
  • AVX: true if the CPU supports AVX instruction set, or false otherwise.
  • AVX2: true if the CPU supports AVX2 instruction set, or false otherwise.

Example

--! luart-extensions import cpu for feature, supported in pairs(cpu.features) do print(feature..":\t", supported and "supported" or "not supported") end