blob: ba814ebd55b82ec9772d9d233780a03e96ab9eb2 [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",
59 static: {
60 system_shared_libs: [],
61 },
Martin Stjernholmcec4de02020-04-08 01:02:20 +010062 header_libs: ["libc_headers"],
Peter Collingbournea1546db2020-02-21 12:19:26 -080063}
64
Jingwen Chena7c81882021-04-28 08:28:49 +000065cc_library_static {
Peter Collingbournea1546db2020-02-21 12:19:26 -080066 name: "libarm-optimized-routines-math",
67 defaults: ["libarm-optimized-routines-defaults"],
Haibo Huang59371d52020-11-30 18:13:41 -080068 exclude_srcs: [
69 // Provided by:
70 // bionic/libm/upstream-freebsd/lib/msun/src/s_erf.c
71 // bionic/libm/upstream-freebsd/lib/msun/src/s_erff.c
72 "math/erf.c",
73 "math/erf_data.c",
74 "math/erff.c",
75 "math/erff_data.c",
76 ],
Elliott Hughesc2e01832018-07-20 13:55:44 -070077 srcs: [
Haibo Huangcd7d5362019-07-31 18:22:02 -070078 "math/*.c",
Elliott Hughesc2e01832018-07-20 13:55:44 -070079 ],
Adhemerval Zanella8e8d1b72018-08-06 13:22:58 -030080
81 // arch-specific settings
82 arch: {
83 arm64: {
84 cflags: [
85 "-DHAVE_FAST_FMA=1",
86 ],
87 },
88 },
89
Elliott Hughesc2e01832018-07-20 13:55:44 -070090 target: {
Christopher Ferris8785a762018-07-27 13:59:37 -070091 darwin: {
92 enabled: false,
93 },
Elliott Hughesc2e01832018-07-20 13:55:44 -070094 linux_bionic: {
95 enabled: true,
96 },
97 },
Peter Collingbournea1546db2020-02-21 12:19:26 -080098}
99
Jingwen Chena7c81882021-04-28 08:28:49 +0000100cc_library_static {
Peter Collingbournea1546db2020-02-21 12:19:26 -0800101 name: "libarm-optimized-routines-string",
102 defaults: ["libarm-optimized-routines-defaults"],
103
104 arch: {
105 arm64: {
106 srcs: [
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700107 "string/aarch64/memchr-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800108 "string/aarch64/memchr.S",
109 "string/aarch64/memcmp.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700110 "string/aarch64/memrchr.S",
111 "string/aarch64/stpcpy-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800112 "string/aarch64/stpcpy.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700113 "string/aarch64/strchrnul-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800114 "string/aarch64/strchrnul.S",
115 "string/aarch64/strchr-mte.S",
116 "string/aarch64/strchr.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700117 "string/aarch64/strcmp-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800118 "string/aarch64/strcmp.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700119 "string/aarch64/strcpy-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800120 "string/aarch64/strcpy.S",
121 "string/aarch64/strlen-mte.S",
122 "string/aarch64/strlen.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700123 "string/aarch64/strncmp-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800124 "string/aarch64/strncmp.S",
125 "string/aarch64/strnlen.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700126 "string/aarch64/strrchr-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800127 "string/aarch64/strrchr.S",
128 ],
129 asflags: [
130 "-D__memcmp_aarch64=memcmp",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700131 "-D__memrchr_aarch64=memrchr",
132 "-D__strnlen_aarch64=strnlen",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800133 ]
134 },
Dan Willemsen35edf452018-12-03 13:56:24 -0800135 },
Elliott Hughesc2e01832018-07-20 13:55:44 -0700136}
137
Elliott Hughese9c71052018-08-01 13:26:04 -0700138// adb shell "/data/nativetest64/mathtest/mathtest /data/nativetest64/mathtest/test/testcases/directed/*"
139// adb shell "/data/nativetest/mathtest/mathtest /data/nativetest/mathtest/test/testcases/directed/*"
Elliott Hughesc2e01832018-07-20 13:55:44 -0700140cc_test {
141 name: "mathtest",
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800142 defaults: ["arm-optimized-routines-defaults"],
Elliott Hughesc2e01832018-07-20 13:55:44 -0700143 gtest: false,
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800144 cflags: ["-Wno-missing-braces"],
145 srcs: ["math/test/mathtest.c"],
Haibo Huangcd7d5362019-07-31 18:22:02 -0700146 data: ["math/test/testcases/directed/*.tst"],
Elliott Hughesc2e01832018-07-20 13:55:44 -0700147 target: {
Elliott Hughese3966aa2018-07-26 08:46:15 -0700148 darwin: {
149 enabled: false,
150 },
Elliott Hughesc2e01832018-07-20 13:55:44 -0700151 linux_bionic: {
152 enabled: true,
153 },
154 },
155}
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800156
157cc_test {
158 name: "ulp",
159 defaults: ["arm-optimized-routines-defaults"],
160 gtest: false,
161 srcs: ["math/test/ulp.c"],
162 data: ["math/test/runulp.sh"],
163}
164
165sh_test {
166 name: "arm-optimized-routines-tests",
167 src: "run-arm-optimized-routines-tests-on-android.sh",
168 filename: "run-arm-optimized-routines-tests-on-android.sh",
169 test_suites: ["general-tests"],
170 host_supported: true,
171 device_supported: false,
frankfeng726e3ec2020-10-16 13:55:24 -0700172 require_root: true,
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800173 target_required: [
174 "mathtest",
175 "ulp",
176 ],
177}