1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
cc_defaults {
name: "arm-optimized-routines-defaults",
host_supported: true,
cflags: [
"-Werror",
"-Wno-unused-parameter",
"-O2",
"-ffp-contract=fast",
"-fno-math-errno",
// bionic configuration.
// We're actually implementing bionic here, so we don't want <math.h>
// to try to be helpful by renaming long double routines.
"-D__BIONIC_LP32_USE_LONG_DOUBLE",
"-DFLT_EVAL_METHOD=0",
// arm-optimized-routines configuration.
// BSD libm doesn't set errno, and bionic was based on the BSDs.
// https://github.com/ARM-software/optimized-routines/issues/16#issuecomment-572009659
"-DWANT_ERRNO=0",
// TODO: we may want the vector code in future, but it's not ready yet.
"-DWANT_VMATH=0",
],
local_include_dirs: ["math/include"],
}
cc_defaults {
name: "libarm-optimized-routines-defaults",
defaults: ["arm-optimized-routines-defaults"],
ramdisk_available: true,
recovery_available: true,
native_bridge_supported: true,
apex_available: [
"//apex_available:platform",
"com.android.runtime",
],
stl: "none",
static: {
system_shared_libs: [],
},
}
cc_library {
name: "libarm-optimized-routines-math",
defaults: ["libarm-optimized-routines-defaults"],
srcs: [
"math/*.c",
],
// arch-specific settings
arch: {
arm64: {
cflags: [
"-DHAVE_FAST_FMA=1",
],
},
},
target: {
darwin: {
enabled: false,
},
linux_bionic: {
enabled: true,
},
},
}
cc_library {
name: "libarm-optimized-routines-string",
defaults: ["libarm-optimized-routines-defaults"],
arch: {
arm64: {
srcs: [
"string/aarch64/memchr.S",
"string/aarch64/memcmp.S",
"string/aarch64/stpcpy.S",
"string/aarch64/strchrnul.S",
"string/aarch64/strchr-mte.S",
"string/aarch64/strchr.S",
"string/aarch64/strcmp.S",
"string/aarch64/strcpy.S",
"string/aarch64/strlen-mte.S",
"string/aarch64/strlen.S",
"string/aarch64/strncmp.S",
"string/aarch64/strnlen.S",
"string/aarch64/strrchr.S",
],
asflags: [
"-D__memcmp_aarch64=memcmp",
]
},
},
}
// adb shell "/data/nativetest64/mathtest/mathtest /data/nativetest64/mathtest/test/testcases/directed/*"
// adb shell "/data/nativetest/mathtest/mathtest /data/nativetest/mathtest/test/testcases/directed/*"
cc_test {
name: "mathtest",
defaults: ["arm-optimized-routines-defaults"],
gtest: false,
cflags: ["-Wno-missing-braces"],
srcs: ["math/test/mathtest.c"],
data: ["math/test/testcases/directed/*.tst"],
target: {
darwin: {
enabled: false,
},
linux_bionic: {
enabled: true,
},
},
}
cc_test {
name: "ulp",
defaults: ["arm-optimized-routines-defaults"],
gtest: false,
srcs: ["math/test/ulp.c"],
data: ["math/test/runulp.sh"],
}
sh_test {
name: "arm-optimized-routines-tests",
src: "run-arm-optimized-routines-tests-on-android.sh",
filename: "run-arm-optimized-routines-tests-on-android.sh",
test_suites: ["general-tests"],
host_supported: true,
device_supported: false,
test_config: "arm-optimized-routines-tests.xml",
target_required: [
"mathtest",
"ulp",
],
}
|