File size: 1,675 Bytes
8b7c501
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")

licenses(["notice"])

################################# FXdiv library ################################

cc_library(
    name = "FXdiv",
    hdrs = [
        "include/fxdiv.h",
    ],
    includes = [
        "include",
    ],
    strip_include_prefix = "include",
    deps = [],
    visibility = ["//visibility:public"],
)

################################## Unit tests ##################################

cc_test(
    name = "multiply_high_test",
    srcs = ["test/multiply-high.cc"],
    deps = [
        ":FXdiv",
        "@com_google_googletest//:gtest_main",
    ],
)

cc_test(
    name = "quotient_test",
    srcs = ["test/quotient.cc"],
    deps = [
        ":FXdiv",
        "@com_google_googletest//:gtest_main",
    ],
)

################################## Benchmarks ##################################

cc_binary(
    name = "init_bench",
    srcs = ["bench/init.cc"],
    deps = [
        ":FXdiv",
        "@com_google_benchmark//:benchmark",
    ],
)

cc_binary(
    name = "multiply_bench",
    srcs = ["bench/multiply.cc"],
    deps = [
        ":FXdiv",
        "@com_google_benchmark//:benchmark",
    ],
)

cc_binary(
    name = "divide_bench",
    srcs = ["bench/divide.cc"],
    deps = [
        ":FXdiv",
        "@com_google_benchmark//:benchmark",
    ],
)

cc_binary(
    name = "quotient_bench",
    srcs = ["bench/quotient.cc"],
    deps = [
        ":FXdiv",
        "@com_google_benchmark//:benchmark",
    ],
)

cc_binary(
    name = "round_down_bench",
    srcs = ["bench/round-down.cc"],
    deps = [
        ":FXdiv",
        "@com_google_benchmark//:benchmark",
    ],
)