From 696ae6e9958adb18c5b373927e6bc92c67a99e57 Mon Sep 17 00:00:00 2001 From: Alexey Kopytov Date: Fri, 9 Dec 2016 13:31:59 +0300 Subject: [PATCH] Add benchmarks for ck_pr_add_64(), ck_pr_faa_64() and ck_pr_neg_64(). --- regressions/ck_pr/benchmark/Makefile | 14 ++++++++++++-- regressions/ck_pr/benchmark/ck_pr_add_64.c | 16 ++++++++++++++++ regressions/ck_pr/benchmark/ck_pr_faa_64.c | 16 ++++++++++++++++ regressions/ck_pr/benchmark/ck_pr_neg_64.c | 16 ++++++++++++++++ 4 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 regressions/ck_pr/benchmark/ck_pr_add_64.c create mode 100644 regressions/ck_pr/benchmark/ck_pr_faa_64.c create mode 100644 regressions/ck_pr/benchmark/ck_pr_neg_64.c diff --git a/regressions/ck_pr/benchmark/Makefile b/regressions/ck_pr/benchmark/Makefile index ae44b33..55183d8 100644 --- a/regressions/ck_pr/benchmark/Makefile +++ b/regressions/ck_pr/benchmark/Makefile @@ -1,6 +1,6 @@ .PHONY: clean -all: ck_pr_cas_64 ck_pr_fas_64 ck_pr_cas_64_2 fp +all: ck_pr_cas_64 ck_pr_fas_64 ck_pr_cas_64_2 ck_pr_add_64 ck_pr_faa_64 ck_pr_neg_64 fp fp: fp.c $(CC) $(CFLAGS) -o fp fp.c @@ -14,8 +14,18 @@ ck_pr_cas_64: ck_pr_cas_64.c ck_pr_fas_64: ck_pr_fas_64.c $(CC) $(CFLAGS) -o ck_pr_fas_64 ck_pr_fas_64.c -lm +ck_pr_add_64: ck_pr_add_64.c + $(CC) $(CFLAGS) -o ck_pr_add_64 ck_pr_add_64.c -lm + +ck_pr_faa_64: ck_pr_faa_64.c + $(CC) $(CFLAGS) -o ck_pr_faa_64 ck_pr_faa_64.c -lm + +ck_pr_neg_64: ck_pr_neg_64.c + $(CC) $(CFLAGS) -o ck_pr_neg_64 ck_pr_neg_64.c -lm + clean: - rm -rf ck_pr_cas_64 ck_pr_fas_64 ck_pr_cas_64_2 *.dSYM *.exe + rm -rf ck_pr_cas_64 ck_pr_fas_64 ck_pr_cas_64_2 ck_pr_add_64 \ + ck_pr_faa_64 ck_pr_neg_64 *.dSYM *.exe include ../../../build/regressions.build CFLAGS+=$(PTHREAD_CFLAGS) -D_GNU_SOURCE diff --git a/regressions/ck_pr/benchmark/ck_pr_add_64.c b/regressions/ck_pr/benchmark/ck_pr_add_64.c new file mode 100644 index 0000000..9c4d51f --- /dev/null +++ b/regressions/ck_pr/benchmark/ck_pr_add_64.c @@ -0,0 +1,16 @@ +#include + +#ifdef CK_F_PR_ADD_64 +#define ATOMIC ck_pr_add_64(object, 1) +#define ATOMIC_STRING "ck_pr_add_64" +#include "benchmark.h" +#else +#warning Did not find ADD_64 implementation. +#include + +int +main(void) +{ + exit(EXIT_FAILURE); +} +#endif diff --git a/regressions/ck_pr/benchmark/ck_pr_faa_64.c b/regressions/ck_pr/benchmark/ck_pr_faa_64.c new file mode 100644 index 0000000..9bdc87d --- /dev/null +++ b/regressions/ck_pr/benchmark/ck_pr_faa_64.c @@ -0,0 +1,16 @@ +#include + +#ifdef CK_F_PR_FAA_64 +#define ATOMIC ck_pr_faa_64(object, 1) +#define ATOMIC_STRING "ck_pr_faa_64" +#include "benchmark.h" +#else +#warning Did not find FAA_64 implementation. +#include + +int +main(void) +{ + exit(EXIT_FAILURE); +} +#endif diff --git a/regressions/ck_pr/benchmark/ck_pr_neg_64.c b/regressions/ck_pr/benchmark/ck_pr_neg_64.c new file mode 100644 index 0000000..d4e0ad9 --- /dev/null +++ b/regressions/ck_pr/benchmark/ck_pr_neg_64.c @@ -0,0 +1,16 @@ +#include + +#ifdef CK_F_PR_NEG_64 +#define ATOMIC ck_pr_neg_64(object) +#define ATOMIC_STRING "ck_pr_neg_64" +#include "benchmark.h" +#else +#warning Did not find NEG_64 implementation. +#include + +int +main(void) +{ + exit(EXIT_FAILURE); +} +#endif