blob: eac33496bb9752e765971a931ef86b9c0c5de34e [file] [log] [blame]
Elliott Hughes3eae8e02019-12-18 14:17:17 -08001cc_defaults {
2 name: "arm-optimized-routines-defaults",
Elliott Hughesc2e01832018-07-20 13:55:44 -07003 host_supported: true,
4 cflags: [
5 "-Werror",
Elliott Hughes7504fa92019-10-16 11:00:15 -07006 "-Wno-unused-parameter",
Elliott Hughesc2e01832018-07-20 13:55:44 -07007 "-O2",
Elliott Hughesef3eb232020-01-10 15:06:56 -08008 "-ffp-contract=fast",
9 "-fno-math-errno",
10
11 // bionic configuration.
12
Elliott Hughes055b2f32019-09-17 13:05:56 -070013 // We're actually implementing bionic here, so we don't want <math.h>
14 // to try to be helpful by renaming long double routines.
15 "-D__BIONIC_LP32_USE_LONG_DOUBLE",
Adhemerval Zanella9e6e8322018-07-26 11:43:46 -030016 "-DFLT_EVAL_METHOD=0",
Elliott Hughesef3eb232020-01-10 15:06:56 -080017
18 // arm-optimized-routines configuration.
19
20 // BSD libm doesn't set errno, and bionic was based on the BSDs.
21 // https://github.com/ARM-software/optimized-routines/issues/16#issuecomment-572009659
22 "-DWANT_ERRNO=0",
Elliott Hughes9ba6fed2020-01-13 09:07:28 -080023 // TODO: we may want the vector code in future, but it's not ready yet.
Elliott Hughesef3eb232020-01-10 15:06:56 -080024 "-DWANT_VMATH=0",
Elliott Hughesc2e01832018-07-20 13:55:44 -070025 ],
Elliott Hughes3f885362019-10-15 09:04:39 -070026 local_include_dirs: ["math/include"],
Elliott Hughes3eae8e02019-12-18 14:17:17 -080027}
28
Peter Collingbournea1546db2020-02-21 12:19:26 -080029cc_defaults {
30 name: "libarm-optimized-routines-defaults",
Elliott Hughes3eae8e02019-12-18 14:17:17 -080031 defaults: ["arm-optimized-routines-defaults"],
Yifan Hong212cd842020-01-21 18:16:50 -080032 ramdisk_available: true,
Yifan Hongc13a69b2020-10-21 18:39:44 -070033 vendor_ramdisk_available: true,
Elliott Hughes3eae8e02019-12-18 14:17:17 -080034 recovery_available: true,
35 native_bridge_supported: true,
Peter Collingbournea1546db2020-02-21 12:19:26 -080036 apex_available: [
37 "//apex_available:platform",
38 "com.android.runtime",
39 ],
40
41 stl: "none",
42 static: {
43 system_shared_libs: [],
44 },
Martin Stjernholmcec4de02020-04-08 01:02:20 +010045 header_libs: ["libc_headers"],
Peter Collingbournea1546db2020-02-21 12:19:26 -080046}
47
48cc_library {
49 name: "libarm-optimized-routines-math",
50 defaults: ["libarm-optimized-routines-defaults"],
Elliott Hughesc2e01832018-07-20 13:55:44 -070051 srcs: [
Haibo Huangcd7d5362019-07-31 18:22:02 -070052 "math/*.c",
Elliott Hughesc2e01832018-07-20 13:55:44 -070053 ],
Adhemerval Zanella8e8d1b72018-08-06 13:22:58 -030054
55 // arch-specific settings
56 arch: {
57 arm64: {
58 cflags: [
59 "-DHAVE_FAST_FMA=1",
60 ],
61 },
62 },
63
Elliott Hughesc2e01832018-07-20 13:55:44 -070064 target: {
Christopher Ferris8785a762018-07-27 13:59:37 -070065 darwin: {
66 enabled: false,
67 },
Elliott Hughesc2e01832018-07-20 13:55:44 -070068 linux_bionic: {
69 enabled: true,
70 },
71 },
Peter Collingbournea1546db2020-02-21 12:19:26 -080072}
73
74cc_library {
75 name: "libarm-optimized-routines-string",
76 defaults: ["libarm-optimized-routines-defaults"],
77
78 arch: {
79 arm64: {
80 srcs: [
Peter Collingbourne5bde7af2020-06-03 16:56:02 -070081 "string/aarch64/memchr-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -080082 "string/aarch64/memchr.S",
83 "string/aarch64/memcmp.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -070084 "string/aarch64/memrchr.S",
85 "string/aarch64/stpcpy-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -080086 "string/aarch64/stpcpy.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -070087 "string/aarch64/strchrnul-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -080088 "string/aarch64/strchrnul.S",
89 "string/aarch64/strchr-mte.S",
90 "string/aarch64/strchr.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -070091 "string/aarch64/strcmp-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -080092 "string/aarch64/strcmp.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -070093 "string/aarch64/strcpy-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -080094 "string/aarch64/strcpy.S",
95 "string/aarch64/strlen-mte.S",
96 "string/aarch64/strlen.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -070097 "string/aarch64/strncmp-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -080098 "string/aarch64/strncmp.S",
99 "string/aarch64/strnlen.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700100 "string/aarch64/strrchr-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800101 "string/aarch64/strrchr.S",
102 ],
103 asflags: [
104 "-D__memcmp_aarch64=memcmp",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -0700105 "-D__memrchr_aarch64=memrchr",
106 "-D__strnlen_aarch64=strnlen",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800107 ]
108 },
Dan Willemsen35edf452018-12-03 13:56:24 -0800109 },
Elliott Hughesc2e01832018-07-20 13:55:44 -0700110}
111
Elliott Hughese9c71052018-08-01 13:26:04 -0700112// adb shell "/data/nativetest64/mathtest/mathtest /data/nativetest64/mathtest/test/testcases/directed/*"
113// adb shell "/data/nativetest/mathtest/mathtest /data/nativetest/mathtest/test/testcases/directed/*"
Elliott Hughesc2e01832018-07-20 13:55:44 -0700114cc_test {
115 name: "mathtest",
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800116 defaults: ["arm-optimized-routines-defaults"],
Elliott Hughesc2e01832018-07-20 13:55:44 -0700117 gtest: false,
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800118 cflags: ["-Wno-missing-braces"],
119 srcs: ["math/test/mathtest.c"],
Haibo Huangcd7d5362019-07-31 18:22:02 -0700120 data: ["math/test/testcases/directed/*.tst"],
Elliott Hughesc2e01832018-07-20 13:55:44 -0700121 target: {
Elliott Hughese3966aa2018-07-26 08:46:15 -0700122 darwin: {
123 enabled: false,
124 },
Elliott Hughesc2e01832018-07-20 13:55:44 -0700125 linux_bionic: {
126 enabled: true,
127 },
128 },
129}
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800130
131cc_test {
132 name: "ulp",
133 defaults: ["arm-optimized-routines-defaults"],
134 gtest: false,
135 srcs: ["math/test/ulp.c"],
136 data: ["math/test/runulp.sh"],
137}
138
139sh_test {
140 name: "arm-optimized-routines-tests",
141 src: "run-arm-optimized-routines-tests-on-android.sh",
142 filename: "run-arm-optimized-routines-tests-on-android.sh",
143 test_suites: ["general-tests"],
144 host_supported: true,
145 device_supported: false,
146 test_config: "arm-optimized-routines-tests.xml",
147 target_required: [
148 "mathtest",
149 "ulp",
150 ],
151}