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", |
Colin Cross | 74985fc | 2022-02-02 13:38:12 -0800 | [diff] [blame] | 59 | target: { |
| 60 | bionic: { |
| 61 | static: { |
| 62 | system_shared_libs: [], |
| 63 | }, |
| 64 | header_libs: ["libc_headers"], |
| 65 | }, |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 66 | }, |
| 67 | } |
| 68 | |
Jingwen Chen | a7c8188 | 2021-04-28 08:28:49 +0000 | [diff] [blame] | 69 | cc_library_static { |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 70 | name: "libarm-optimized-routines-math", |
| 71 | defaults: ["libarm-optimized-routines-defaults"], |
Haibo Huang | 59371d5 | 2020-11-30 18:13:41 -0800 | [diff] [blame] | 72 | exclude_srcs: [ |
| 73 | // Provided by: |
| 74 | // bionic/libm/upstream-freebsd/lib/msun/src/s_erf.c |
| 75 | // bionic/libm/upstream-freebsd/lib/msun/src/s_erff.c |
| 76 | "math/erf.c", |
| 77 | "math/erf_data.c", |
| 78 | "math/erff.c", |
| 79 | "math/erff_data.c", |
| 80 | ], |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 81 | srcs: [ |
Haibo Huang | cd7d536 | 2019-07-31 18:22:02 -0700 | [diff] [blame] | 82 | "math/*.c", |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 83 | ], |
Adhemerval Zanella | 8e8d1b7 | 2018-08-06 13:22:58 -0300 | [diff] [blame] | 84 | |
| 85 | // arch-specific settings |
| 86 | arch: { |
| 87 | arm64: { |
| 88 | cflags: [ |
| 89 | "-DHAVE_FAST_FMA=1", |
| 90 | ], |
| 91 | }, |
| 92 | }, |
| 93 | |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 94 | target: { |
Christopher Ferris | 8785a76 | 2018-07-27 13:59:37 -0700 | [diff] [blame] | 95 | darwin: { |
| 96 | enabled: false, |
| 97 | }, |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 98 | linux_bionic: { |
| 99 | enabled: true, |
| 100 | }, |
| 101 | }, |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 102 | } |
| 103 | |
Jingwen Chen | a7c8188 | 2021-04-28 08:28:49 +0000 | [diff] [blame] | 104 | cc_library_static { |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 105 | name: "libarm-optimized-routines-string", |
| 106 | defaults: ["libarm-optimized-routines-defaults"], |
| 107 | |
| 108 | arch: { |
| 109 | arm64: { |
| 110 | srcs: [ |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 111 | "string/aarch64/memchr-mte.S", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 112 | "string/aarch64/memchr.S", |
| 113 | "string/aarch64/memcmp.S", |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 114 | "string/aarch64/memrchr.S", |
| 115 | "string/aarch64/stpcpy-mte.S", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 116 | "string/aarch64/stpcpy.S", |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 117 | "string/aarch64/strchrnul-mte.S", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 118 | "string/aarch64/strchrnul.S", |
| 119 | "string/aarch64/strchr-mte.S", |
| 120 | "string/aarch64/strchr.S", |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 121 | "string/aarch64/strcmp-mte.S", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 122 | "string/aarch64/strcmp.S", |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 123 | "string/aarch64/strcpy-mte.S", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 124 | "string/aarch64/strcpy.S", |
| 125 | "string/aarch64/strlen-mte.S", |
| 126 | "string/aarch64/strlen.S", |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 127 | "string/aarch64/strncmp-mte.S", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 128 | "string/aarch64/strncmp.S", |
| 129 | "string/aarch64/strnlen.S", |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 130 | "string/aarch64/strrchr-mte.S", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 131 | "string/aarch64/strrchr.S", |
| 132 | ], |
| 133 | asflags: [ |
| 134 | "-D__memcmp_aarch64=memcmp", |
Peter Collingbourne | 5bde7af | 2020-06-03 16:56:02 -0700 | [diff] [blame] | 135 | "-D__memrchr_aarch64=memrchr", |
| 136 | "-D__strnlen_aarch64=strnlen", |
Peter Collingbourne | a1546db | 2020-02-21 12:19:26 -0800 | [diff] [blame] | 137 | ] |
| 138 | }, |
Dan Willemsen | 35edf45 | 2018-12-03 13:56:24 -0800 | [diff] [blame] | 139 | }, |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 140 | } |
| 141 | |
Elliott Hughes | e9c7105 | 2018-08-01 13:26:04 -0700 | [diff] [blame] | 142 | // adb shell "/data/nativetest64/mathtest/mathtest /data/nativetest64/mathtest/test/testcases/directed/*" |
| 143 | // adb shell "/data/nativetest/mathtest/mathtest /data/nativetest/mathtest/test/testcases/directed/*" |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 144 | cc_test { |
| 145 | name: "mathtest", |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 146 | defaults: ["arm-optimized-routines-defaults"], |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 147 | gtest: false, |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 148 | cflags: ["-Wno-missing-braces"], |
| 149 | srcs: ["math/test/mathtest.c"], |
Haibo Huang | cd7d536 | 2019-07-31 18:22:02 -0700 | [diff] [blame] | 150 | data: ["math/test/testcases/directed/*.tst"], |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 151 | target: { |
Elliott Hughes | e3966aa | 2018-07-26 08:46:15 -0700 | [diff] [blame] | 152 | darwin: { |
| 153 | enabled: false, |
| 154 | }, |
Elliott Hughes | c2e0183 | 2018-07-20 13:55:44 -0700 | [diff] [blame] | 155 | linux_bionic: { |
| 156 | enabled: true, |
| 157 | }, |
| 158 | }, |
| 159 | } |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 160 | |
| 161 | cc_test { |
| 162 | name: "ulp", |
| 163 | defaults: ["arm-optimized-routines-defaults"], |
| 164 | gtest: false, |
| 165 | srcs: ["math/test/ulp.c"], |
| 166 | data: ["math/test/runulp.sh"], |
| 167 | } |
| 168 | |
| 169 | sh_test { |
| 170 | name: "arm-optimized-routines-tests", |
| 171 | src: "run-arm-optimized-routines-tests-on-android.sh", |
| 172 | filename: "run-arm-optimized-routines-tests-on-android.sh", |
| 173 | test_suites: ["general-tests"], |
| 174 | host_supported: true, |
| 175 | device_supported: false, |
frankfeng | 726e3ec | 2020-10-16 13:55:24 -0700 | [diff] [blame] | 176 | require_root: true, |
Elliott Hughes | 3eae8e0 | 2019-12-18 14:17:17 -0800 | [diff] [blame] | 177 | target_required: [ |
| 178 | "mathtest", |
| 179 | "ulp", |
| 180 | ], |
| 181 | } |