Skip to content

Commit ec8c71f

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

File tree

7 files changed

+352
-43
lines changed

7 files changed

+352
-43
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

+38-10
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ vbfmlaltq_f32
1212
vbfmlaltq_lane_f32
1313
vbfmlaltq_laneq_f32
1414
vbfmmlaq_f32
15+
vsudot_laneq_s32
16+
vsudot_lane_s32
17+
vsudotq_laneq_s32
18+
vsudotq_lane_s32
19+
vusdot_laneq_s32
20+
vusdot_lane_s32
21+
vusdotq_laneq_s32
22+
vusdotq_lane_s32
23+
vusdotq_s32
24+
vusdot_s32
25+
26+
# Implemented in Clang but missing from CSV
1527
vcmla_f64
1628
vcmla_lane_f64
1729
vcmla_laneq_f64
@@ -32,16 +44,18 @@ vcmla_rot270_laneq_f64
3244
vcmla_rot90_f64
3345
vcmla_rot90_lane_f64
3446
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
47+
48+
# Implemented in Clang and stdarch but missing from CSV
49+
vmov_n_p64
50+
vmovq_n_p64
51+
vreinterpret_f32_p64
52+
vreinterpret_p64_s64
53+
vreinterpretq_f32_p128
54+
vreinterpretq_f32_p64
55+
vreinterpretq_p128_p64
56+
vreinterpretq_p64_p128
57+
vtst_p16
58+
vtstq_p16
4559

4660
# Missing from both Clang and stdarch
4761
vrnd32x_f64
@@ -80,3 +94,17 @@ vsm3tt2bq_u32
8094
vsm4ekeyq_u32
8195
vsm4eq_u32
8296
vusmmlaq_s32
97+
98+
# LLVM select error in debug builds
99+
vqshlu_n_s16
100+
vqshlu_n_s32
101+
vqshlu_n_s64
102+
vqshlu_n_s8
103+
vqshlub_n_s8
104+
vqshlud_n_s64
105+
vqshluh_n_s16
106+
vqshluq_n_s16
107+
vqshluq_n_s32
108+
vqshluq_n_s64
109+
vqshluq_n_s8
110+
vqshlus_n_s32

crates/intrinsic-test/missing_arm.txt

+247
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
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+
vsudot_lane_s32
16+
vsudotq_lane_s32
17+
vusdot_lane_s32
18+
vusdotq_lane_s32
19+
vusdotq_s32
20+
vusdot_s32
21+
22+
# Implemented in Clang and stdarch but missing from CSV
23+
vtst_p16
24+
vtstq_p16
25+
26+
# QEMU 6.0 doesn't support these instructions
27+
vmmlaq_s32
28+
vmmlaq_u32
29+
vusmmlaq_s32
30+
31+
# Implemented in Clang and stdarch for A64 only even though CSV claims A32 support
32+
__crc32d
33+
__crc32cd
34+
vaddq_p64
35+
vbsl_p64
36+
vbslq_p64
37+
vceq_p64
38+
vceqq_p64
39+
vceqz_p64
40+
vceqzq_p64
41+
vcombine_p64
42+
vcopy_lane_p64
43+
vcopy_laneq_p64
44+
vcopyq_lane_p64
45+
vcopyq_laneq_p64
46+
vcreate_p64
47+
vdup_lane_p64
48+
vdup_n_p64
49+
vdupq_lane_p64
50+
vdupq_n_p64
51+
vext_p64
52+
vextq_p64
53+
vget_high_p64
54+
vget_lane_p64
55+
vget_low_p64
56+
vgetq_lane_p64
57+
vmovn_high_s16
58+
vmovn_high_s32
59+
vmovn_high_s64
60+
vmovn_high_u16
61+
vmovn_high_u32
62+
vmovn_high_u64
63+
vmull_high_p64
64+
vmull_p64
65+
vreinterpret_p16_p64
66+
vreinterpret_p64_f32
67+
vreinterpret_p64_p16
68+
vreinterpret_p64_p8
69+
vreinterpret_p64_s16
70+
vreinterpret_p64_s32
71+
vreinterpret_p64_s8
72+
vreinterpret_p64_u16
73+
vreinterpret_p64_u32
74+
vreinterpret_p64_u64
75+
vreinterpret_p64_u8
76+
vreinterpret_p8_p64
77+
vreinterpretq_f64_u64
78+
vreinterpretq_p128_f32
79+
vreinterpretq_p128_p16
80+
vreinterpretq_p128_p8
81+
vreinterpretq_p128_s16
82+
vreinterpretq_p128_s32
83+
vreinterpretq_p128_s64
84+
vreinterpretq_p128_s8
85+
vreinterpretq_p128_u16
86+
vreinterpretq_p128_u32
87+
vreinterpretq_p128_u64
88+
vreinterpretq_p128_u8
89+
vreinterpretq_p16_p64
90+
vreinterpretq_p64_f32
91+
vreinterpretq_p64_p16
92+
vreinterpretq_p64_p8
93+
vreinterpretq_p64_s16
94+
vreinterpretq_p64_s32
95+
vreinterpretq_p64_s64
96+
vreinterpretq_p64_s8
97+
vreinterpretq_p64_u16
98+
vreinterpretq_p64_u32
99+
vreinterpretq_p64_u64
100+
vreinterpretq_p64_u8
101+
vreinterpretq_p8_p64
102+
vreinterpretq_s16_p64
103+
vreinterpretq_s32_p64
104+
vreinterpretq_s64_p64
105+
vreinterpretq_s8_p64
106+
vreinterpretq_u16_p64
107+
vreinterpretq_u32_p64
108+
vreinterpretq_u64_p64
109+
vreinterpretq_u8_p64
110+
vreinterpret_s16_p64
111+
vreinterpret_s32_p64
112+
vreinterpret_s64_p64
113+
vreinterpret_s8_p64
114+
vreinterpret_u16_p64
115+
vreinterpret_u32_p64
116+
vreinterpret_u64_p64
117+
vreinterpret_u8_p64
118+
vrndn_f64
119+
vrndnq_f64
120+
vset_lane_p64
121+
vsetq_lane_p64
122+
vsli_n_p64
123+
vsliq_n_p64
124+
vsri_n_p64
125+
vsriq_n_p64
126+
vtst_p64
127+
vtstq_p64
128+
129+
# Present in Clang header but triggers an ICE due to lack of backend support.
130+
vcmla_f32
131+
vcmla_lane_f32
132+
vcmla_laneq_f32
133+
vcmla_rot180_f32
134+
vcmla_rot180_lane_f32
135+
vcmla_rot180_laneq_f32
136+
vcmla_rot270_f32
137+
vcmla_rot270_lane_f32
138+
vcmla_rot270_laneq_f32
139+
vcmla_rot90_f32
140+
vcmla_rot90_lane_f32
141+
vcmla_rot90_laneq_f32
142+
vcmlaq_f32
143+
vcmlaq_lane_f32
144+
vcmlaq_laneq_f32
145+
vcmlaq_rot180_f32
146+
vcmlaq_rot180_lane_f32
147+
vcmlaq_rot180_laneq_f32
148+
vcmlaq_rot270_f32
149+
vcmlaq_rot270_lane_f32
150+
vcmlaq_rot270_laneq_f32
151+
vcmlaq_rot90_f32
152+
vcmlaq_rot90_lane_f32
153+
vcmlaq_rot90_laneq_f32
154+
155+
# Implemented in stdarch for A64 only, Clang support both A32/A64
156+
vadd_s64
157+
vadd_u64
158+
vcaddq_rot270_f32
159+
vcaddq_rot90_f32
160+
vcadd_rot270_f32
161+
vcadd_rot90_f32
162+
vcombine_f32
163+
vcombine_p16
164+
vcombine_p8
165+
vcombine_s16
166+
vcombine_s32
167+
vcombine_s64
168+
vcombine_s8
169+
vcombine_u16
170+
vcombine_u32
171+
vcombine_u64
172+
vcombine_u8
173+
vcvtaq_s32_f32
174+
vcvtaq_u32_f32
175+
vcvta_s32_f32
176+
vcvta_u32_f32
177+
vcvtmq_s32_f32
178+
vcvtmq_u32_f32
179+
vcvtm_s32_f32
180+
vcvtm_u32_f32
181+
vcvtnq_s32_f32
182+
vcvtnq_u32_f32
183+
vcvtn_s32_f32
184+
vcvtn_u32_f32
185+
vcvtpq_s32_f32
186+
vcvtpq_u32_f32
187+
vcvtp_s32_f32
188+
vcvtp_u32_f32
189+
vdot_lane_s32
190+
vdot_lane_u32
191+
vdotq_lane_s32
192+
vdotq_lane_u32
193+
vdotq_s32
194+
vdotq_u32
195+
vdot_s32
196+
vdot_u32
197+
vqdmulh_lane_s16
198+
vqdmulh_lane_s32
199+
vqdmulhq_lane_s16
200+
vqdmulhq_lane_s32
201+
vrnda_f32
202+
vrnda_f32
203+
vrndaq_f32
204+
vrndaq_f32
205+
vrnd_f32
206+
vrnd_f32
207+
vrndi_f32
208+
vrndi_f32
209+
vrndiq_f32
210+
vrndiq_f32
211+
vrndm_f32
212+
vrndm_f32
213+
vrndmq_f32
214+
vrndmq_f32
215+
vrndns_f32
216+
vrndp_f32
217+
vrndpq_f32
218+
vrndq_f32
219+
vrndq_f32
220+
vrndx_f32
221+
vrndxq_f32
222+
223+
# LLVM select error in debug builds
224+
vqrshrn_n_s16
225+
vqrshrn_n_s32
226+
vqrshrn_n_s64
227+
vqrshrn_n_u16
228+
vqrshrn_n_u32
229+
vqrshrn_n_u64
230+
vqrshrun_n_s16
231+
vqrshrun_n_s32
232+
vqrshrun_n_s64
233+
vqshrn_n_s16
234+
vqshrn_n_s32
235+
vqshrn_n_s64
236+
vqshrn_n_u16
237+
vqshrn_n_u32
238+
vqshrn_n_u64
239+
vqshrun_n_s16
240+
vqshrun_n_s32
241+
vqshrun_n_s64
242+
vrshrn_n_s16
243+
vrshrn_n_s32
244+
vrshrn_n_s64
245+
vrshrn_n_u16
246+
vrshrn_n_u32
247+
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)