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

Function benchS8x8_4

examples/AutoResearch/AutoResearchSimd.h:1191–1205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1189// Helper: time 4-wide scalar s8x8 with a binary op
1190template <typename Op>
1191inline int64_t benchS8x8_4(int iters, Op op) {
1192 fl::s8x8 a0(1.5f), a1(2.3f), a2(0.7f), a3(3.1f);
1193 fl::s8x8 b0(0.5f), b1(1.2f), b2(2.0f), b3(0.9f);
1194 fl::s8x8 bump = fl::s8x8::from_raw(1);
1195 uint32_t t0 = micros();
1196 for (int i = 0; i < iters; i++) {
1197 a0 = op(a0, b0); a1 = op(a1, b1);
1198 a2 = op(a2, b2); a3 = op(a3, b3);
1199 b0 = a0 + bump; b1 = a1 + bump;
1200 b2 = a2 + bump; b3 = a3 + bump;
1201 }
1202 uint32_t t1 = micros();
1203 g_bench_sink = static_cast<uint32_t>(a0.raw());
1204 return static_cast<int64_t>(t1 - t0);
1205}
1206
1207// Helper: time 4-wide scalar u16x16 with a binary op
1208template <typename Op>

Callers 1

runMultiplyBenchmarkFunction · 0.85

Calls 2

microsFunction · 0.50
rawMethod · 0.45

Tested by

no test coverage detected