mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
042050ef67
Included sample benchmark for eminline for native and noasm Made GoogleTest compile only if tests are compiled
24 lines
550 B
C++
24 lines
550 B
C++
// license:BSD-3-Clause
|
|
// copyright-holders:Miodrag Milanovic
|
|
|
|
#include "benchmark/benchmark_api.h"
|
|
#include <time.h>
|
|
#include "osdcore.h"
|
|
#include "osdcomm.h"
|
|
#define MAME_NOASM 1
|
|
osd_ticks_t osd_ticks(void)
|
|
{
|
|
// use the standard library clock function
|
|
return clock();
|
|
}
|
|
#include "eminline.h"
|
|
|
|
static void BM_count_leading_zeros_noasm(benchmark::State& state) {
|
|
UINT32 cnt = 0x332533;
|
|
while (state.KeepRunning()) {
|
|
(void)count_leading_zeros(cnt);
|
|
cnt++;
|
|
}
|
|
}
|
|
// Register the function as a benchmark
|
|
BENCHMARK(BM_count_leading_zeros_noasm);
|