Skip to content

Commit 2796343

Browse files
committed
Auto merge of #148425 - matthiaskrgr:rollup-pwibmxt, r=matthiaskrgr
Rollup of 3 pull requests Successful merges: - rust-lang/rust#146260 (add SliceIndex wrapper types Last and Clamp<Idx>) - rust-lang/rust#148394 (Make explicit that `TypeId`'s layout and size are unstable) - rust-lang/rust#148402 (stdarch subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2 parents e8bb3ca + f415fd5 commit 2796343

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+14158
-2026
lines changed

.github/workflows/main.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,43 @@ jobs:
249249
env:
250250
TARGET: ${{ matrix.target.tuple }}
251251

252+
intrinsic-test:
253+
needs: [style]
254+
name: Intrinsic Test
255+
runs-on: ubuntu-latest
256+
strategy:
257+
matrix:
258+
target:
259+
- aarch64-unknown-linux-gnu
260+
- aarch64_be-unknown-linux-gnu
261+
- armv7-unknown-linux-gnueabihf
262+
- arm-unknown-linux-gnueabihf
263+
- x86_64-unknown-linux-gnu
264+
profile: [dev, release]
265+
include:
266+
- target: aarch64_be-unknown-linux-gnu
267+
build_std: true
268+
269+
steps:
270+
- uses: actions/checkout@v4
271+
- name: Install Rust
272+
run: |
273+
rustup update nightly --no-self-update
274+
rustup default nightly
275+
- run: rustup target add ${{ matrix.target }}
276+
if: ${{ (matrix.build_std || false) == false }}
277+
- run: |
278+
rustup component add rust-src
279+
echo "CARGO_UNSTABLE_BUILD_STD=std" >> $GITHUB_ENV
280+
if: ${{ matrix.build_std }}
281+
282+
# Configure some env vars based on matrix configuration
283+
- run: echo "PROFILE=--profile=${{ matrix.profile }}" >> $GITHUB_ENV
284+
- run: ./ci/intrinsic-test-docker.sh ${{ matrix.target }}
285+
if: ${{ !startsWith(matrix.target, 'thumb') }}
286+
env:
287+
TARGET: ${{ matrix.target }}
288+
252289
# Check that the generated files agree with the checked-in versions.
253290
check-stdarch-gen:
254291
needs: [style]
@@ -276,6 +313,7 @@ jobs:
276313
- docs
277314
- verify
278315
- test
316+
- intrinsic-test
279317
- check-stdarch-gen
280318
runs-on: ubuntu-latest
281319
# We need to ensure this job does *not* get skipped if its dependencies fail,

Cargo.lock

Lines changed: 54 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci/docker/wasm32-wasip1/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \
77
xz-utils \
88
clang
99

10-
ENV VERSION=v34.0.1
10+
ENV VERSION=v38.0.3
1111

1212
RUN curl -L https://github.com/bytecodealliance/wasmtime/releases/download/${VERSION}/wasmtime-${VERSION}-x86_64-linux.tar.xz | tar xJf -
1313
ENV PATH=$PATH:/wasmtime-${VERSION}-x86_64-linux
1414

15-
ENV CARGO_TARGET_WASM32_WASIP1_RUNNER="wasmtime --dir /checkout/target/wasm32-wasip1/release/deps::."
15+
ENV CARGO_TARGET_WASM32_WASIP1_RUNNER="wasmtime -Wexceptions --dir /checkout/target/wasm32-wasip1/release/deps::."

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ 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
1317
RUN tar -xJf sde.tar.xz --strip-components=1 -C intel-sde
1418
ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER="/intel-sde/sde64 \
1519
-cpuid-in /checkout/ci/docker/x86_64-unknown-linux-gnu/cpuid.def \
1620
-rtm-mode full -tsx --"
17-
# These tests fail with SDE as it doesn't support saving register data
18-
ENV STDARCH_TEST_SKIP_FUNCTION="xsave,xsaveopt,xsave64,xsaveopt64"
21+
# SDE doesn't support AMD extensions
22+
# FIXME: find a way to test these
23+
ENV STDARCH_TEST_SKIP_FEATURE="sse4a,tbm,xop"

ci/docker/x86_64-unknown-linux-gnu/cpuid.def

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# CPUID_VERSION = 1.0
1313
# Input => Output
1414
# EAX ECX => EAX EBX ECX EDX
15-
00000000 ******** => 00000024 68747541 444d4163 69746e65
15+
00000000 ******** => 00000024 756e6547 6c65746e 49656e69
1616
00000001 ******** => 00400f10 00100800 7ffaf3ff bfebfbff
1717
00000002 ******** => 76035a01 00f0b6ff 00000000 00c10000
1818
00000003 ******** => 00000000 00000000 00000000 00000000
@@ -49,7 +49,7 @@
4949
00000024 00000000 => 00000001 00070002 00000000 00000000 #AVX10
5050
00000024 00000001 => 00000000 00000000 00000004 00000000
5151
80000000 ******** => 80000008 00000000 00000000 00000000
52-
80000001 ******** => 00000000 00000000 00200961 2c100000
52+
80000001 ******** => 00000000 00000000 00000121 2c100000
5353
80000002 ******** => 00000000 00000000 00000000 00000000
5454
80000003 ******** => 00000000 00000000 00000000 00000000
5555
80000004 ******** => 00000000 00000000 00000000 00000000
@@ -59,5 +59,4 @@
5959
80000008 ******** => 00003028 00000200 00000200 00000000
6060

6161
# This file was copied from intel-sde/misc/cpuid/future/cpuid.def, and modified to
62-
# use "AuthenticAMD" as the vendor and the support for `XOP`, `SSE4a`, `TBM`,
63-
# `AVX512_VP2INTERSECT` and the VEX variants of AVX512 was added in the CPUID.
62+
# add support for `AVX512_VP2INTERSECT`

ci/intrinsic-test-docker.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env sh
2+
3+
# Small script to run tests for a target (or all targets) inside all the
4+
# respective docker images.
5+
6+
set -ex
7+
8+
if [ $# -lt 1 ]; then
9+
>&2 echo "Usage: $0 <TARGET>"
10+
exit 1
11+
fi
12+
13+
run() {
14+
# Set the linker that is used for the host (e.g. when compiling a build.rs)
15+
# This overrides any configuration in e.g. `.cargo/config.toml`, which will
16+
# probably not work within the docker container.
17+
HOST_LINKER="CARGO_TARGET_$(rustc --print host-tuple | tr '[:lower:]-' '[:upper:]_')_LINKER"
18+
19+
# Prevent `Read-only file system (os error 30)`.
20+
cargo generate-lockfile
21+
22+
echo "Building docker container for TARGET=${1}"
23+
docker build -t stdarch -f "ci/docker/${1}/Dockerfile" ci/
24+
mkdir -p target c_programs rust_programs
25+
echo "Running docker"
26+
# shellcheck disable=SC2016
27+
docker run \
28+
--rm \
29+
--user "$(id -u)":"$(id -g)" \
30+
--env CARGO_HOME=/cargo \
31+
--env CARGO_TARGET_DIR=/checkout/target \
32+
--env TARGET="${1}" \
33+
--env "${HOST_LINKER}"="cc" \
34+
--env STDARCH_DISABLE_ASSERT_INSTR \
35+
--env NOSTD \
36+
--env NORUN \
37+
--env RUSTFLAGS \
38+
--env CARGO_UNSTABLE_BUILD_STD \
39+
--volume "${HOME}/.cargo":/cargo \
40+
--volume "$(rustc --print sysroot)":/rust:ro \
41+
--volume "$(pwd)":/checkout:ro \
42+
--volume "$(pwd)"/target:/checkout/target \
43+
--volume "$(pwd)"/c_programs:/checkout/c_programs \
44+
--volume "$(pwd)"/rust_programs:/checkout/rust_programs \
45+
--init \
46+
--workdir /checkout \
47+
--privileged \
48+
stdarch \
49+
sh -c "HOME=/tmp PATH=\$PATH:/rust/bin exec ci/intrinsic-test.sh ${1}"
50+
}
51+
52+
if [ -z "$1" ]; then
53+
>&2 echo "No target specified!"
54+
exit 1
55+
else
56+
run "${1}"
57+
fi

0 commit comments

Comments
 (0)