From 96c2988381e67cd11812cd3cb402339407a512c6 Mon Sep 17 00:00:00 2001 From: "Moe Charm (CI)" Date: Fri, 5 Dec 2025 20:56:20 +0900 Subject: [PATCH] Bench: add C7-only mode for warm TLS tests --- bench_random_mixed.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bench_random_mixed.c b/bench_random_mixed.c index 0ffa2754..8abf2399 100644 --- a/bench_random_mixed.c +++ b/bench_random_mixed.c @@ -41,6 +41,16 @@ static inline uint32_t xorshift32(uint32_t* s){ uint32_t x=*s; x^=x<<13; x^=x>>17; x^=x<<5; *s=x; return x; } +// Debug helper: C7 専用ベンチモード (ENV: HAKMEM_BENCH_C7_ONLY=1) +static int bench_mode_c7_only = -1; +static inline int bench_is_c7_only_mode(void) { + if (bench_mode_c7_only == -1) { + const char* e = getenv("HAKMEM_BENCH_C7_ONLY"); + bench_mode_c7_only = (e && *e && *e != '0') ? 1 : 0; + } + return bench_mode_c7_only; +} + int main(int argc, char** argv){ int cycles = (argc>1)? atoi(argv[1]) : 10000000; // total ops (10M for steady-state measurement) int ws = (argc>2)? atoi(argv[2]) : 8192; // working-set slots @@ -77,6 +87,12 @@ int main(int argc, char** argv){ if (min_size < 1) min_size = 1; if (max_size < min_size) max_size = min_size; + // C7 専用モード: サイズを C7 帯に固定(現行 C7 ブロックサイズ ≈ 1024B) + if (bench_is_c7_only_mode()) { + min_size = 1024; + max_size = 1024; + } + if (cycles <= 0) cycles = 1; if (ws <= 0) ws = 1024;