LibreOffice Module tools (master) 1
Enumerations | Functions
cpuid Namespace Reference

Enumerations

enum class  InstructionSetFlags {
  NONE = 0x00 ,
  HYPER = 0x01 ,
  SSE2 = 0x02 ,
  SSSE3 = 0x04 ,
  SSE41 = 0x08 ,
  SSE42 = 0x10 ,
  AVX = 0x20 ,
  AVX2 = 0x40 ,
  AVX512F = 0x80
}
 

Functions

InstructionSetFlags getCpuInstructionSetFlags ()
 Get supported instruction set flags determined at runtime by probing the CPU. More...
 
bool isCpuInstructionSetSupported (InstructionSetFlags eInstructions)
 Check if a certain instruction set is supported by the CPU at runtime. More...
 
OUString instructionSetSupportedString ()
 Returns a string of supported instructions. More...
 
bool hasSSE2 ()
 Check if SSE2 is supported by the CPU. More...
 
bool hasSSSE3 ()
 Check if SSSE3 is supported by the CPU. More...
 
bool hasAVX ()
 Check if AVX is supported by the CPU. More...
 
bool hasAVX2 ()
 Check if AVX2 is supported by the CPU. More...
 
bool hasAVX512F ()
 Check if AVX512F is supported by the CPU. More...
 
bool hasHyperThreading ()
 Check if Hyper Threading is supported. More...
 

Enumeration Type Documentation

◆ InstructionSetFlags

enum class cpuid::InstructionSetFlags
strong
Enumerator
NONE 
HYPER 
SSE2 
SSSE3 
SSE41 
SSE42 
AVX 
AVX2 
AVX512F 

Definition at line 32 of file cpuid.hxx.

Function Documentation

◆ getCpuInstructionSetFlags()

TOOLS_DLLPUBLIC InstructionSetFlags cpuid::getCpuInstructionSetFlags ( )

Get supported instruction set flags determined at runtime by probing the CPU.

Definition at line 61 of file cpuid.cxx.

References AVX, AVX2, AVX2_bit, AVX512F, AVX512F_bit, AVX_bit, HYPER, HYPER_bit, NONE, SSE2, SSE2_bit, SSE41, SSE41_bit, SSE42, SSE42_bit, SSSE3, SSSE3_bit, and XSAVE_bit.

Referenced by isCpuInstructionSetSupported().

◆ hasAVX()

bool cpuid::hasAVX ( )
inline

Check if AVX is supported by the CPU.

Definition at line 81 of file cpuid.hxx.

References AVX, and isCpuInstructionSetSupported().

◆ hasAVX2()

bool cpuid::hasAVX2 ( )
inline

Check if AVX2 is supported by the CPU.

Definition at line 88 of file cpuid.hxx.

References AVX2, and isCpuInstructionSetSupported().

◆ hasAVX512F()

bool cpuid::hasAVX512F ( )
inline

Check if AVX512F is supported by the CPU.

Definition at line 95 of file cpuid.hxx.

References AVX512F, and isCpuInstructionSetSupported().

◆ hasHyperThreading()

bool cpuid::hasHyperThreading ( )
inline

Check if Hyper Threading is supported.

Definition at line 102 of file cpuid.hxx.

References HYPER, and isCpuInstructionSetSupported().

◆ hasSSE2()

bool cpuid::hasSSE2 ( )
inline

Check if SSE2 is supported by the CPU.

Definition at line 67 of file cpuid.hxx.

References isCpuInstructionSetSupported(), and SSE2.

◆ hasSSSE3()

bool cpuid::hasSSSE3 ( )
inline

Check if SSSE3 is supported by the CPU.

Definition at line 74 of file cpuid.hxx.

References isCpuInstructionSetSupported(), and SSSE3.

◆ instructionSetSupportedString()

TOOLS_DLLPUBLIC OUString cpuid::instructionSetSupportedString ( )

Returns a string of supported instructions.

Definition at line 118 of file cpuid.cxx.

References AVX, AVX2, AVX512F, isCpuInstructionSetSupported(), SSE2, SSE41, SSE42, and SSSE3.

◆ isCpuInstructionSetSupported()

TOOLS_DLLPUBLIC bool cpuid::isCpuInstructionSetSupported ( InstructionSetFlags  eInstructions)

Check if a certain instruction set is supported by the CPU at runtime.

Definition at line 112 of file cpuid.cxx.

References getCpuInstructionSetFlags().

Referenced by hasAVX(), hasAVX2(), hasAVX512F(), hasHyperThreading(), hasSSE2(), hasSSSE3(), and instructionSetSupportedString().