Skip to content

Commit fea1f41

Browse files
committed
Cleanup platform_isa_detection
1 parent f4f5cfb commit fea1f41

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

Source/astcenc_image.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static vfloat4 encode_texel_lns(
147147
return select(datav_unorm, datav_lns, lns_mask);
148148
}
149149

150-
/* See header for documentation */
150+
/* See header for documentation. */
151151
void fetch_imageblock(
152152
astcenc_profile decode_mode,
153153
const astcenc_image& img,

Source/astcenc_platform_isa_detection.cpp

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,16 @@
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. */
3132
static int g_cpu_has_sse41 = -1;
33+
34+
/** Does this CPU support AVX2? Set to -1 if not yet initialized. */
3235
static int g_cpu_has_avx2 = -1;
36+
37+
/** Does this CPU support POPCNT? Set to -1 if not yet initialized. */
3338
static int g_cpu_has_popcnt = -1;
39+
40+
/** Does this CPU support F16C? Set to -1 if not yet initialized. */
3441
static 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+
*/
4252
static 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+
*/
7891
static 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. */
105118
int 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. */
116129
int 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. */
127140
int 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. */
138151
int cpu_supports_avx2()
139152
{
140153
if (g_cpu_has_avx2 == -1)

0 commit comments

Comments
 (0)