Bob Badour | b663c00 | 2021-02-12 15:04:25 -0800 | [diff] [blame] | 1 | package { |
| 2 | default_applicable_licenses: ["external_arm-optimized-routines_license"], |
| 3 | } |
| 4 | |
| 5 | // Added automatically by a large-scale-change |
| 6 | // See: http://go/android-license-faq |
| 7 | license { |
| 8 | name: "external_arm-optimized-routines_license", |
| 9 | visibility: [":__subpackages__"], |
| 10 | license_kinds: [ |
| 11 | "SPDX-license-identifier-MIT", |
| 12 | ], |
| 13 | license_text: [ |
| 14 | "LICENSE", |
| 15 | ], |
| 16 | } |
| 17 | |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 18 | cc_defaults { |
| 19 | name: "arm-optimized-routines-defaults", |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 20 | host_supported: true, |
| 21 | cflags: [ |
| 22 | "-Werror", |
Elliott Hughes | 7504fa9 | 2019-10-16 11:00:15 -0700 | [diff] [blame] | 23 | "-Wno-unused-parameter", |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 24 | "-O2", |
Elliott Hughes | ef3eb23 | 2020-01-10 15:06:56 -0800 | [diff] [blame] | 25 | "-ffp-contract=fast", |
| 26 | "-fno-math-errno", |
| 27 | |
| 28 | // bionic configuration. |
| 29 | |
Elliott Hughes | 055b2f3 | 2019-09-17 13:05:56 -0700 | [diff] [blame] | 30 | // We're actually implementing bionic here, so we don't want <math.h> |
| 31 | // to try to be helpful by renaming long double routines. |
| 32 | "-D__BIONIC_LP32_USE_LONG_DOUBLE", |
Adhemerval Zanella | 9e6e832 | 2018-07-26 11:43:46 -0300 | [diff] [blame] | 33 | "-DFLT_EVAL_METHOD=0", |
Elliott Hughes | ef3eb23 | 2020-01-10 15:06:56 -0800 | [diff] [blame] | 34 | |
| 35 | // arm-optimized-routines configuration. |
| 36 | |
| 37 | // BSD libm doesn't set errno, and bionic was based on the BSDs. |
| 38 | // https://github.com/ARM-software/optimized-routines/issues/16#issuecomment-572009659 |
| 39 | "-DWANT_ERRNO=0", |
Elliott Hughes | 9ba6fed | 2020-01-13 09:07:28 -0800 | [diff] [blame] | 40 | // 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] | 41 | "-DWANT_VMATH=0", |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 42 | ], |
Elliott Hughes | 3f88536 | 2019-10-15 09:04:39 -0700 | [diff] [blame] | 43 | local_include_dirs: ["math/include"], |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 44 | } |
| 45 | |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 46 | cc_defaults { |
| 47 | name: "libarm-optimized-routines-defaults", |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 48 | defaults: ["arm-optimized-routines-defaults"], |
Yifan Hong | 212cd84 | 2020-01-21 18:16:50 -0800 | [diff] [blame] | 49 | ramdisk_available: true, |
Yifan Hong | c13a69b | 2020-10-21 18:39:44 -0700 | [diff] [blame] | 50 | vendor_ramdisk_available: true, |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 51 | recovery_available: true, |
| 52 | native_bridge_supported: true, |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 53 | apex_available: [ |
| 54 | "//apex_available:platform", |
| 55 | "com.android.runtime", |
| 56 | ], |
| 57 | |
| 58 | stl: "none", |
| 59 | static: { |
| 60 | system_shared_libs: [], |
| 61 | }, |
Martin Stjernholm | cec4de0 | 2020-04-08 01:02:20 +0100 | [diff] [blame] | 62 | header_libs: ["libc_headers"], |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 63 | } |
| 64 | |
Jingwen Chen | a7c8188 | 2021-04-28 08:28:49 +0000 | [diff] [blame] | 65 | cc_library_static { |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 66 | name: "libarm-optimized-routines-math", |
| 67 | defaults: ["libarm-optimized-routines-defaults"], |
Haibo Huang | 59371d5 | 2020-11-30 18:13:41 -0800 | [diff] [blame] | 68 | exclude_srcs: [ |
| 69 | // Provided by: |
| 70 | // bionic/libm/upstream-freebsd/lib/msun/src/s_erf.c |
| 71 | // bionic/libm/upstream-freebsd/lib/msun/src/s_erff.c |
| 72 | "math/erf.c", |
| 73 | "math/erf_data.c", |
| 74 | "math/erff.c", |
| 75 | "math/erff_data.c", |
| 76 | ], |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 77 | srcs: [ |
Haibo Huang | cd7d536 | 2019-07-31 18:22:02 -0700 | [diff] [blame] | 78 | "math/*.c", |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 79 | ], |
Adhemerval Zanella | 8e8d1b7 | 2018-08-06 13:22:58 -0300 | [diff] [blame] | 80 | |
| 81 | // arch-specific settings |
| 82 | arch: { |
| 83 | arm64: { |
| 84 | cflags: [ |
| 85 | "-DHAVE_FAST_FMA=1", |
| 86 | ], |
| 87 | }, |
| 88 | }, |
| 89 | |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 90 | target: { |
Christopher Ferris | 8785a76 | 2018-07-27 13:59:37 -0700 | [diff] [blame] | 91 | darwin: { |
| 92 | enabled: false, |
| 93 | }, |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 94 | linux_bionic: { |
| 95 | enabled: true, |
| 96 | }, |
| 97 | }, |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 98 | } |
| 99 | |
Jingwen Chen | a7c8188 | 2021-04-28 08:28:49 +0000 | [diff] [blame] | 100 | cc_library_static { |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 101 | name: "libarm-optimized-routines-string", |
| 102 | defaults: ["libarm-optimized-routines-defaults"], |
| 103 | |
| 104 | arch: { |
| 105 | arm64: { |
| 106 | srcs: [ |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 107 | "string/aarch64/memchr-mte.S", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 108 | "string/aarch64/memchr.S", |
| 109 | "string/aarch64/memcmp.S", |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 110 | "string/aarch64/memrchr.S", |
| 111 | "string/aarch64/stpcpy-mte.S", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 112 | "string/aarch64/stpcpy.S", |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 113 | "string/aarch64/strchrnul-mte.S", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 114 | "string/aarch64/strchrnul.S", |
| 115 | "string/aarch64/strchr-mte.S", |
| 116 | "string/aarch64/strchr.S", |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 117 | "string/aarch64/strcmp-mte.S", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 118 | "string/aarch64/strcmp.S", |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 119 | "string/aarch64/strcpy-mte.S", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 120 | "string/aarch64/strcpy.S", |
| 121 | "string/aarch64/strlen-mte.S", |
| 122 | "string/aarch64/strlen.S", |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 123 | "string/aarch64/strncmp-mte.S", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 124 | "string/aarch64/strncmp.S", |
| 125 | "string/aarch64/strnlen.S", |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 126 | "string/aarch64/strrchr-mte.S", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 127 | "string/aarch64/strrchr.S", |
| 128 | ], |
| 129 | asflags: [ |
| 130 | "-D__memcmp_aarch64=memcmp", |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 131 | "-D__memrchr_aarch64=memrchr", |
| 132 | "-D__strnlen_aarch64=strnlen", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 133 | ] |
| 134 | }, |
Dan Willemsen | 35edf45 | 2018-12-03 13:56:24 -0800 | [diff] [blame] | 135 | }, |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 136 | } |
| 137 | |
Elliott Hughes | e9c7105 | 2018-08-01 13:26:04 -0700 | [diff] [blame] | 138 | // adb shell "/data/nativetest64/mathtest/mathtest /data/nativetest64/mathtest/test/testcases/directed/*" |
| 139 | // adb shell "/data/nativetest/mathtest/mathtest /data/nativetest/mathtest/test/testcases/directed/*" |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 140 | cc_test { |
| 141 | name: "mathtest", |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 142 | defaults: ["arm-optimized-routines-defaults"], |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 143 | gtest: false, |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 144 | cflags: ["-Wno-missing-braces"], |
| 145 | srcs: ["math/test/mathtest.c"], |
Haibo Huang | cd7d536 | 2019-07-31 18:22:02 -0700 | [diff] [blame] | 146 | data: ["math/test/testcases/directed/*.tst"], |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 147 | target: { |
Elliott Hughes | e3966aa | 2018-07-26 08:46:15 -0700 | [diff] [blame] | 148 | darwin: { |
| 149 | enabled: false, |
| 150 | }, |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 151 | linux_bionic: { |
| 152 | enabled: true, |
| 153 | }, |
| 154 | }, |
| 155 | } |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 156 | |
| 157 | cc_test { |
| 158 | name: "ulp", |
| 159 | defaults: ["arm-optimized-routines-defaults"], |
| 160 | gtest: false, |
| 161 | srcs: ["math/test/ulp.c"], |
| 162 | data: ["math/test/runulp.sh"], |
| 163 | } |
| 164 | |
| 165 | sh_test { |
| 166 | name: "arm-optimized-routines-tests", |
| 167 | src: "run-arm-optimized-routines-tests-on-android.sh", |
| 168 | filename: "run-arm-optimized-routines-tests-on-android.sh", |
| 169 | test_suites: ["general-tests"], |
| 170 | host_supported: true, |
| 171 | device_supported: false, |
frankfeng | 726e3ec | 2020-10-16 13:55:24 -0700 | [diff] [blame] | 172 | require_root: true, |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 173 | target_required: [ |
| 174 | "mathtest", |
| 175 | "ulp", |
| 176 | ], |
| 177 | } |