From: Laurent Mazet Date: Fri, 17 Oct 2025 21:06:09 +0000 (+0200) Subject: adapt to clang X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=0962191f3a95bd3e700f6029115924107885a30d;p=benchmarks.git adapt to clang --- diff --git a/load.c b/load.c index 5ec043a..bc370fb 100644 --- a/load.c +++ b/load.c @@ -185,13 +185,15 @@ double estimate_tics_clock (void) double estimate_cpu_clock (void) { -#ifndef __arm__ - return estimate_tics_clock (); -#else +#if defined(__arm__) || defined(__aarch64__) struct timeval tv1; gettimeofday (&tv1, NULL); - int instructions = 0; +#ifdef __aarch64__ /* 64 bits */ + int64_t instructions = 0; +#else /* 32 bits */ + int32_t instructions = 0; +#endif while (instructions < 10000000) { #define INST0 "add %[i], %[i], #1\n\t" #define INST1 INST0 INST0 INST0 INST0 INST0 INST0 INST0 INST0 \ @@ -223,6 +225,8 @@ double estimate_cpu_clock (void) ((double)tv1.tv_sec + tv1.tv_usec * 1e-6); return instructions / runtime; +#else + return estimate_tics_clock (); #endif /* __arm__ */ }