1# Copyright 2018 The Abseil Authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      https://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15load(
16    "//absl:copts/configure_copts.bzl",
17    "ABSL_DEFAULT_COPTS",
18    "ABSL_DEFAULT_LINKOPTS",
19    "ABSL_TEST_COPTS",
20)
21
22package(default_visibility = ["//visibility:public"])
23
24licenses(["notice"])
25
26cc_library(
27    name = "bits",
28    hdrs = [
29        "bits.h",
30        "internal/bits.h",
31    ],
32    copts = ABSL_DEFAULT_COPTS,
33    linkopts = ABSL_DEFAULT_LINKOPTS,
34    deps = [
35        "//absl/base:config",
36        "//absl/base:core_headers",
37    ],
38)
39
40cc_binary(
41    name = "bits_benchmark",
42    testonly = 1,
43    srcs = ["bits_benchmark.cc"],
44    copts = ABSL_DEFAULT_COPTS,
45    linkopts = ABSL_DEFAULT_LINKOPTS,
46    deps = [
47        ":bits",
48        "//absl/base:core_headers",
49        "//absl/random",
50        "@com_github_google_benchmark//:benchmark_main",
51    ],
52)
53
54cc_test(
55    name = "bits_test",
56    size = "small",
57    srcs = [
58        "bits_test.cc",
59    ],
60    copts = ABSL_TEST_COPTS,
61    linkopts = ABSL_DEFAULT_LINKOPTS,
62    deps = [
63        ":bits",
64        "//absl/random",
65        "@com_google_googletest//:gtest_main",
66    ],
67)
68
69cc_library(
70    name = "int128",
71    srcs = [
72        "int128.cc",
73        "int128_have_intrinsic.inc",
74        "int128_no_intrinsic.inc",
75    ],
76    hdrs = ["int128.h"],
77    copts = ABSL_DEFAULT_COPTS,
78    linkopts = ABSL_DEFAULT_LINKOPTS,
79    deps = [
80        ":bits",
81        "//absl/base:config",
82        "//absl/base:core_headers",
83    ],
84)
85
86cc_test(
87    name = "int128_test",
88    size = "small",
89    srcs = [
90        "int128_stream_test.cc",
91        "int128_test.cc",
92    ],
93    copts = ABSL_TEST_COPTS,
94    linkopts = ABSL_DEFAULT_LINKOPTS,
95    deps = [
96        ":int128",
97        "//absl/base",
98        "//absl/hash:hash_testing",
99        "//absl/meta:type_traits",
100        "@com_google_googletest//:gtest_main",
101    ],
102)
103
104cc_test(
105    name = "int128_benchmark",
106    srcs = ["int128_benchmark.cc"],
107    copts = ABSL_TEST_COPTS,
108    linkopts = ABSL_DEFAULT_LINKOPTS,
109    tags = ["benchmark"],
110    deps = [
111        ":int128",
112        "//absl/base:config",
113        "@com_github_google_benchmark//:benchmark_main",
114    ],
115)
116
117cc_library(
118    name = "representation",
119    hdrs = [
120        "internal/representation.h",
121    ],
122    copts = ABSL_DEFAULT_COPTS,
123    linkopts = ABSL_DEFAULT_LINKOPTS,
124    deps = [
125        "//absl/base:config",
126    ],
127)
128