Skip to content

Commit d6ba187

Browse files
authored
Merge pull request #1894 from madhav-madhusoodanan/intrinsic-test-x86-addition
`intrinsic-test`: Adding x86 behavioural testing.
2 parents 7d11f2f + 41357a0 commit d6ba187

File tree

29 files changed

+2461
-161
lines changed

29 files changed

+2461
-161
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ jobs:
260260
- aarch64_be-unknown-linux-gnu
261261
- armv7-unknown-linux-gnueabihf
262262
- arm-unknown-linux-gnueabihf
263+
- x86_64-unknown-linux-gnu
263264
profile: [dev, release]
264265
include:
265266
- target: aarch64_be-unknown-linux-gnu

Cargo.lock

Lines changed: 52 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci/docker/x86_64-unknown-linux-gnu/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
66
make \
77
ca-certificates \
88
wget \
9-
xz-utils
9+
xz-utils \
10+
clang \
11+
libstdc++-14-dev \
12+
build-essential \
13+
lld
1014

1115
RUN wget http://ci-mirrors.rust-lang.org/stdarch/sde-external-9.58.0-2025-06-16-lin.tar.xz -O sde.tar.xz
1216
RUN mkdir intel-sde

ci/intrinsic-test.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,14 @@ case ${TARGET} in
6666
TEST_CXX_COMPILER="clang++"
6767
TEST_RUNNER="${CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER}"
6868
;;
69+
70+
x86_64-unknown-linux-gnu*)
71+
TEST_CPPFLAGS="-fuse-ld=lld -I/usr/include/x86_64-linux-gnu/"
72+
TEST_CXX_COMPILER="clang++"
73+
TEST_RUNNER="${CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER}"
74+
TEST_SKIP_INTRINSICS=crates/intrinsic-test/missing_x86.txt
75+
TEST_SAMPLE_INTRINSICS_PERCENTAGE=5
76+
;;
6977
*)
7078
;;
7179

@@ -94,6 +102,22 @@ case "${TARGET}" in
94102
--linker "${CARGO_TARGET_AARCH64_BE_UNKNOWN_LINUX_GNU_LINKER}" \
95103
--cxx-toolchain-dir "${AARCH64_BE_TOOLCHAIN}"
96104
;;
105+
106+
x86_64-unknown-linux-gnu*)
107+
# `CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER` is not necessary for `intrinsic-test`
108+
# because the binary needs to run directly on the host.
109+
# Hence the use of `env -u`.
110+
env -u CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER \
111+
CPPFLAGS="${TEST_CPPFLAGS}" RUSTFLAGS="${HOST_RUSTFLAGS}" \
112+
RUST_LOG=warn RUST_BACKTRACE=1 \
113+
cargo run "${INTRINSIC_TEST}" "${PROFILE}" \
114+
--bin intrinsic-test -- intrinsics_data/x86-intel.xml \
115+
--runner "${TEST_RUNNER}" \
116+
--skip "${TEST_SKIP_INTRINSICS}" \
117+
--cppcompiler "${TEST_CXX_COMPILER}" \
118+
--target "${TARGET}" \
119+
--sample-percentage "${TEST_SAMPLE_INTRINSICS_PERCENTAGE}"
120+
;;
97121
*)
98122
;;
99123
esac

crates/intrinsic-test/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ pretty_env_logger = "0.5.0"
1919
rayon = "1.5.0"
2020
diff = "0.1.12"
2121
itertools = "0.14.0"
22+
quick-xml = { version = "0.37.5", features = ["serialize", "overlapped-lists"] }
23+
serde-xml-rs = "0.8.0"
24+
regex = "1.11.1"

0 commit comments

Comments
 (0)