Code Poetry
and Text Adventures

by catid posted (>30 days ago) 3:41pm Wed. Nov 4th 2015 PST
CLMUL is useful for accelerating CRC calculations and binary extension fields for cryptography acceleration.

https://msdn.microsoft.com/en-us/library/cc664767(v=vs.120).aspx

https://en.wikipedia.org/wiki/CLMUL_instruction_set#CPUs_with_CLMUL_instruction_set

http://www.intel.com/content/dam/www/public/us/en/documents/white-papers/fast-crc-computation-generic-polynomials-pclmulqdq-paper.pdf

static bool cpu_has_clmul()
{
   int cpuInfo[4];

   // Get the count of IDs
   __cpuid(cpuInfo, 0);
   int idCount = cpuInfo[0];

   if (idCount >= 2)
   {
      __cpuidex(cpuInfo, 1, 0);

      if (cpuInfo[2] & 1)
      {
           return true;
      }
   }

   return false;
}
last edit by catid edited (>30 days ago) 4:05pm Wed. Nov 4th 2015 PST