MCPcopy Create free account
hub / github.com/FastLED/FastLED / benchmarkBaseline

Function benchmarkBaseline

tests/profile/sincos32.cpp:16–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14static const int PROFILE_ITERATIONS = 100000;
15
16__attribute__((noinline))
17void benchmarkBaseline() {
18 // 4 different angles spread across quadrants
19 volatile i32 sink = 0;
20 for (int i = 0; i < PROFILE_ITERATIONS; i++) {
21 u32 base = static_cast<u32>(i * 167); // Vary angles each iteration
22 FL_ALIGNAS(16) u32 angle_data[4] = {
23 base,
24 base + 4194304u, // +pi/2
25 base + 8388608u, // +pi
26 base + 12582912u // +3pi/2
27 };
28 simd::simd_u32x4 angles = simd::load_u32_4(angle_data);
29 SinCos32_simd result = sincos32_simd(angles);
30 // Sink one value to prevent dead code elimination
31 u32 tmp[4];
32 simd::store_u32_4(tmp, result.sin_vals);
33 sink = static_cast<i32>(tmp[0]);
34 }
35 (void)sink;
36}
37
38int main(int argc, char *argv[]) {
39 bool do_baseline = true;

Callers 1

mainFunction · 0.70

Calls 1

FL_ALIGNASClass · 0.50

Tested by

no test coverage detected