blob: 1f1d260b273657678398a7842b0d1e0330548a14 [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 },
Martin Stjernholmcec4de02020-04-08 01:02:20 +010044 header_libs: ["libc_headers"],
Peter Collingbournea1546db2020-02-21 12:19:26 -080045}
46
47cc_library {
48 name: "libarm-optimized-routines-math",
49 defaults: ["libarm-optimized-routines-defaults"],
Elliott Hughesc2e01832018-07-20 13:55:44 -070050 srcs: [
Haibo Huangcd7d5362019-07-31 18:22:02 -070051 "math/*.c",
Elliott Hughesc2e01832018-07-20 13:55:44 -070052 ],
Adhemerval Zanella8e8d1b72018-08-06 13:22:58 -030053
54 // arch-specific settings
55 arch: {
56 arm64: {
57 cflags: [
58 "-DHAVE_FAST_FMA=1",
59 ],
60 },
61 },
62
Elliott Hughesc2e01832018-07-20 13:55:44 -070063 target: {
Christopher Ferris8785a762018-07-27 13:59:37 -070064 darwin: {
65 enabled: false,
66 },
Elliott Hughesc2e01832018-07-20 13:55:44 -070067 linux_bionic: {
68 enabled: true,
69 },
70 },
Peter Collingbournea1546db2020-02-21 12:19:26 -080071}
72
73cc_library {
74 name: "libarm-optimized-routines-string",
75 defaults: ["libarm-optimized-routines-defaults"],
76
77 arch: {
78 arm64: {
79 srcs: [
80 "string/aarch64/memchr.S",
81 "string/aarch64/memcmp.S",
82 "string/aarch64/stpcpy.S",
83 "string/aarch64/strchrnul.S",
84 "string/aarch64/strchr-mte.S",
85 "string/aarch64/strchr.S",
86 "string/aarch64/strcmp.S",
87 "string/aarch64/strcpy.S",
88 "string/aarch64/strlen-mte.S",
89 "string/aarch64/strlen.S",
90 "string/aarch64/strncmp.S",
91 "string/aarch64/strnlen.S",
92 "string/aarch64/strrchr.S",
93 ],
94 asflags: [
95 "-D__memcmp_aarch64=memcmp",
96 ]
97 },
Dan Willemsen35edf452018-12-03 13:56:24 -080098 },
Elliott Hughesc2e01832018-07-20 13:55:44 -070099}
100
Elliott Hughese9c71052018-08-01 13:26:04 -0700101// adb shell "/data/nativetest64/mathtest/mathtest /data/nativetest64/mathtest/test/testcases/directed/*"
102// adb shell "/data/nativetest/mathtest/mathtest /data/nativetest/mathtest/test/testcases/directed/*"
Elliott Hughesc2e01832018-07-20 13:55:44 -0700103cc_test {
104 name: "mathtest",
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800105 defaults: ["arm-optimized-routines-defaults"],
Elliott Hughesc2e01832018-07-20 13:55:44 -0700106 gtest: false,
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800107 cflags: ["-Wno-missing-braces"],
108 srcs: ["math/test/mathtest.c"],
Haibo Huangcd7d5362019-07-31 18:22:02 -0700109 data: ["math/test/testcases/directed/*.tst"],
Elliott Hughesc2e01832018-07-20 13:55:44 -0700110 target: {
Elliott Hughese3966aa2018-07-26 08:46:15 -0700111 darwin: {
112 enabled: false,
113 },
Elliott Hughesc2e01832018-07-20 13:55:44 -0700114 linux_bionic: {
115 enabled: true,
116 },
117 },
118}
Elliott Hughes3eae8e02019-12-18 14:17:17 -0800119
120cc_test {
121 name: "ulp",
122 defaults: ["arm-optimized-routines-defaults"],
123 gtest: false,
124 srcs: ["math/test/ulp.c"],
125 data: ["math/test/runulp.sh"],
126}
127
128sh_test {
129 name: "arm-optimized-routines-tests",
130 src: "run-arm-optimized-routines-tests-on-android.sh",
131 filename: "run-arm-optimized-routines-tests-on-android.sh",
132 test_suites: ["general-tests"],
133 host_supported: true,
134 device_supported: false,
135 test_config: "arm-optimized-routines-tests.xml",
136 target_required: [
137 "mathtest",
138 "ulp",
139 ],
140}