Marat Dukhan | f7dd057 | 2020-04-10 23:06:30 -0700 | [diff] [blame] | 1 | load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test") |
| 2 | |
| 3 | licenses(["notice"]) |
| 4 | |
Marat Dukhan | 63058ef | 2020-12-08 22:42:51 -0800 | [diff] [blame] | 5 | exports_files(["LICENSE"]) |
| 6 | |
Marat Dukhan | f7dd057 | 2020-04-10 23:06:30 -0700 | [diff] [blame] | 7 | ################################# FXdiv library ################################ |
| 8 | |
| 9 | cc_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 | |
| 24 | cc_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 | |
| 33 | cc_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 | |
| 44 | cc_binary( |
| 45 | name = "init_bench", |
| 46 | srcs = ["bench/init.cc"], |
| 47 | deps = [ |
| 48 | ":FXdiv", |
| 49 | "@com_google_benchmark//:benchmark", |
| 50 | ], |
| 51 | ) |
| 52 | |
| 53 | cc_binary( |
| 54 | name = "multiply_bench", |
| 55 | srcs = ["bench/multiply.cc"], |
| 56 | deps = [ |
| 57 | ":FXdiv", |
| 58 | "@com_google_benchmark//:benchmark", |
| 59 | ], |
| 60 | ) |
| 61 | |
| 62 | cc_binary( |
| 63 | name = "divide_bench", |
| 64 | srcs = ["bench/divide.cc"], |
| 65 | deps = [ |
| 66 | ":FXdiv", |
| 67 | "@com_google_benchmark//:benchmark", |
| 68 | ], |
| 69 | ) |
| 70 | |
| 71 | cc_binary( |
| 72 | name = "quotient_bench", |
| 73 | srcs = ["bench/quotient.cc"], |
| 74 | deps = [ |
| 75 | ":FXdiv", |
| 76 | "@com_google_benchmark//:benchmark", |
| 77 | ], |
| 78 | ) |
| 79 | |
| 80 | cc_binary( |
| 81 | name = "round_down_bench", |
| 82 | srcs = ["bench/round-down.cc"], |
| 83 | deps = [ |
| 84 | ":FXdiv", |
| 85 | "@com_google_benchmark//:benchmark", |
| 86 | ], |
| 87 | ) |