blob: 6a8212093b54091471885c72f4cd0e06388614aa [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,
Elliott Hughes3eae8e02019-12-18 14:17:17 -080033 recovery_available: true,
34 native_bridge_supported: true,
Peter Collingbournea1546db2020-02-21 12:19:26 -080035 apex_available: [
36 "//apex_available:platform",
37 "com.android.runtime",
38 ],
39
40 stl: "none",
41 static: {
42 system_shared_libs: [],
43 },
44}
45
46cc_library {
47 name: "libarm-optimized-routines-math",
48 defaults: ["libarm-optimized-routines-defaults"],
Elliott Hughesc2e01832018-07-20 13:55:44 -070049 srcs: [
Haibo Huangcd7d5362019-07-31 18:22:02 -070050 "math/*.c",
Elliott Hughesc2e01832018-07-20 13:55:44 -070051 ],
Adhemerval Zanella8e8d1b72018-08-06 13:22:58 -030052
53 // arch-specific settings
54 arch: {
55 arm64: {
56 cflags: [
57 "-DHAVE_FAST_FMA=1",
58 ],
59 },
60 },
61
Elliott Hughesc2e01832018-07-20 13:55:44 -070062 target: {
Christopher Ferris8785a762018-07-27 13:59:37 -070063 darwin: {
64 enabled: false,
65 },
Elliott Hughesc2e01832018-07-20 13:55:44 -070066 linux_bionic: {
67 enabled: true,
68 },
69 },
Peter Collingbournea1546db2020-02-21 12:19:26 -080070}
71
72cc_library {
73 name: "libarm-optimized-routines-string",
74 defaults: ["libarm-optimized-routines-defaults"],
75
76 arch: {
77 arm64: {
78 srcs: [
79 "string/aarch64/memchr.S",
80 "string/aarch64/memcmp.S",
81 "string/aarch64/stpcpy.S",
82 "string/aarch64/strchrnul.S",
83 "string/aarch64/strchr-mte.S",
84 "string/aarch64/strchr.S",
85 "string/aarch64/strcmp.S",
86 "string/aarch64/strcpy.S",
87 "string/aarch64/strlen-mte.S",
88 "string/aarch64/strlen.S",
89 "string/aarch64/strncmp.S",
90 "string/aarch64/strnlen.S",
91 "string/aarch64/strrchr.S",
92 ],
93 asflags: [
94 "-D__memcmp_aarch64=memcmp",
95 ]
96 },
Dan Willemsen35edf452018-12-03 13:56:24 -080097 },
Elliott Hughesc2e01832018-07-20 13:55:44 -070098}
99
Elliott Hughese9c71052018-08-01 13:26:04 -0700100// adb shell "/data/nativetest64/mathtest/mathtest /data/nativetest64/mathtest/test/testcases/directed/*"
101// adb shell "/data/nativetest/mathtest/mathtest /data/nativetest/mathtest/test/testcases/directed/*"
Elliott Hughesc2e01832018-07-20 13:55:44 -0700102cc_test {
103 name: "mathtest",
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800104 defaults: ["arm-optimized-routines-defaults"],
Elliott Hughesc2e01832018-07-20 13:55:44 -0700105 gtest: false,
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800106 cflags: ["-Wno-missing-braces"],
107 srcs: ["math/test/mathtest.c"],
Haibo Huangcd7d5362019-07-31 18:22:02 -0700108 data: ["math/test/testcases/directed/*.tst"],
Elliott Hughesc2e01832018-07-20 13:55:44 -0700109 target: {
Elliott Hughese3966aa2018-07-26 08:46:15 -0700110 darwin: {
111 enabled: false,
112 },
Elliott Hughesc2e01832018-07-20 13:55:44 -0700113 linux_bionic: {
114 enabled: true,
115 },
116 },
117}
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800118
119cc_test {
120 name: "ulp",
121 defaults: ["arm-optimized-routines-defaults"],
122 gtest: false,
123 srcs: ["math/test/ulp.c"],
124 data: ["math/test/runulp.sh"],
125}
126
127sh_test {
128 name: "arm-optimized-routines-tests",
129 src: "run-arm-optimized-routines-tests-on-android.sh",
130 filename: "run-arm-optimized-routines-tests-on-android.sh",
131 test_suites: ["general-tests"],
132 host_supported: true,
133 device_supported: false,
134 test_config: "arm-optimized-routines-tests.xml",
135 target_required: [
136 "mathtest",
137 "ulp",
138 ],
139}