Skip to content

Commit f845467

Browse files
committed
Add A32 support to intrinsic-test and updated missing intrinsics list
1 parent 8695dd5 commit f845467

File tree

7 files changed

+383
-33
lines changed

7 files changed

+383
-33
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
FROM ubuntu:18.04
1+
FROM ubuntu:21.10
22
RUN apt-get update && apt-get install -y --no-install-recommends \
33
gcc \
4+
g++ \
45
ca-certificates \
56
libc6-dev \
67
gcc-arm-linux-gnueabihf \
8+
g++-arm-linux-gnueabihf \
79
libc6-dev-armhf-cross \
810
qemu-user \
911
make \
10-
file
12+
file \
13+
clang-13 \
14+
lld
1115
ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc \
1216
CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER="qemu-arm -L /usr/arm-linux-gnueabihf" \
1317
OBJDUMP=arm-linux-gnueabihf-objdump

ci/run.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ case ${TARGET} in
3737
mips-* | mipsel-*)
3838
export RUSTFLAGS="${RUSTFLAGS} -C llvm-args=-fast-isel=false"
3939
;;
40+
# Some of our test dependencies use the deprecated `gcc` crates which is
41+
# missing a fix from https://github.com/alexcrichton/cc-rs/pull/627. Apply
42+
# the workaround manually here.
43+
armv7-*eabihf | thumbv7-*eabihf)
44+
export TARGET_CFLAGS="-mfpu=vfpv3-d16"
45+
;;
4046
esac
4147

4248
echo "RUSTFLAGS=${RUSTFLAGS}"
@@ -122,7 +128,10 @@ esac
122128

123129
if [ "${TARGET}" = "aarch64-unknown-linux-gnu" ]; then
124130
export CPPFLAGS="-fuse-ld=lld -I/usr/aarch64-linux-gnu/include/ -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu/"
125-
cargo run ${INTRINSIC_TEST} --release --bin intrinsic-test -- crates/intrinsic-test/acle/tools/intrinsic_db/advsimd.csv --runner "${CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER}" --cppcompiler "clang++-13" --skip crates/intrinsic-test/missing.txt
131+
RUST_LOG=warn cargo run ${INTRINSIC_TEST} --release --bin intrinsic-test -- crates/intrinsic-test/acle/tools/intrinsic_db/advsimd.csv --runner "${CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER}" --cppcompiler "clang++-13" --skip crates/intrinsic-test/missing_aarch64.txt
132+
elif [ "${TARGET}" = "armv7-unknown-linux-gnueabihf" ]; then
133+
export CPPFLAGS="-fuse-ld=lld -I/usr/arm-linux-gnueabihf/include/ -I/usr/arm-linux-gnueabihf/include/c++/9/arm-linux-gnueabihf/"
134+
RUST_LOG=warn cargo run ${INTRINSIC_TEST} --release --bin intrinsic-test -- crates/intrinsic-test/acle/tools/intrinsic_db/advsimd.csv --runner "${CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER}" --cppcompiler "clang++-13" --skip crates/intrinsic-test/missing_arm.txt --a32
126135
fi
127136

128137
if [ "$NORUN" != "1" ] && [ "$NOSTD" != 1 ]; then

crates/intrinsic-test/missing.txt renamed to crates/intrinsic-test/missing_aarch64.txt

+14
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,17 @@ vsm3tt2bq_u32
8080
vsm4ekeyq_u32
8181
vsm4eq_u32
8282
vusmmlaq_s32
83+
84+
# LLVM select error in debug builds
85+
vqshlu_n_s16
86+
vqshlu_n_s32
87+
vqshlu_n_s64
88+
vqshlu_n_s8
89+
vqshlub_n_s8
90+
vqshlud_n_s64
91+
vqshluh_n_s16
92+
vqshluq_n_s16
93+
vqshluq_n_s32
94+
vqshluq_n_s64
95+
vqshluq_n_s8
96+
vqshlus_n_s32

crates/intrinsic-test/missing_arm.txt

+302
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,302 @@
1+
# Not implemented in stdarch yet
2+
vbfdot_f32
3+
vbfdot_lane_f32
4+
vbfdot_laneq_f32
5+
vbfdotq_f32
6+
vbfdotq_lane_f32
7+
vbfdotq_laneq_f32
8+
vbfmlalbq_f32
9+
vbfmlalbq_lane_f32
10+
vbfmlalbq_laneq_f32
11+
vbfmlaltq_f32
12+
vbfmlaltq_lane_f32
13+
vbfmlaltq_laneq_f32
14+
vbfmmlaq_f32
15+
vcmla_f64
16+
vcmla_lane_f64
17+
vcmla_laneq_f64
18+
vcmlaq_lane_f64
19+
vcmlaq_laneq_f64
20+
vcmlaq_rot180_lane_f64
21+
vcmlaq_rot180_laneq_f64
22+
vcmlaq_rot270_lane_f64
23+
vcmlaq_rot270_laneq_f64
24+
vcmlaq_rot90_lane_f64
25+
vcmlaq_rot90_laneq_f64
26+
vcmla_rot180_f64
27+
vcmla_rot180_lane_f64
28+
vcmla_rot180_laneq_f64
29+
vcmla_rot270_f64
30+
vcmla_rot270_lane_f64
31+
vcmla_rot270_laneq_f64
32+
vcmla_rot90_f64
33+
vcmla_rot90_lane_f64
34+
vcmla_rot90_laneq_f64
35+
vsudot_laneq_s32
36+
vsudot_lane_s32
37+
vsudotq_laneq_s32
38+
vsudotq_lane_s32
39+
vusdot_laneq_s32
40+
vusdot_lane_s32
41+
vusdotq_laneq_s32
42+
vusdotq_lane_s32
43+
vusdotq_s32
44+
vusdot_s32
45+
46+
# Missing from both Clang and stdarch
47+
vrnd32x_f64
48+
vrnd32xq_f64
49+
vrnd32z_f64
50+
vrnd32zq_f64
51+
vrnd64x_f64
52+
vrnd64xq_f64
53+
vrnd64z_f64
54+
vrnd64zq_f64
55+
56+
# Takes too long to compile tests
57+
vcopyq_laneq_u8
58+
vcopyq_laneq_s8
59+
vcopyq_laneq_p8
60+
vcopyq_lane_u8
61+
vcopyq_lane_s8
62+
vcopyq_lane_p8
63+
vcopy_laneq_u8
64+
vcopy_laneq_s8
65+
vcopy_laneq_p8
66+
vcopy_lane_u8
67+
vcopy_lane_s8
68+
vcopy_lane_p8
69+
70+
# QEMU 6.0 doesn't support these instructions
71+
vmmlaq_s32
72+
vmmlaq_u32
73+
vsm3partw1q_u32
74+
vsm3partw2q_u32
75+
vsm3ss1q_u32
76+
vsm3tt1aq_u32
77+
vsm3tt1bq_u32
78+
vsm3tt2aq_u32
79+
vsm3tt2bq_u32
80+
vsm4ekeyq_u32
81+
vsm4eq_u32
82+
vusmmlaq_s32
83+
84+
# Incorrectly marked as supported on A32 in CSV
85+
vrndn_f64
86+
vrndnq_f64
87+
vreinterpretq_f64_u64
88+
__crc32d
89+
__crc32cd
90+
91+
# Appears in the Clang header but not implemented in the LLVM ARM backend
92+
vcmla_f32
93+
vcmla_lane_f32
94+
vcmla_laneq_f32
95+
vcmla_rot180_f32
96+
vcmla_rot180_lane_f32
97+
vcmla_rot180_laneq_f32
98+
vcmla_rot270_f32
99+
vcmla_rot270_lane_f32
100+
vcmla_rot270_laneq_f32
101+
vcmla_rot90_f32
102+
vcmla_rot90_lane_f32
103+
vcmla_rot90_laneq_f32
104+
vcmlaq_f32
105+
vcmlaq_lane_f32
106+
vcmlaq_laneq_f32
107+
vcmlaq_rot180_f32
108+
vcmlaq_rot180_lane_f32
109+
vcmlaq_rot180_laneq_f32
110+
vcmlaq_rot270_f32
111+
vcmlaq_rot270_lane_f32
112+
vcmlaq_rot270_laneq_f32
113+
vcmlaq_rot90_f32
114+
vcmlaq_rot90_lane_f32
115+
vcmlaq_rot90_laneq_f32
116+
117+
# CSV claims that it is supported on A32 but Clang has them as A64-only
118+
vaddq_p64
119+
vbsl_p64
120+
vbslq_p64
121+
vceq_p64
122+
vceqq_p64
123+
vceqz_p64
124+
vceqzq_p64
125+
vcombine_p64
126+
vcopy_lane_p64
127+
vcopy_laneq_p64
128+
vcopyq_lane_p64
129+
vcopyq_laneq_p64
130+
vcreate_p64
131+
vdup_lane_p64
132+
vdup_n_p64
133+
vdupq_lane_p64
134+
vdupq_n_p64
135+
vext_p64
136+
vextq_p64
137+
vget_high_p64
138+
vget_lane_p64
139+
vget_low_p64
140+
vgetq_lane_p64
141+
vmovn_high_s16
142+
vmovn_high_s32
143+
vmovn_high_s64
144+
vmovn_high_u16
145+
vmovn_high_u32
146+
vmovn_high_u64
147+
vmull_high_p64
148+
vmull_p64
149+
vreinterpret_p16_p64
150+
vreinterpret_p64_f32
151+
vreinterpret_p64_p16
152+
vreinterpret_p64_p8
153+
vreinterpret_p64_s16
154+
vreinterpret_p64_s32
155+
vreinterpret_p64_s8
156+
vreinterpret_p64_u16
157+
vreinterpret_p64_u32
158+
vreinterpret_p64_u64
159+
vreinterpret_p64_u8
160+
vreinterpret_p8_p64
161+
vreinterpretq_p128_f32
162+
vreinterpretq_p128_p16
163+
vreinterpretq_p128_p8
164+
vreinterpretq_p128_s16
165+
vreinterpretq_p128_s32
166+
vreinterpretq_p128_s64
167+
vreinterpretq_p128_s8
168+
vreinterpretq_p128_u16
169+
vreinterpretq_p128_u32
170+
vreinterpretq_p128_u64
171+
vreinterpretq_p128_u8
172+
vreinterpretq_p16_p64
173+
vreinterpretq_p64_f32
174+
vreinterpretq_p64_p16
175+
vreinterpretq_p64_p8
176+
vreinterpretq_p64_s16
177+
vreinterpretq_p64_s32
178+
vreinterpretq_p64_s64
179+
vreinterpretq_p64_s8
180+
vreinterpretq_p64_u16
181+
vreinterpretq_p64_u32
182+
vreinterpretq_p64_u64
183+
vreinterpretq_p64_u8
184+
vreinterpretq_p8_p64
185+
vreinterpretq_s16_p64
186+
vreinterpretq_s32_p64
187+
vreinterpretq_s64_p64
188+
vreinterpretq_s8_p64
189+
vreinterpretq_u16_p64
190+
vreinterpretq_u32_p64
191+
vreinterpretq_u64_p64
192+
vreinterpretq_u8_p64
193+
vreinterpret_s16_p64
194+
vreinterpret_s32_p64
195+
vreinterpret_s64_p64
196+
vreinterpret_s8_p64
197+
vreinterpret_u16_p64
198+
vreinterpret_u32_p64
199+
vreinterpret_u64_p64
200+
vreinterpret_u8_p64
201+
vset_lane_p64
202+
vsetq_lane_p64
203+
vsli_n_p64
204+
vsliq_n_p64
205+
vsri_n_p64
206+
vsriq_n_p64
207+
vtst_p64
208+
vtstq_p64
209+
210+
# Implemented in stdarch for AArch64 but missing on ARM
211+
vadd_s64
212+
vadd_u64
213+
vcaddq_rot270_f32
214+
vcaddq_rot90_f32
215+
vcadd_rot270_f32
216+
vcadd_rot90_f32
217+
vcombine_f32
218+
vcombine_p16
219+
vcombine_p8
220+
vcombine_s16
221+
vcombine_s32
222+
vcombine_s64
223+
vcombine_s8
224+
vcombine_u16
225+
vcombine_u32
226+
vcombine_u64
227+
vcombine_u8
228+
vcvtaq_s32_f32
229+
vcvtaq_u32_f32
230+
vcvta_s32_f32
231+
vcvta_u32_f32
232+
vcvtmq_s32_f32
233+
vcvtmq_u32_f32
234+
vcvtm_s32_f32
235+
vcvtm_u32_f32
236+
vcvtnq_s32_f32
237+
vcvtnq_u32_f32
238+
vcvtn_s32_f32
239+
vcvtn_u32_f32
240+
vcvtpq_s32_f32
241+
vcvtpq_u32_f32
242+
vcvtp_s32_f32
243+
vcvtp_u32_f32
244+
vdot_lane_s32
245+
vdot_lane_u32
246+
vdotq_lane_s32
247+
vdotq_lane_u32
248+
vdotq_s32
249+
vdotq_u32
250+
vdot_s32
251+
vdot_u32
252+
vqdmulh_lane_s16
253+
vqdmulh_lane_s32
254+
vqdmulhq_lane_s16
255+
vqdmulhq_lane_s32
256+
vrnda_f32
257+
vrnda_f32
258+
vrndaq_f32
259+
vrndaq_f32
260+
vrnd_f32
261+
vrnd_f32
262+
vrndi_f32
263+
vrndi_f32
264+
vrndiq_f32
265+
vrndiq_f32
266+
vrndm_f32
267+
vrndm_f32
268+
vrndmq_f32
269+
vrndmq_f32
270+
vrndns_f32
271+
vrndp_f32
272+
vrndpq_f32
273+
vrndq_f32
274+
vrndq_f32
275+
vrndx_f32
276+
vrndxq_f32
277+
278+
# LLVM select error in debug builds
279+
vqrshrn_n_s16
280+
vqrshrn_n_s32
281+
vqrshrn_n_s64
282+
vqrshrn_n_u16
283+
vqrshrn_n_u32
284+
vqrshrn_n_u64
285+
vqrshrun_n_s16
286+
vqrshrun_n_s32
287+
vqrshrun_n_s64
288+
vqshrn_n_s16
289+
vqshrn_n_s32
290+
vqshrn_n_s64
291+
vqshrn_n_u16
292+
vqshrn_n_u32
293+
vqshrn_n_u64
294+
vqshrun_n_s16
295+
vqshrun_n_s32
296+
vqshrun_n_s64
297+
vrshrn_n_s16
298+
vrshrn_n_s32
299+
vrshrn_n_s64
300+
vrshrn_n_u16
301+
vrshrn_n_u32
302+
vrshrn_n_u64

crates/intrinsic-test/src/acle_csv_parser.rs

+6
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,17 @@ impl Into<Intrinsic> for ACLEIntrinsicLine {
8282
})
8383
.collect();
8484
let arguments = ArgumentList { args };
85+
let a64_only = match &*self.supported_architectures {
86+
"A64" => true,
87+
"v7/A32/A64" | "A32/A64" => false,
88+
_ => panic!("Invalid supported architectures"),
89+
};
8590

8691
Intrinsic {
8792
name: name.to_string(),
8893
arguments,
8994
results,
95+
a64_only,
9096
}
9197
}
9298
}

crates/intrinsic-test/src/intrinsic.rs

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ pub struct Intrinsic {
1313

1414
/// The return type of this intrinsic.
1515
pub results: IntrinsicType,
16+
17+
/// Whether this intrinsic is only available on A64.
18+
pub a64_only: bool,
1619
}
1720

1821
impl Intrinsic {

0 commit comments

Comments
 (0)