blob: ea477a157319b63fd54ed47f2688a6f3b89e319f [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
29cc_library {
Elliott Hughes54389862020-01-07 13:48:01 -080030 name: "libarm-optimized-routines-math",
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,
Elliott Hughesc2e01832018-07-20 13:55:44 -070035 srcs: [
Haibo Huangcd7d5362019-07-31 18:22:02 -070036 "math/*.c",
Elliott Hughesc2e01832018-07-20 13:55:44 -070037 ],
Adhemerval Zanella8e8d1b72018-08-06 13:22:58 -030038
39 // arch-specific settings
40 arch: {
41 arm64: {
42 cflags: [
43 "-DHAVE_FAST_FMA=1",
44 ],
45 },
46 },
47
Elliott Hughesc2e01832018-07-20 13:55:44 -070048 target: {
Christopher Ferris8785a762018-07-27 13:59:37 -070049 darwin: {
50 enabled: false,
51 },
Elliott Hughesc2e01832018-07-20 13:55:44 -070052 linux_bionic: {
53 enabled: true,
54 },
55 },
56 stl: "none",
Dan Willemsen35edf452018-12-03 13:56:24 -080057 static: {
58 system_shared_libs: [],
59 },
Elliott Hughesc2e01832018-07-20 13:55:44 -070060}
61
Elliott Hughese9c71052018-08-01 13:26:04 -070062// adb shell "/data/nativetest64/mathtest/mathtest /data/nativetest64/mathtest/test/testcases/directed/*"
63// adb shell "/data/nativetest/mathtest/mathtest /data/nativetest/mathtest/test/testcases/directed/*"
Elliott Hughesc2e01832018-07-20 13:55:44 -070064cc_test {
65 name: "mathtest",
Elliott Hughes3eae8e02019-12-18 14:17:17 -080066 defaults: ["arm-optimized-routines-defaults"],
Elliott Hughesc2e01832018-07-20 13:55:44 -070067 gtest: false,
Elliott Hughes3eae8e02019-12-18 14:17:17 -080068 cflags: ["-Wno-missing-braces"],
69 srcs: ["math/test/mathtest.c"],
Haibo Huangcd7d5362019-07-31 18:22:02 -070070 data: ["math/test/testcases/directed/*.tst"],
Elliott Hughesc2e01832018-07-20 13:55:44 -070071 target: {
Elliott Hughese3966aa2018-07-26 08:46:15 -070072 darwin: {
73 enabled: false,
74 },
Elliott Hughesc2e01832018-07-20 13:55:44 -070075 linux_bionic: {
76 enabled: true,
77 },
78 },
79}
Elliott Hughes3eae8e02019-12-18 14:17:17 -080080
81cc_test {
82 name: "ulp",
83 defaults: ["arm-optimized-routines-defaults"],
84 gtest: false,
85 srcs: ["math/test/ulp.c"],
86 data: ["math/test/runulp.sh"],
87}
88
89sh_test {
90 name: "arm-optimized-routines-tests",
91 src: "run-arm-optimized-routines-tests-on-android.sh",
92 filename: "run-arm-optimized-routines-tests-on-android.sh",
93 test_suites: ["general-tests"],
94 host_supported: true,
95 device_supported: false,
96 test_config: "arm-optimized-routines-tests.xml",
97 target_required: [
98 "mathtest",
99 "ulp",
100 ],
101}