2828#if (ASTCENC_SSE > 0) || (ASTCENC_AVX > 0) || \
2929 (ASTCENC_POPCNT > 0 ) || (ASTCENC_F16C > 0 )
3030
31+ /* * Does this CPU support SSE 4.1? Set to -1 if not yet initialized. */
3132static int g_cpu_has_sse41 = -1 ;
33+
34+ /* * Does this CPU support AVX2? Set to -1 if not yet initialized. */
3235static int g_cpu_has_avx2 = -1 ;
36+
37+ /* * Does this CPU support POPCNT? Set to -1 if not yet initialized. */
3338static int g_cpu_has_popcnt = -1 ;
39+
40+ /* * Does this CPU support F16C? Set to -1 if not yet initialized. */
3441static int g_cpu_has_f16c = -1 ;
3542
3643/* ============================================================================
@@ -39,6 +46,9 @@ static int g_cpu_has_f16c = -1;
3946#if !defined(__clang__) && defined(_MSC_VER)
4047#include < intrin.h>
4148
49+ /* *
50+ * @brief Detect platform CPU ISA support and update global trackers.
51+ */
4252static void detect_cpu_isa ()
4353{
4454 int data[4 ];
@@ -75,6 +85,9 @@ static void detect_cpu_isa()
7585#else
7686#include < cpuid.h>
7787
88+ /* *
89+ * @brief Detect platform CPU ISA support and update global trackers.
90+ */
7891static void detect_cpu_isa ()
7992{
8093 unsigned int data[4 ];
@@ -101,7 +114,7 @@ static void detect_cpu_isa()
101114}
102115#endif
103116
104- /* Public function, see header file for detailed documentation */
117+ /* See header for documentation. */
105118int cpu_supports_sse41 ()
106119{
107120 if (g_cpu_has_sse41 == -1 )
@@ -112,7 +125,7 @@ int cpu_supports_sse41()
112125 return g_cpu_has_sse41;
113126}
114127
115- /* Public function, see header file for detailed documentation */
128+ /* See header for documentation. */
116129int cpu_supports_popcnt ()
117130{
118131 if (g_cpu_has_popcnt == -1 )
@@ -123,7 +136,7 @@ int cpu_supports_popcnt()
123136 return g_cpu_has_popcnt;
124137}
125138
126- /* Public function, see header file for detailed documentation */
139+ /* See header for documentation. */
127140int cpu_supports_f16c ()
128141{
129142 if (g_cpu_has_f16c == -1 )
@@ -134,7 +147,7 @@ int cpu_supports_f16c()
134147 return g_cpu_has_f16c;
135148}
136149
137- /* Public function, see header file for detailed documentation */
150+ /* See header for documentation. */
138151int cpu_supports_avx2 ()
139152{
140153 if (g_cpu_has_avx2 == -1 )
0 commit comments