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 | 055b2f3 | 2019-09-17 13:05:56 -0700 | [diff] [blame] | 8 | // We're actually implementing bionic here, so we don't want <math.h> |
| 9 | // to try to be helpful by renaming long double routines. |
| 10 | "-D__BIONIC_LP32_USE_LONG_DOUBLE", |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 11 | "-DWANT_ROUNDING=0", |
| 12 | "-DWANT_ERRNO=0", |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 13 | "-DWANT_VMATH=0", |
Adhemerval Zanella | 9e6e832 | 2018-07-26 11:43:46 -0300 | [diff] [blame] | 14 | "-DFLT_EVAL_METHOD=0", |
| 15 | "-ffp-contract=fast", |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 16 | "-fno-math-errno", |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 17 | ], |
Elliott Hughes | 3f88536 | 2019-10-15 09:04:39 -0700 | [diff] [blame] | 18 | local_include_dirs: ["math/include"], |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 19 | } |
| 20 | |
| 21 | cc_library { |
Elliott Hughes | 5438986 | 2020-01-07 13:48:01 -0800 | [diff] [blame^] | 22 | name: "libarm-optimized-routines-math", |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 23 | defaults: ["arm-optimized-routines-defaults"], |
| 24 | recovery_available: true, |
| 25 | native_bridge_supported: true, |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 26 | srcs: [ |
Haibo Huang | cd7d536 | 2019-07-31 18:22:02 -0700 | [diff] [blame] | 27 | "math/*.c", |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 28 | ], |
Adhemerval Zanella | 8e8d1b7 | 2018-08-06 13:22:58 -0300 | [diff] [blame] | 29 | |
| 30 | // arch-specific settings |
| 31 | arch: { |
| 32 | arm64: { |
| 33 | cflags: [ |
| 34 | "-DHAVE_FAST_FMA=1", |
| 35 | ], |
| 36 | }, |
| 37 | }, |
| 38 | |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 39 | target: { |
Christopher Ferris | 8785a76 | 2018-07-27 13:59:37 -0700 | [diff] [blame] | 40 | darwin: { |
| 41 | enabled: false, |
| 42 | }, |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 43 | linux_bionic: { |
| 44 | enabled: true, |
| 45 | }, |
| 46 | }, |
| 47 | stl: "none", |
Dan Willemsen | 35edf45 | 2018-12-03 13:56:24 -0800 | [diff] [blame] | 48 | static: { |
| 49 | system_shared_libs: [], |
| 50 | }, |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 51 | } |
| 52 | |
Elliott Hughes | e9c7105 | 2018-08-01 13:26:04 -0700 | [diff] [blame] | 53 | // adb shell "/data/nativetest64/mathtest/mathtest /data/nativetest64/mathtest/test/testcases/directed/*" |
| 54 | // adb shell "/data/nativetest/mathtest/mathtest /data/nativetest/mathtest/test/testcases/directed/*" |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 55 | cc_test { |
| 56 | name: "mathtest", |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 57 | defaults: ["arm-optimized-routines-defaults"], |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 58 | gtest: false, |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 59 | cflags: ["-Wno-missing-braces"], |
| 60 | srcs: ["math/test/mathtest.c"], |
Haibo Huang | cd7d536 | 2019-07-31 18:22:02 -0700 | [diff] [blame] | 61 | data: ["math/test/testcases/directed/*.tst"], |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 62 | target: { |
Elliott Hughes | e3966aa | 2018-07-26 08:46:15 -0700 | [diff] [blame] | 63 | darwin: { |
| 64 | enabled: false, |
| 65 | }, |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 66 | linux_bionic: { |
| 67 | enabled: true, |
| 68 | }, |
| 69 | }, |
| 70 | } |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 71 | |
| 72 | cc_test { |
| 73 | name: "ulp", |
| 74 | defaults: ["arm-optimized-routines-defaults"], |
| 75 | gtest: false, |
| 76 | srcs: ["math/test/ulp.c"], |
| 77 | data: ["math/test/runulp.sh"], |
| 78 | } |
| 79 | |
| 80 | sh_test { |
| 81 | name: "arm-optimized-routines-tests", |
| 82 | src: "run-arm-optimized-routines-tests-on-android.sh", |
| 83 | filename: "run-arm-optimized-routines-tests-on-android.sh", |
| 84 | test_suites: ["general-tests"], |
| 85 | host_supported: true, |
| 86 | device_supported: false, |
| 87 | test_config: "arm-optimized-routines-tests.xml", |
| 88 | target_required: [ |
| 89 | "mathtest", |
| 90 | "ulp", |
| 91 | ], |
| 92 | } |