From ba1680a06ebc5fe27ad0a63b66dd4edea1481d76 Mon Sep 17 00:00:00 2001 From: Scott Theisen Date: Fri, 14 Jun 2024 03:27:20 -0400 Subject: [PATCH] mythmiscutil.h: remove unused rdtsc() This may have been for benchmarking the filters removed in 2019 in ead8718de6299489f62fdde0174fd155465490d8. --- .../development/tsc-calibrate/tsc-calibrate.c | 41 ------------------- mythtv/libs/libmythbase/mythmiscutil.h | 29 ------------- 2 files changed, 70 deletions(-) delete mode 100644 mythtv/contrib/development/tsc-calibrate/tsc-calibrate.c diff --git a/mythtv/contrib/development/tsc-calibrate/tsc-calibrate.c b/mythtv/contrib/development/tsc-calibrate/tsc-calibrate.c deleted file mode 100644 index e0e99e4b554..00000000000 --- a/mythtv/contrib/development/tsc-calibrate/tsc-calibrate.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Calibration program for TSC filter benchmarking - * See mythtv/filters/README for more information - * compile with gcc -o tsc-calibrate tsc-calibrate.c - */ - -#include -#include -#include -#include -#include -#define TEST_DELAY 16 - -int main (int argc, char **argv) { - unsigned long long t1, t2; - unsigned int t1l, t2l, t1h, t2h; - struct timeval to = { 0, 0 }; - int delay; - - if ( argc<2 || (delay = atoi(argv[1])) < 1 ) - { - fprintf (stderr, - "\nUsage:\n\n" - "%s \n\n" - "Specify a delay in seconds to calibrate. A longer delay will provide a more\n" - "accurate result. 8-32 seconds should be sufficient for most purposes. Define\n" - "TIME_FILTER, define TF_TYPE as TSC, and define TF_TSC_TICKS as the reported\n" - "value when building filters in order to use TSC benchmarks reported in frames\n" - "per second instead of ticks per frame.\n\n", - argv[0]); - exit (1); - } - - to.tv_sec = delay; - asm ("rdtsc" :"=a" (t1l), "=d" (t1h)); - select (0,0,0,0, &to); - asm ("rdtsc" :"=a" (t2l), "=d" (t2h)); - t1 = t1l + ((unsigned long long)t1h<<32); - t2 = t2l + ((unsigned long long)t2h<<32); - printf ("TF_TSC_TICKS for this system: %llu\n", (t2-t1+delay/2)/delay); -} diff --git a/mythtv/libs/libmythbase/mythmiscutil.h b/mythtv/libs/libmythbase/mythmiscutil.h index b52d32896bc..f65691fcb1e 100644 --- a/mythtv/libs/libmythbase/mythmiscutil.h +++ b/mythtv/libs/libmythbase/mythmiscutil.h @@ -59,33 +59,4 @@ MBASE_PUBLIC bool MythRemoveDirectory(QDir &aDir); MBASE_PUBLIC void setHttpProxy(void); -// CPU Tick timing function -#ifdef MMX -#ifdef _WIN32 -#include "compat.h" -inline void rdtsc(uint64_t &x) -{ - QueryPerformanceCounter((LARGE_INTEGER*)(&x)); -} -#else -struct timing_ab_t { - uint a; - uint b; -}; -inline void rdtsc(uint64_t &x) -{ - auto &y = (timing_ab_t&) x; - asm("rdtsc \n" - "mov %%eax, %0 \n" - "mov %%edx, %1 \n" - : - : "m"(y.a), "m"(y.b) - : "%eax", "%edx"); -} -#endif - -#else // if !MMX -inline void rdtsc(uint64_t &x) { x = 0ULL; } -#endif // !MMX - #endif // MYTHMISCUTIL_H_