blob: 04831a420dc130259f277c3ec233cd21033ba1c8 [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",
23 // TODO: we will want the SVE code in future, but it's not ready yet.
24 "-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"],
32 recovery_available: true,
33 native_bridge_supported: true,
Elliott Hughesc2e01832018-07-20 13:55:44 -070034 srcs: [
Haibo Huangcd7d5362019-07-31 18:22:02 -070035 "math/*.c",
Elliott Hughesc2e01832018-07-20 13:55:44 -070036 ],
Adhemerval Zanella8e8d1b72018-08-06 13:22:58 -030037
38 // arch-specific settings
39 arch: {
40 arm64: {
41 cflags: [
42 "-DHAVE_FAST_FMA=1",
43 ],
44 },
45 },
46
Elliott Hughesc2e01832018-07-20 13:55:44 -070047 target: {
Christopher Ferris8785a762018-07-27 13:59:37 -070048 darwin: {
49 enabled: false,
50 },
Elliott Hughesc2e01832018-07-20 13:55:44 -070051 linux_bionic: {
52 enabled: true,
53 },
54 },
55 stl: "none",
Dan Willemsen35edf452018-12-03 13:56:24 -080056 static: {
57 system_shared_libs: [],
58 },
Elliott Hughesc2e01832018-07-20 13:55:44 -070059}
60
Elliott Hughese9c71052018-08-01 13:26:04 -070061// adb shell "/data/nativetest64/mathtest/mathtest /data/nativetest64/mathtest/test/testcases/directed/*"
62// adb shell "/data/nativetest/mathtest/mathtest /data/nativetest/mathtest/test/testcases/directed/*"
Elliott Hughesc2e01832018-07-20 13:55:44 -070063cc_test {
64 name: "mathtest",
Elliott Hughes3eae8e02019-12-18 14:17:17 -080065 defaults: ["arm-optimized-routines-defaults"],
Elliott Hughesc2e01832018-07-20 13:55:44 -070066 gtest: false,
Elliott Hughes3eae8e02019-12-18 14:17:17 -080067 cflags: ["-Wno-missing-braces"],
68 srcs: ["math/test/mathtest.c"],
Haibo Huangcd7d5362019-07-31 18:22:02 -070069 data: ["math/test/testcases/directed/*.tst"],
Elliott Hughesc2e01832018-07-20 13:55:44 -070070 target: {
Elliott Hughese3966aa2018-07-26 08:46:15 -070071 darwin: {
72 enabled: false,
73 },
Elliott Hughesc2e01832018-07-20 13:55:44 -070074 linux_bionic: {
75 enabled: true,
76 },
77 },
78}
Elliott Hughes3eae8e02019-12-18 14:17:17 -080079
80cc_test {
81 name: "ulp",
82 defaults: ["arm-optimized-routines-defaults"],
83 gtest: false,
84 srcs: ["math/test/ulp.c"],
85 data: ["math/test/runulp.sh"],
86}
87
88sh_test {
89 name: "arm-optimized-routines-tests",
90 src: "run-arm-optimized-routines-tests-on-android.sh",
91 filename: "run-arm-optimized-routines-tests-on-android.sh",
92 test_suites: ["general-tests"],
93 host_supported: true,
94 device_supported: false,
95 test_config: "arm-optimized-routines-tests.xml",
96 target_required: [
97 "mathtest",
98 "ulp",
99 ],
100}