<html><head></head><body dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">I am just quoting the whole file here for simplicity, as its small</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 11px;" class=""><font face="Menlo" class=""><a href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/port/pg_crc32c_sse42_choose.c;h=0608e02011f7f5d8dbba7673a5ab4ba071d017a0;hb=e4f9737fac77a5cb03a84d1f4038d300ffd28afd" class="">https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/port/pg_crc32c_sse42_choose.c;h=0608e02011f7f5d8dbba7673a5ab4ba071d017a0;hb=e4f9737fac77a5cb03a84d1f4038d300ffd28afd</a>.</font></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 11px;" class=""><font face="Menlo" class=""><br class=""></font></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 11px;" class=""><font face="Menlo" class="">In line #43 the compiler errors out, if there is no cpuid.h or intrin.h available. As the code is supposed to </font></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 11px;" class=""><font face="Menlo" class="">fallback on a CRC software implementation, if SSE isn't available, returning false here instead, would be better</font></span><span style="font-family: Menlo; font-size: 11px;" class="">. </span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 11px;" class=""><font face="Menlo" class=""><br class=""></font></span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; font-size: 11px;" class=""><font face="Menlo" class=""><br class=""></font></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">Ciao</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""> Nat!</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">```</span></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 1 /*-------------------------------------------------------------------------</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 2 *</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 3 * pg_crc32c_sse42_choose.c</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 4 * Choose between Intel SSE 4.2 and software CRC-32C implementation.</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 5 *</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 6 * On first call, checks if the CPU we're running on supports Intel SSE</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 7 * 4.2. If it does, use the special SSE instructions for CRC-32C</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 8 * computation. Otherwise, fall back to the pure software implementation</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 9 * (slicing-by-8).</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 10 *</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 11 * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 12 * Portions Copyright (c) 1994, Regents of the University of California</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 13 *</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 14 *</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 15 * IDENTIFICATION</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 16 * src/port/pg_crc32c_sse42_choose.c</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 17 *</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 18 *-------------------------------------------------------------------------</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 19 */</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 20 </span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 21 #include "c.h"</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 22 </span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 23 #ifdef HAVE__GET_CPUID</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 24 #include <cpuid.h></span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 25 #endif</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 26 </span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 27 #ifdef HAVE__CPUID</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 28 #include <intrin.h></span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 29 #endif</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 30 </span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 31 #include "port/pg_crc32c.h"</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 32 </span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 33 static bool</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 34 pg_crc32c_sse42_available(void)</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 35 {</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 36 unsigned int exx[4] = {0, 0, 0, 0};</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 37 </span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 38 #if defined(HAVE__GET_CPUID)</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 39 __get_cpuid(1, &exx[0], &exx[1], &exx[2], &exx[3]);</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 40 #elif defined(HAVE__CPUID)</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 41 __cpuid(exx, 1);</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 42 #else</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 43 #error cpuid instruction not available</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 44 #endif</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 45 </span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 46 return (exx[2] & (1 << 20)) != 0; /* SSE 4.2 */</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 47 }</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 48 </span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 49 /*</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 50 * This gets called on the first call. It replaces the function pointer</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 51 * so that subsequent calls are routed directly to the chosen implementation.</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 52 */</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 53 static pg_crc32c</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 54 pg_comp_crc32c_choose(pg_crc32c crc, const void *data, size_t len)</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 55 {</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 56 if (pg_crc32c_sse42_available())</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 57 pg_comp_crc32c = pg_comp_crc32c_sse42;</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 58 else</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 59 pg_comp_crc32c = pg_comp_crc32c_sb8;</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 60 </span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 61 return pg_comp_crc32c(crc, data, len);</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 62 }</span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 63 </span></font></div><div style="margin: 0px; font-stretch: normal; line-height: normal;" class=""><font face="Menlo" class=""><span style="font-size: 11px;" class=""> 64 pg_crc32c (*pg_comp_crc32c) (pg_crc32c crc, const void *data, size_t len) = pg_comp_crc32c_choose;</span></font></div></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">```</span></div><div style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></div></div></body></html>