@@ -52,6 +52,34 @@ config_setting(
52
52
flag_values = {":mpfr" : "system" },
53
53
)
54
54
55
+ # A flag to pick which `mpc` to use for math tests.
56
+ # Usage: `--@llvm-project//libc:mpc=<disable|external|system>`.
57
+ # Flag documentation: https://bazel.build/extending/config
58
+ string_flag (
59
+ name = "mpc" ,
60
+ build_setting_default = "external" ,
61
+ values = [
62
+ "disable" , # Skip tests that need mpc
63
+ "external" , # Build mpc from source
64
+ "system" , # Use system mpc (non hermetic)
65
+ ],
66
+ )
67
+
68
+ config_setting (
69
+ name = "mpc_disable" ,
70
+ flag_values = {":mpc" : "disable" },
71
+ )
72
+
73
+ config_setting (
74
+ name = "mpc_external" ,
75
+ flag_values = {":mpc" : "external" },
76
+ )
77
+
78
+ config_setting (
79
+ name = "mpc_system" ,
80
+ flag_values = {":mpc" : "system" },
81
+ )
82
+
55
83
########################### Header Generation ##################################
56
84
57
85
py_binary (
@@ -865,6 +893,26 @@ libc_support_library(
865
893
],
866
894
)
867
895
896
+ libc_support_library (
897
+ name = "__support_complex_type" ,
898
+ hdrs = ["src/__support/complex_type.h" ],
899
+ deps = [
900
+ ":__support_macros_config" ,
901
+ ":__support_macros_properties_complex_types" ,
902
+ ":__support_macros_properties_types" ,
903
+ ],
904
+ )
905
+
906
+ libc_support_library (
907
+ name = "__support_complex_basic_ops" ,
908
+ hdrs = ["src/__support/complex_basic_ops.h" ],
909
+ deps = [
910
+ ":__support_complex_type" ,
911
+ ":__support_cpp_bit" ,
912
+ ":__support_fputil_fp_bits" ,
913
+ ],
914
+ )
915
+
868
916
libc_support_library (
869
917
name = "__support_fputil_basic_operations" ,
870
918
hdrs = [
@@ -1890,6 +1938,249 @@ libc_support_library(
1890
1938
],
1891
1939
)
1892
1940
1941
+ ############################### complex targets ################################
1942
+
1943
+ libc_function (
1944
+ name = "cimag" ,
1945
+ srcs = ["src/complex/generic/cimag.cpp" ],
1946
+ hdrs = ["src/complex/cimag.h" ],
1947
+ deps = [
1948
+ ":__support_common" ,
1949
+ ":__support_complex_type" ,
1950
+ ":__support_cpp_bit" ,
1951
+ ":__support_macros_config" ,
1952
+ ],
1953
+ )
1954
+
1955
+ libc_function (
1956
+ name = "cimagf" ,
1957
+ srcs = ["src/complex/generic/cimagf.cpp" ],
1958
+ hdrs = ["src/complex/cimagf.h" ],
1959
+ deps = [
1960
+ ":__support_common" ,
1961
+ ":__support_complex_type" ,
1962
+ ":__support_cpp_bit" ,
1963
+ ":__support_macros_config" ,
1964
+ ],
1965
+ )
1966
+
1967
+ libc_function (
1968
+ name = "cimagf128" ,
1969
+ srcs = ["src/complex/generic/cimagf128.cpp" ],
1970
+ hdrs = ["src/complex/cimagf128.h" ],
1971
+ deps = [
1972
+ ":__support_common" ,
1973
+ ":__support_complex_type" ,
1974
+ ":__support_cpp_bit" ,
1975
+ ":__support_macros_config" ,
1976
+ ":__support_macros_properties_complex_types" ,
1977
+ ":__support_macros_properties_types" ,
1978
+ ],
1979
+ )
1980
+
1981
+ libc_function (
1982
+ name = "cimagf16" ,
1983
+ srcs = ["src/complex/generic/cimagf16.cpp" ],
1984
+ hdrs = ["src/complex/cimagf16.h" ],
1985
+ deps = [
1986
+ ":__support_common" ,
1987
+ ":__support_complex_type" ,
1988
+ ":__support_cpp_bit" ,
1989
+ ":__support_macros_config" ,
1990
+ ":__support_macros_properties_complex_types" ,
1991
+ ":__support_macros_properties_types" ,
1992
+ ],
1993
+ )
1994
+
1995
+ libc_function (
1996
+ name = "cimagl" ,
1997
+ srcs = ["src/complex/generic/cimagl.cpp" ],
1998
+ hdrs = ["src/complex/cimagl.h" ],
1999
+ deps = [
2000
+ ":__support_common" ,
2001
+ ":__support_complex_type" ,
2002
+ ":__support_cpp_bit" ,
2003
+ ":__support_macros_config" ,
2004
+ ],
2005
+ )
2006
+
2007
+ libc_function (
2008
+ name = "conj" ,
2009
+ srcs = ["src/complex/generic/conj.cpp" ],
2010
+ hdrs = ["src/complex/conj.h" ],
2011
+ deps = [
2012
+ ":__support_common" ,
2013
+ ":__support_complex_basic_ops" ,
2014
+ ":__support_macros_config" ,
2015
+ ],
2016
+ )
2017
+
2018
+ libc_function (
2019
+ name = "conjf" ,
2020
+ srcs = ["src/complex/generic/conjf.cpp" ],
2021
+ hdrs = ["src/complex/conjf.h" ],
2022
+ deps = [
2023
+ ":__support_common" ,
2024
+ ":__support_complex_basic_ops" ,
2025
+ ":__support_macros_config" ,
2026
+ ],
2027
+ )
2028
+
2029
+ libc_function (
2030
+ name = "conjf128" ,
2031
+ srcs = ["src/complex/generic/conjf128.cpp" ],
2032
+ hdrs = ["src/complex/conjf128.h" ],
2033
+ deps = [
2034
+ ":__support_common" ,
2035
+ ":__support_complex_basic_ops" ,
2036
+ ":__support_macros_config" ,
2037
+ ":__support_macros_properties_complex_types" ,
2038
+ ],
2039
+ )
2040
+
2041
+ libc_function (
2042
+ name = "conjf16" ,
2043
+ srcs = ["src/complex/generic/conjf16.cpp" ],
2044
+ hdrs = ["src/complex/conjf16.h" ],
2045
+ deps = [
2046
+ ":__support_common" ,
2047
+ ":__support_complex_basic_ops" ,
2048
+ ":__support_cpp_bit" ,
2049
+ ":__support_macros_config" ,
2050
+ ":__support_macros_properties_complex_types" ,
2051
+ ],
2052
+ )
2053
+
2054
+ libc_function (
2055
+ name = "conjl" ,
2056
+ srcs = ["src/complex/generic/conjl.cpp" ],
2057
+ hdrs = ["src/complex/conjl.h" ],
2058
+ deps = [
2059
+ ":__support_common" ,
2060
+ ":__support_complex_basic_ops" ,
2061
+ ":__support_macros_config" ,
2062
+ ],
2063
+ )
2064
+
2065
+ libc_function (
2066
+ name = "cproj" ,
2067
+ srcs = ["src/complex/generic/cproj.cpp" ],
2068
+ hdrs = ["src/complex/cproj.h" ],
2069
+ deps = [
2070
+ ":__support_common" ,
2071
+ ":__support_complex_basic_ops" ,
2072
+ ":__support_macros_config" ,
2073
+ ],
2074
+ )
2075
+
2076
+ libc_function (
2077
+ name = "cprojf" ,
2078
+ srcs = ["src/complex/generic/cprojf.cpp" ],
2079
+ hdrs = ["src/complex/cprojf.h" ],
2080
+ deps = [
2081
+ ":__support_common" ,
2082
+ ":__support_complex_basic_ops" ,
2083
+ ":__support_macros_config" ,
2084
+ ],
2085
+ )
2086
+
2087
+ libc_function (
2088
+ name = "cprojf128" ,
2089
+ srcs = ["src/complex/generic/cprojf128.cpp" ],
2090
+ hdrs = ["src/complex/cprojf128.h" ],
2091
+ deps = [
2092
+ ":__support_common" ,
2093
+ ":__support_complex_basic_ops" ,
2094
+ ":__support_macros_config" ,
2095
+ ":__support_macros_properties_complex_types" ,
2096
+ ],
2097
+ )
2098
+
2099
+ libc_function (
2100
+ name = "cprojf16" ,
2101
+ srcs = ["src/complex/generic/cprojf16.cpp" ],
2102
+ hdrs = ["src/complex/cprojf16.h" ],
2103
+ deps = [
2104
+ ":__support_common" ,
2105
+ ":__support_complex_basic_ops" ,
2106
+ ":__support_macros_config" ,
2107
+ ":__support_macros_properties_complex_types" ,
2108
+ ],
2109
+ )
2110
+
2111
+ libc_function (
2112
+ name = "cprojl" ,
2113
+ srcs = ["src/complex/generic/cprojl.cpp" ],
2114
+ hdrs = ["src/complex/cprojl.h" ],
2115
+ deps = [
2116
+ ":__support_common" ,
2117
+ ":__support_complex_basic_ops" ,
2118
+ ":__support_macros_config" ,
2119
+ ],
2120
+ )
2121
+
2122
+ libc_function (
2123
+ name = "creal" ,
2124
+ srcs = ["src/complex/generic/creal.cpp" ],
2125
+ hdrs = ["src/complex/creal.h" ],
2126
+ deps = [
2127
+ ":__support_common" ,
2128
+ ":__support_complex_type" ,
2129
+ ":__support_cpp_bit" ,
2130
+ ":__support_macros_config" ,
2131
+ ],
2132
+ )
2133
+
2134
+ libc_function (
2135
+ name = "crealf" ,
2136
+ srcs = ["src/complex/generic/crealf.cpp" ],
2137
+ hdrs = ["src/complex/crealf.h" ],
2138
+ deps = [
2139
+ ":__support_common" ,
2140
+ ":__support_complex_type" ,
2141
+ ":__support_cpp_bit" ,
2142
+ ":__support_macros_config" ,
2143
+ ],
2144
+ )
2145
+
2146
+ libc_function (
2147
+ name = "crealf128" ,
2148
+ srcs = ["src/complex/generic/crealf128.cpp" ],
2149
+ hdrs = ["src/complex/crealf128.h" ],
2150
+ deps = [
2151
+ ":__support_common" ,
2152
+ ":__support_complex_type" ,
2153
+ ":__support_cpp_bit" ,
2154
+ ":__support_macros_config" ,
2155
+ ":__support_macros_properties_complex_types" ,
2156
+ ],
2157
+ )
2158
+
2159
+ libc_function (
2160
+ name = "crealf16" ,
2161
+ srcs = ["src/complex/generic/crealf16.cpp" ],
2162
+ hdrs = ["src/complex/crealf16.h" ],
2163
+ deps = [
2164
+ ":__support_common" ,
2165
+ ":__support_complex_type" ,
2166
+ ":__support_cpp_bit" ,
2167
+ ":__support_macros_config" ,
2168
+ ":__support_macros_properties_complex_types" ,
2169
+ ],
2170
+ )
2171
+
2172
+ libc_function (
2173
+ name = "creall" ,
2174
+ srcs = ["src/complex/generic/creall.cpp" ],
2175
+ hdrs = ["src/complex/creall.h" ],
2176
+ deps = [
2177
+ ":__support_common" ,
2178
+ ":__support_complex_type" ,
2179
+ ":__support_cpp_bit" ,
2180
+ ":__support_macros_config" ,
2181
+ ],
2182
+ )
2183
+
1893
2184
################################ math targets ##################################
1894
2185
1895
2186
libc_math_function (
0 commit comments