From e2a5c07edb6aeee57780440bf63848a4965451dd Mon Sep 17 00:00:00 2001 From: Jean Pierre Cimalando Date: Sun, 21 Feb 2021 23:29:41 +0100 Subject: [PATCH] Remove BM_opcodeSpec --- benchmarks/BM_opcodeSpec.cpp | 72 -------------------------------- benchmarks/BM_opcodeSpec.h | 14 ------- benchmarks/BM_opcodeSpec_def.cpp | 3 -- benchmarks/CMakeLists.txt | 1 - 4 files changed, 90 deletions(-) delete mode 100644 benchmarks/BM_opcodeSpec.cpp delete mode 100644 benchmarks/BM_opcodeSpec.h delete mode 100644 benchmarks/BM_opcodeSpec_def.cpp diff --git a/benchmarks/BM_opcodeSpec.cpp b/benchmarks/BM_opcodeSpec.cpp deleted file mode 100644 index da31a30a..00000000 --- a/benchmarks/BM_opcodeSpec.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: BSD-2-Clause - -// This code is part of the sfizz library and is licensed under a BSD 2-clause -// license. You should have receive a LICENSE.md file along with the code. -// If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz - -#include "BM_opcodeSpec.h" -#include -#include -#include -#include -#include -#include - -class OpcodeSpecFixture : public benchmark::Fixture { -public: - void SetUp(const ::benchmark::State& state) { - std::random_device rd { }; - std::mt19937 gen { rd() }; - std::uniform_real_distribution dist { 0.0f, 1.0f }; - value = dist(gen); - } - - void TearDown(const ::benchmark::State& /* state */) { - - } - - float value; - float returned; -}; - -BENCHMARK_DEFINE_F(OpcodeSpecFixture, ConstexprClamp)(benchmark::State& state) { - for (auto _ : state) - { - if (constexprSpec.flags | (1 << 2)) - returned = constexprSpec.bounds.clamp(value); - benchmark::DoNotOptimize(returned); - } -} - -BENCHMARK_DEFINE_F(OpcodeSpecFixture, ConstexprDontClamp)(benchmark::State& state) { - for (auto _ : state) - { - if (constexprSpec.flags | (1 << 1)) - returned = constexprSpec.bounds.clamp(value); - benchmark::DoNotOptimize(returned); - } -} - -BENCHMARK_DEFINE_F(OpcodeSpecFixture, ConstClamp)(benchmark::State& state) { - for (auto _ : state) - { - if (constSpec.flags | (1 << 2)) - returned = constSpec.bounds.clamp(value); - benchmark::DoNotOptimize(returned); - } -} - -BENCHMARK_DEFINE_F(OpcodeSpecFixture, ConstDontClamp)(benchmark::State& state) { - for (auto _ : state) - { - if (constSpec.flags | (1 << 1)) - returned = constSpec.bounds.clamp(value); - benchmark::DoNotOptimize(returned); - } -} - -BENCHMARK_REGISTER_F(OpcodeSpecFixture, ConstexprClamp); -BENCHMARK_REGISTER_F(OpcodeSpecFixture, ConstexprDontClamp); -BENCHMARK_REGISTER_F(OpcodeSpecFixture, ConstClamp); -BENCHMARK_REGISTER_F(OpcodeSpecFixture, ConstDontClamp); -BENCHMARK_MAIN(); diff --git a/benchmarks/BM_opcodeSpec.h b/benchmarks/BM_opcodeSpec.h deleted file mode 100644 index 8efcbe43..00000000 --- a/benchmarks/BM_opcodeSpec.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "Range.h" - -template -struct OpcodeSpec -{ - T defaultValue; - sfz::Range bounds; - int flags { 0 }; -}; - -constexpr OpcodeSpec constexprSpec { 0.0f, sfz::Range(0.0f, 0.5f), 1 << 2 }; -extern const OpcodeSpec constSpec; diff --git a/benchmarks/BM_opcodeSpec_def.cpp b/benchmarks/BM_opcodeSpec_def.cpp deleted file mode 100644 index 076dd27d..00000000 --- a/benchmarks/BM_opcodeSpec_def.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "BM_opcodeSpec.h" - -const OpcodeSpec constSpec { 0.0f, sfz::Range(0.0f, 0.5f), 1 << 2 }; diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 77652c3e..89d7c8e3 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -38,7 +38,6 @@ sfizz_add_benchmark(bm_mapVsArray BM_mapVsArray.cpp) sfizz_add_benchmark(bm_random BM_random.cpp) sfizz_add_benchmark(bm_clamp BM_clamp.cpp) sfizz_add_benchmark(bm_allWithin BM_allWithin.cpp) -sfizz_add_benchmark(bm_opcodeSpec BM_opcodeSpec.cpp BM_opcodeSpec_def.cpp) sfizz_add_benchmark(bm_logger BM_logger.cpp) sfizz_add_benchmark(bm_smoothers BM_smoothers.cpp)