• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
2
3licenses(["notice"])
4
5exports_files(["LICENSE"])
6
7################################# FXdiv library ################################
8
9cc_library(
10    name = "FXdiv",
11    hdrs = [
12        "include/fxdiv.h",
13    ],
14    includes = [
15        "include",
16    ],
17    strip_include_prefix = "include",
18    deps = [],
19    visibility = ["//visibility:public"],
20)
21
22################################## Unit tests ##################################
23
24cc_test(
25    name = "multiply_high_test",
26    srcs = ["test/multiply-high.cc"],
27    deps = [
28        ":FXdiv",
29        "@com_google_googletest//:gtest_main",
30    ],
31)
32
33cc_test(
34    name = "quotient_test",
35    srcs = ["test/quotient.cc"],
36    deps = [
37        ":FXdiv",
38        "@com_google_googletest//:gtest_main",
39    ],
40)
41
42################################## Benchmarks ##################################
43
44cc_binary(
45    name = "init_bench",
46    srcs = ["bench/init.cc"],
47    deps = [
48        ":FXdiv",
49        "@com_google_benchmark//:benchmark",
50    ],
51)
52
53cc_binary(
54    name = "multiply_bench",
55    srcs = ["bench/multiply.cc"],
56    deps = [
57        ":FXdiv",
58        "@com_google_benchmark//:benchmark",
59    ],
60)
61
62cc_binary(
63    name = "divide_bench",
64    srcs = ["bench/divide.cc"],
65    deps = [
66        ":FXdiv",
67        "@com_google_benchmark//:benchmark",
68    ],
69)
70
71cc_binary(
72    name = "quotient_bench",
73    srcs = ["bench/quotient.cc"],
74    deps = [
75        ":FXdiv",
76        "@com_google_benchmark//:benchmark",
77    ],
78)
79
80cc_binary(
81    name = "round_down_bench",
82    srcs = ["bench/round-down.cc"],
83    deps = [
84        ":FXdiv",
85        "@com_google_benchmark//:benchmark",
86    ],
87)
88