blob: cc18a7c73e8acb3c7ca8ec69db04a82fc899cd0b [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"],
32 recovery_available: true,
Peter Collingbournea1546db2020-02-21 12:19:26 -080033
34 stl: "none",
35 static: {
36 system_shared_libs: [],
37 },
Martin Stjernholmcec4de02020-04-08 01:02:20 +010038 header_libs: ["libc_headers"],
Peter Collingbournea1546db2020-02-21 12:19:26 -080039}
40
41cc_library {
42 name: "libarm-optimized-routines-math",
43 defaults: ["libarm-optimized-routines-defaults"],
Elliott Hughesc2e01832018-07-20 13:55:44 -070044 srcs: [
Haibo Huangcd7d5362019-07-31 18:22:02 -070045 "math/*.c",
Elliott Hughesc2e01832018-07-20 13:55:44 -070046 ],
Adhemerval Zanella8e8d1b72018-08-06 13:22:58 -030047
48 // arch-specific settings
49 arch: {
50 arm64: {
51 cflags: [
52 "-DHAVE_FAST_FMA=1",
53 ],
54 },
55 },
56
Elliott Hughesc2e01832018-07-20 13:55:44 -070057 target: {
Christopher Ferris8785a762018-07-27 13:59:37 -070058 darwin: {
59 enabled: false,
60 },
Elliott Hughesc2e01832018-07-20 13:55:44 -070061 linux_bionic: {
62 enabled: true,
63 },
64 },
Peter Collingbournea1546db2020-02-21 12:19:26 -080065}
66
67cc_library {
68 name: "libarm-optimized-routines-string",
69 defaults: ["libarm-optimized-routines-defaults"],
70
71 arch: {
72 arm64: {
73 srcs: [
Peter Collingbourne5bde7af2020-06-03 16:56:02 -070074 "string/aarch64/memchr-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -080075 "string/aarch64/memchr.S",
76 "string/aarch64/memcmp.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -070077 "string/aarch64/memrchr.S",
78 "string/aarch64/stpcpy-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -080079 "string/aarch64/stpcpy.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -070080 "string/aarch64/strchrnul-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -080081 "string/aarch64/strchrnul.S",
82 "string/aarch64/strchr-mte.S",
83 "string/aarch64/strchr.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -070084 "string/aarch64/strcmp-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -080085 "string/aarch64/strcmp.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -070086 "string/aarch64/strcpy-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -080087 "string/aarch64/strcpy.S",
88 "string/aarch64/strlen-mte.S",
89 "string/aarch64/strlen.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -070090 "string/aarch64/strncmp-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -080091 "string/aarch64/strncmp.S",
92 "string/aarch64/strnlen.S",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -070093 "string/aarch64/strrchr-mte.S",
Peter Collingbournea1546db2020-02-21 12:19:26 -080094 "string/aarch64/strrchr.S",
95 ],
96 asflags: [
97 "-D__memcmp_aarch64=memcmp",
Peter Collingbourne5bde7af2020-06-03 16:56:02 -070098 "-D__memrchr_aarch64=memrchr",
99 "-D__strnlen_aarch64=strnlen",
Peter Collingbournea1546db2020-02-21 12:19:26 -0800100 ]
101 },
Dan Willemsen35edf452018-12-03 13:56:24 -0800102 },
Elliott Hughesc2e01832018-07-20 13:55:44 -0700103}
104
Elliott Hughese9c71052018-08-01 13:26:04 -0700105// adb shell "/data/nativetest64/mathtest/mathtest /data/nativetest64/mathtest/test/testcases/directed/*"
106// adb shell "/data/nativetest/mathtest/mathtest /data/nativetest/mathtest/test/testcases/directed/*"
Elliott Hughesc2e01832018-07-20 13:55:44 -0700107cc_test {
108 name: "mathtest",
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800109 defaults: ["arm-optimized-routines-defaults"],
Elliott Hughesc2e01832018-07-20 13:55:44 -0700110 gtest: false,
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800111 cflags: ["-Wno-missing-braces"],
112 srcs: ["math/test/mathtest.c"],
Haibo Huangcd7d5362019-07-31 18:22:02 -0700113 data: ["math/test/testcases/directed/*.tst"],
Elliott Hughesc2e01832018-07-20 13:55:44 -0700114 target: {
Elliott Hughese3966aa2018-07-26 08:46:15 -0700115 darwin: {
116 enabled: false,
117 },
Elliott Hughesc2e01832018-07-20 13:55:44 -0700118 linux_bionic: {
119 enabled: true,
120 },
121 },
122}
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800123
124cc_test {
125 name: "ulp",
126 defaults: ["arm-optimized-routines-defaults"],
127 gtest: false,
128 srcs: ["math/test/ulp.c"],
129 data: ["math/test/runulp.sh"],
130}
131
132sh_test {
133 name: "arm-optimized-routines-tests",
134 src: "run-arm-optimized-routines-tests-on-android.sh",
135 filename: "run-arm-optimized-routines-tests-on-android.sh",
136 test_suites: ["general-tests"],
137 host_supported: true,
138 device_supported: false,
139 test_config: "arm-optimized-routines-tests.xml",
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800140}