blob: 8fe656e127818ae4f434032416504eac5e7bd521 [file] [log] [blame]
Bob Badourb663c002021-02-12 15:04:25 -08001package {
2 default_applicable_licenses: ["external_arm-optimized-routines_license"],
3}
4
5// Added automatically by a large-scale-change
6// See: http://go/android-license-faq
7license {
8 name: "external_arm-optimized-routines_license",
9 visibility: [":__subpackages__"],
10 license_kinds: [
11 "SPDX-license-identifier-MIT",
12 ],
13 license_text: [
14 "LICENSE",
15 ],
16}
17
Elliott Hughes3eae8e02019-12-18 14:17:17 -080018cc_defaults {
19 name: "arm-optimized-routines-defaults",
Elliott Hughesc2e01832018-07-20 13:55:44 -070020 host_supported: true,
21 cflags: [
22 "-Werror",
Elliott Hughes7504fa92019-10-16 11:00:15 -070023 "-Wno-unused-parameter",
Elliott Hughesc2e01832018-07-20 13:55:44 -070024 "-O2",
Elliott Hughesef3eb232020-01-10 15:06:56 -080025 "-ffp-contract=fast",
26 "-fno-math-errno",
27
28 // bionic configuration.
29
Elliott Hughes055b2f32019-09-17 13:05:56 -070030 // We're actually implementing bionic here, so we don't want <math.h>
31 // to try to be helpful by renaming long double routines.
32 "-D__BIONIC_LP32_USE_LONG_DOUBLE",
Adhemerval Zanella9e6e8322018-07-26 11:43:46 -030033 "-DFLT_EVAL_METHOD=0",
Elliott Hughesef3eb232020-01-10 15:06:56 -080034
35 // arm-optimized-routines configuration.
36
37 // BSD libm doesn't set errno, and bionic was based on the BSDs.
38 // https://github.com/ARM-software/optimized-routines/issues/16#issuecomment-572009659
39 "-DWANT_ERRNO=0",
Elliott Hughes9ba6fed2020-01-13 09:07:28 -080040 // TODO: we may want the vector code in future, but it's not ready yet.
Elliott Hughesef3eb232020-01-10 15:06:56 -080041 "-DWANT_VMATH=0",
Elliott Hughesc2e01832018-07-20 13:55:44 -070042 ],
Elliott Hughes3f885362019-10-15 09:04:39 -070043 local_include_dirs: ["math/include"],
Elliott Hughes3eae8e02019-12-18 14:17:17 -080044}
45
Peter Collingbournea1546db2020-02-21 12:19:26 -080046cc_defaults {
47 name: "libarm-optimized-routines-defaults",
Elliott Hughes3eae8e02019-12-18 14:17:17 -080048 defaults: ["arm-optimized-routines-defaults"],
Yifan Hong212cd842020-01-21 18:16:50 -080049 ramdisk_available: true,
Yifan Hongc13a69b2020-10-21 18:39:44 -070050 vendor_ramdisk_available: true,
Elliott Hughes3eae8e02019-12-18 14:17:17 -080051 recovery_available: true,
52 native_bridge_supported: true,
Peter Collingbournea1546db2020-02-21 12:19:26 -080053 apex_available: [
54 "//apex_available:platform",
55 "com.android.runtime",
56 ],
57
58 stl: "none",
Colin Cross74985fc2022-02-02 13:38:12 -080059 target: {
60 bionic: {
61 static: {
62 system_shared_libs: [],
63 },
64 header_libs: ["libc_headers"],
65 },
Peter Collingbournea1546db2020-02-21 12:19:26 -080066 },
67}
68
Jingwen Chena7c81882021-04-28 08:28:49 +000069cc_library_static {
Peter Collingbournea1546db2020-02-21 12:19:26 -080070 name: "libarm-optimized-routines-math",
71 defaults: ["libarm-optimized-routines-defaults"],
Haibo Huang59371d52020-11-30 18:13:41 -080072 exclude_srcs: [
73 // Provided by:
74 // bionic/libm/upstream-freebsd/lib/msun/src/s_erf.c
75 // bionic/libm/upstream-freebsd/lib/msun/src/s_erff.c
76 "math/erf.c",
77 "math/erf_data.c",
78 "math/erff.c",
79 "math/erff_data.c",
80 ],
Elliott Hughesc2e01832018-07-20 13:55:44 -070081 srcs: [
Haibo Huangcd7d5362019-07-31 18:22:02 -070082 "math/*.c",
Elliott Hughesc2e01832018-07-20 13:55:44 -070083 ],
Adhemerval Zanella8e8d1b72018-08-06 13:22:58 -030084
85 // arch-specific settings
86 arch: {
87 arm64: {
88 cflags: [
89 "-DHAVE_FAST_FMA=1",
90 ],
91 },
92 },
93
Elliott Hughesc2e01832018-07-20 13:55:44 -070094 target: {
Christopher Ferris8785a762018-07-27 13:59:37 -070095 darwin: {
96 enabled: false,
97 },
Elliott Hughesc2e01832018-07-20 13:55:44 -070098 linux_bionic: {
99 enabled: true,
100 },
101 },
Peter Collingbournea1546db2020-02-21 12:19:26 -0800102}
103
Jingwen Chena7c81882021-04-28 08:28:49 +0000104cc_library_static {
Peter Collingbournea1546db2020-02-21 12:19:26 -0800105 name: "libarm-optimized-routines-string",
106 defaults: ["libarm-optimized-routines-defaults"],
107
108 arch: {
109 arm64: {
110 srcs: [
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700111 "string/aarch64/memchr-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800112 "string/aarch64/memchr.S",
113 "string/aarch64/memcmp.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700114 "string/aarch64/memrchr.S",
115 "string/aarch64/stpcpy-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800116 "string/aarch64/stpcpy.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700117 "string/aarch64/strchrnul-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800118 "string/aarch64/strchrnul.S",
119 "string/aarch64/strchr-mte.S",
120 "string/aarch64/strchr.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700121 "string/aarch64/strcmp-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800122 "string/aarch64/strcmp.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700123 "string/aarch64/strcpy-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800124 "string/aarch64/strcpy.S",
125 "string/aarch64/strlen-mte.S",
126 "string/aarch64/strlen.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700127 "string/aarch64/strncmp-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800128 "string/aarch64/strncmp.S",
129 "string/aarch64/strnlen.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700130 "string/aarch64/strrchr-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800131 "string/aarch64/strrchr.S",
132 ],
133 asflags: [
134 "-D__memcmp_aarch64=memcmp",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700135 "-D__memrchr_aarch64=memrchr",
136 "-D__strnlen_aarch64=strnlen",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800137 ]
138 },
Dan Willemsen35edf452018-12-03 13:56:24 -0800139 },
Elliott Hughesc2e01832018-07-20 13:55:44 -0700140}
141
Elliott Hughese9c71052018-08-01 13:26:04 -0700142// adb shell "/data/nativetest64/mathtest/mathtest /data/nativetest64/mathtest/test/testcases/directed/*"
143// adb shell "/data/nativetest/mathtest/mathtest /data/nativetest/mathtest/test/testcases/directed/*"
Elliott Hughesc2e01832018-07-20 13:55:44 -0700144cc_test {
145 name: "mathtest",
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800146 defaults: ["arm-optimized-routines-defaults"],
Elliott Hughesc2e01832018-07-20 13:55:44 -0700147 gtest: false,
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800148 cflags: ["-Wno-missing-braces"],
149 srcs: ["math/test/mathtest.c"],
Haibo Huangcd7d5362019-07-31 18:22:02 -0700150 data: ["math/test/testcases/directed/*.tst"],
Elliott Hughesc2e01832018-07-20 13:55:44 -0700151 target: {
Elliott Hughese3966aa2018-07-26 08:46:15 -0700152 darwin: {
153 enabled: false,
154 },
Elliott Hughesc2e01832018-07-20 13:55:44 -0700155 linux_bionic: {
156 enabled: true,
157 },
158 },
159}
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800160
161cc_test {
162 name: "ulp",
163 defaults: ["arm-optimized-routines-defaults"],
164 gtest: false,
165 srcs: ["math/test/ulp.c"],
166 data: ["math/test/runulp.sh"],
167}
168
169sh_test {
170 name: "arm-optimized-routines-tests",
171 src: "run-arm-optimized-routines-tests-on-android.sh",
172 filename: "run-arm-optimized-routines-tests-on-android.sh",
173 test_suites: ["general-tests"],
174 host_supported: true,
175 device_supported: false,
frankfeng726e3ec2020-10-16 13:55:24 -0700176 require_root: true,
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800177 target_required: [
178 "mathtest",
179 "ulp",
180 ],
181}