mirror of
https://github.com/holub/mame
synced 2025-04-26 18:23:08 +03:00

Included sample benchmark for eminline for native and noasm Made GoogleTest compile only if tests are compiled
16 lines
398 B
C++
16 lines
398 B
C++
// license:BSD-3-Clause
|
|
// copyright-holders:Miodrag Milanovic
|
|
|
|
#include "benchmark/benchmark_api.h"
|
|
#include "osdcomm.h"
|
|
#include "eminline.h"
|
|
static void BM_count_leading_zeros_native(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_native);
|