Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 1 | cc_defaults { |
| 2 | name: "arm-optimized-routines-defaults", |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 3 | host_supported: true, |
| 4 | cflags: [ |
| 5 | "-Werror", |
Elliott Hughes | 7504fa9 | 2019-10-16 11:00:15 -0700 | [diff] [blame] | 6 | "-Wno-unused-parameter", |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 7 | "-O2", |
Elliott Hughes | ef3eb23 | 2020-01-10 15:06:56 -0800 | [diff] [blame] | 8 | "-ffp-contract=fast", |
| 9 | "-fno-math-errno", |
| 10 | |
| 11 | // bionic configuration. |
| 12 | |
Elliott Hughes | 055b2f3 | 2019-09-17 13:05:56 -0700 | [diff] [blame] | 13 | // 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 Zanella | 9e6e832 | 2018-07-26 11:43:46 -0300 | [diff] [blame] | 16 | "-DFLT_EVAL_METHOD=0", |
Elliott Hughes | ef3eb23 | 2020-01-10 15:06:56 -0800 | [diff] [blame] | 17 | |
| 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 Hughes | 9ba6fed | 2020-01-13 09:07:28 -0800 | [diff] [blame] | 23 | // TODO: we may want the vector code in future, but it's not ready yet. |
Elliott Hughes | ef3eb23 | 2020-01-10 15:06:56 -0800 | [diff] [blame] | 24 | "-DWANT_VMATH=0", |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 25 | ], |
Elliott Hughes | 3f88536 | 2019-10-15 09:04:39 -0700 | [diff] [blame] | 26 | local_include_dirs: ["math/include"], |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | cc_library { |
Elliott Hughes | 5438986 | 2020-01-07 13:48:01 -0800 | [diff] [blame] | 30 | name: "libarm-optimized-routines-math", |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 31 | defaults: ["arm-optimized-routines-defaults"], |
Yifan Hong | 212cd84 | 2020-01-21 18:16:50 -0800 | [diff] [blame] | 32 | ramdisk_available: true, |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 33 | recovery_available: true, |
| 34 | native_bridge_supported: true, |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 35 | srcs: [ |
Haibo Huang | cd7d536 | 2019-07-31 18:22:02 -0700 | [diff] [blame] | 36 | "math/*.c", |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 37 | ], |
Adhemerval Zanella | 8e8d1b7 | 2018-08-06 13:22:58 -0300 | [diff] [blame] | 38 | |
| 39 | // arch-specific settings |
| 40 | arch: { |
| 41 | arm64: { |
| 42 | cflags: [ |
| 43 | "-DHAVE_FAST_FMA=1", |
| 44 | ], |
| 45 | }, |
| 46 | }, |
| 47 | |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 48 | target: { |
Christopher Ferris | 8785a76 | 2018-07-27 13:59:37 -0700 | [diff] [blame] | 49 | darwin: { |
| 50 | enabled: false, |
| 51 | }, |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 52 | linux_bionic: { |
| 53 | enabled: true, |
| 54 | }, |
| 55 | }, |
| 56 | stl: "none", |
Dan Willemsen | 35edf45 | 2018-12-03 13:56:24 -0800 | [diff] [blame] | 57 | static: { |
| 58 | system_shared_libs: [], |
| 59 | }, |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 60 | } |
| 61 | |
Elliott Hughes | e9c7105 | 2018-08-01 13:26:04 -0700 | [diff] [blame] | 62 | // 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 Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 64 | cc_test { |
| 65 | name: "mathtest", |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 66 | defaults: ["arm-optimized-routines-defaults"], |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 67 | gtest: false, |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 68 | cflags: ["-Wno-missing-braces"], |
| 69 | srcs: ["math/test/mathtest.c"], |
Haibo Huang | cd7d536 | 2019-07-31 18:22:02 -0700 | [diff] [blame] | 70 | data: ["math/test/testcases/directed/*.tst"], |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 71 | target: { |
Elliott Hughes | e3966aa | 2018-07-26 08:46:15 -0700 | [diff] [blame] | 72 | darwin: { |
| 73 | enabled: false, |
| 74 | }, |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 75 | linux_bionic: { |
| 76 | enabled: true, |
| 77 | }, |
| 78 | }, |
| 79 | } |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 80 | |
| 81 | cc_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 | |
| 89 | sh_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 | } |